aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-09 23:20:13 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-09 23:20:13 +0000
commit4432a4e210b1a98abdebff2f1bd3555af2144d72 (patch)
tree3dd34a8c34793776e40587f22f12789ab230d69d
parent2e53aef54d8a8913c011eb1567d3b82921628ba3 (diff)
This commit was manufactured by cvs2svn to create tagapple/gcc-5000
'apple-gcc-5000'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/apple-gcc-5000@96220 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--CHANGES.Apple2
-rw-r--r--ChangeLog.apple-ppc287
-rw-r--r--ChangeLog.lno10
-rw-r--r--GNUmakefile90
-rw-r--r--README.Apple464
-rwxr-xr-xbuild_gcc513
-rwxr-xr-xconfigure5
-rw-r--r--configure.in5
-rw-r--r--fixincludes/fixincl.x250
-rw-r--r--fixincludes/inclhack.def103
-rw-r--r--gcc/ChangeLog.apple-ppc3783
-rw-r--r--gcc/ChangeLog.lno3390
-rw-r--r--gcc/Makefile.in74
-rw-r--r--gcc/alias.c222
-rw-r--r--gcc/bitmap.h5
-rw-r--r--gcc/builtins.c11
-rw-r--r--gcc/builtins.def2
-rw-r--r--gcc/c-common.c1049
-rw-r--r--gcc/c-common.h107
-rw-r--r--gcc/c-convert.c3
-rw-r--r--gcc/c-cppbuiltin.c26
-rw-r--r--gcc/c-decl.c223
-rw-r--r--gcc/c-incpath.c195
-rw-r--r--gcc/c-lex.c187
-rw-r--r--gcc/c-objc-common.c3
-rw-r--r--gcc/c-opts.c90
-rw-r--r--gcc/c-parse.in341
-rw-r--r--gcc/c-pch.c10
-rw-r--r--gcc/c-pragma.c207
-rw-r--r--gcc/c-pragma.h4
-rw-r--r--gcc/c-tree.h36
-rw-r--r--gcc/c-typeck.c354
-rw-r--r--gcc/c.opt128
-rw-r--r--gcc/calls.c162
-rw-r--r--gcc/cfghooks.c34
-rw-r--r--gcc/cfglayout.c2
-rw-r--r--gcc/cfgloop.c6
-rw-r--r--gcc/cfgrtl.c8
-rw-r--r--gcc/cgraph.c6
-rw-r--r--gcc/cgraphunit.c95
-rw-r--r--gcc/common.opt68
-rw-r--r--gcc/config.gcc9
-rw-r--r--gcc/config/darwin-c.c189
-rw-r--r--gcc/config/darwin-driver.c1386
-rw-r--r--gcc/config/darwin-protos.h42
-rw-r--r--gcc/config/darwin.c583
-rw-r--r--gcc/config/darwin.h306
-rw-r--r--gcc/config/darwin8.h12
-rw-r--r--gcc/config/i386/darwin.h85
-rw-r--r--gcc/config/i386/i386.c124
-rw-r--r--gcc/config/i386/i386.h13
-rw-r--r--gcc/config/rs6000/altivec.h15
-rw-r--r--gcc/config/rs6000/builtin.ops297
-rw-r--r--gcc/config/rs6000/darwin.h146
-rw-r--r--gcc/config/rs6000/darwin.md58
-rwxr-xr-xgcc/config/rs6000/ops-to-gp620
-rw-r--r--gcc/config/rs6000/rs6000-c.c162
-rw-r--r--gcc/config/rs6000/rs6000-protos.h11
-rw-r--r--gcc/config/rs6000/rs6000.c2870
-rw-r--r--gcc/config/rs6000/rs6000.h484
-rw-r--r--gcc/config/rs6000/rs6000.md255
-rw-r--r--gcc/config/rs6000/sysv4.h5
-rw-r--r--gcc/config/rs6000/t-darwin4
-rw-r--r--gcc/config/rs6000/t-darwin84
-rw-r--r--gcc/config/rs6000/t-rs60003
-rw-r--r--gcc/config/rs6000/vec.h4515
-rw-r--r--gcc/config/rs6000/vec.ops1025
-rw-r--r--gcc/config/t-darwin9
-rwxr-xr-xgcc/configure152
-rw-r--r--gcc/configure.ac4
-rw-r--r--gcc/convert.c37
-rw-r--r--gcc/coretypes.h2
-rw-r--r--gcc/cp/ChangeLog.apple-ppc392
-rw-r--r--gcc/cp/Make-lang.in28
-rw-r--r--gcc/cp/call.c63
-rw-r--r--gcc/cp/class.c211
-rw-r--r--gcc/cp/cp-objcp-common.c15
-rw-r--r--gcc/cp/cp-objcp-common.h16
-rw-r--r--gcc/cp/cp-tree.h54
-rw-r--r--gcc/cp/decl.c219
-rw-r--r--gcc/cp/decl2.c43
-rw-r--r--gcc/cp/init.c10
-rw-r--r--gcc/cp/lang-specs.h2
-rw-r--r--gcc/cp/lex.c52
-rw-r--r--gcc/cp/mangle.c15
-rw-r--r--gcc/cp/optimize.c189
-rw-r--r--gcc/cp/parser.c2245
-rw-r--r--gcc/cp/pt.c37
-rw-r--r--gcc/cp/semantics.c36
-rw-r--r--gcc/cp/tree.c4
-rw-r--r--gcc/cp/typeck.c301
-rw-r--r--gcc/cp/typeck2.c30
-rw-r--r--gcc/cppdefault.c19
-rw-r--r--gcc/cse.c74
-rw-r--r--gcc/dbxout.c20
-rw-r--r--gcc/df.c6
-rw-r--r--gcc/diagnostic.c32
-rw-r--r--gcc/doc/cppopts.texi14
-rw-r--r--gcc/doc/extend.texi151
-rw-r--r--gcc/doc/gcc.texi4
-rw-r--r--gcc/doc/include/sourcecode.texi36
-rw-r--r--gcc/doc/invoke.texi575
-rw-r--r--gcc/doc/trouble.texi20
-rw-r--r--gcc/dwarf2out.c99
-rw-r--r--gcc/explow.c15
-rw-r--r--gcc/expmed.c10
-rw-r--r--gcc/flags.h43
-rw-r--r--gcc/fold-const.c12
-rw-r--r--gcc/fortran/ChangeLog.lno2
-rw-r--r--gcc/fortran/f95-lang.c22
-rw-r--r--gcc/function.c116
-rw-r--r--gcc/function.h22
-rw-r--r--gcc/gcc.c568
-rw-r--r--gcc/gcc.h2
-rw-r--r--gcc/gcse.c69
-rw-r--r--gcc/gengtype.c11
-rw-r--r--gcc/gimplify.c48
-rw-r--r--gcc/ginclude/tgmath.h175
-rw-r--r--gcc/global.c64
-rw-r--r--gcc/hooks.c20
-rw-r--r--gcc/hooks.h4
-rw-r--r--gcc/java/ChangeLog.lno4
-rw-r--r--gcc/java/builtins.c10
-rw-r--r--gcc/java/decl.c2
-rw-r--r--gcc/java/lang.c50
-rw-r--r--gcc/lambda.h2
-rw-r--r--gcc/langhooks-def.h10
-rw-r--r--gcc/langhooks.c8
-rw-r--r--gcc/langhooks.h9
-rw-r--r--gcc/libgcc2.c8
-rw-r--r--gcc/loop-doloop.c18
-rw-r--r--gcc/loop.c49
-rw-r--r--gcc/mklibgcc.in16
-rw-r--r--gcc/objc/ChangeLog.apple-ppc232
-rw-r--r--gcc/objc/Make-lang.in22
-rw-r--r--gcc/objc/config-lang.in6
-rw-r--r--gcc/objc/objc-act.c1032
-rw-r--r--gcc/objc/objc-act.h78
-rw-r--r--gcc/objc/objc-lang.c9
-rw-r--r--gcc/objcp/.cvsignore4
-rw-r--r--gcc/objcp/ChangeLog.apple-ppc7
-rw-r--r--gcc/objcp/Make-lang.in154
-rw-r--r--gcc/objcp/config-lang.in47
-rw-r--r--gcc/objcp/lang-specs.h61
-rw-r--r--gcc/objcp/objcp-decl.c135
-rw-r--r--gcc/objcp/objcp-decl.h96
-rw-r--r--gcc/objcp/objcp-lang.c150
-rw-r--r--gcc/opts.c80
-rw-r--r--gcc/params.def16
-rw-r--r--gcc/predict.c8
-rw-r--r--gcc/print-tree.c4
-rw-r--r--gcc/reg-notes.def5
-rw-r--r--gcc/regrename.c17
-rw-r--r--gcc/reload.c48
-rw-r--r--gcc/reload1.c17
-rw-r--r--gcc/rtl.h6
-rw-r--r--gcc/scan-decls.c7
-rw-r--r--gcc/sched-rgn.c5
-rw-r--r--gcc/simplify-rtx.c17
-rw-r--r--gcc/stor-layout.c85
-rw-r--r--gcc/stub-objc.c59
-rw-r--r--gcc/target-def.h27
-rw-r--r--gcc/target.h27
-rw-r--r--gcc/targhooks.c10
-rw-r--r--gcc/targhooks.h3
-rw-r--r--gcc/testsuite/ChangeLog.apple-ppc999
-rw-r--r--gcc/testsuite/ChangeLog.lno203
-rw-r--r--gcc/testsuite/UNTESTABLE57
-rw-r--r--gcc/testsuite/bugs/powerpc/g++.xfail285
-rw-r--r--gcc/testsuite/bugs/powerpc/gcc.xfail860
-rw-r--r--gcc/testsuite/bugs/powerpc/obj-c++.xfail15
-rw-r--r--gcc/testsuite/bugs/powerpc/objc.xfail52
-rw-r--r--gcc/testsuite/g++.dg/align-test-1.C295
-rw-r--r--gcc/testsuite/g++.dg/altivec-1.C12
-rw-r--r--gcc/testsuite/g++.dg/altivec-2.C15
-rw-r--r--gcc/testsuite/g++.dg/altivec-3.C21
-rw-r--r--gcc/testsuite/g++.dg/altivec-4.C129
-rw-r--r--gcc/testsuite/g++.dg/altivec-5.C19
-rw-r--r--gcc/testsuite/g++.dg/altivec-7.C66
-rw-r--r--gcc/testsuite/g++.dg/altivec-8.C31
-rw-r--r--gcc/testsuite/g++.dg/apple-altivec-1.C9
-rw-r--r--gcc/testsuite/g++.dg/apple-altivec-2.C32
-rw-r--r--gcc/testsuite/g++.dg/apple-altivec-6.C15
-rw-r--r--gcc/testsuite/g++.dg/apple-altivec-test.C57
-rw-r--r--gcc/testsuite/g++.dg/asm-block-1.C75
-rw-r--r--gcc/testsuite/g++.dg/asm-block-2.C101
-rw-r--r--gcc/testsuite/g++.dg/asm-block-3.C24
-rw-r--r--gcc/testsuite/g++.dg/asm-block-4.C13
-rw-r--r--gcc/testsuite/g++.dg/asm-function-1.C39
-rw-r--r--gcc/testsuite/g++.dg/asm-function-10.C21
-rw-r--r--gcc/testsuite/g++.dg/asm-function-11.C24
-rw-r--r--gcc/testsuite/g++.dg/asm-function-12.C18
-rw-r--r--gcc/testsuite/g++.dg/asm-function-13.C26
-rw-r--r--gcc/testsuite/g++.dg/asm-function-2.C75
-rw-r--r--gcc/testsuite/g++.dg/asm-function-3.C26
-rw-r--r--gcc/testsuite/g++.dg/asm-function-4.C62
-rw-r--r--gcc/testsuite/g++.dg/asm-function-5.C55
-rw-r--r--gcc/testsuite/g++.dg/asm-function-6.C33
-rw-r--r--gcc/testsuite/g++.dg/asm-function-7.C17
-rw-r--r--gcc/testsuite/g++.dg/asm-function-8.C14
-rw-r--r--gcc/testsuite/g++.dg/asm-function-9.C12
-rw-r--r--gcc/testsuite/g++.dg/const-cfstring-1.C26
-rw-r--r--gcc/testsuite/g++.dg/expr/align68k-1.C53
-rw-r--r--gcc/testsuite/g++.dg/expr/align68k-2.C45
-rw-r--r--gcc/testsuite/g++.dg/expr/cast-ptr-1.C15
-rw-r--r--gcc/testsuite/g++.dg/expr/fieldref1.C23
-rw-r--r--gcc/testsuite/g++.dg/ext/altivec-apple-11.C18
-rw-r--r--gcc/testsuite/g++.dg/ext/apple-altivec-1.C43
-rw-r--r--gcc/testsuite/g++.dg/ext/apple-altivec-2.C398
-rw-r--r--gcc/testsuite/g++.dg/ext/apple-altivec-3.C18
-rw-r--r--gcc/testsuite/g++.dg/ext/apple-altivec-4.C15
-rw-r--r--gcc/testsuite/g++.dg/ext/apple-altivec-5.C31
-rw-r--r--gcc/testsuite/g++.dg/ext/apple-altivec-6.C15
-rw-r--r--gcc/testsuite/g++.dg/ext/lvalue-cast-1.C34
-rw-r--r--gcc/testsuite/g++.dg/ext/lvalue-cast-2.C14
-rw-r--r--gcc/testsuite/g++.dg/ext/lvalue-cond-1.C32
-rw-r--r--gcc/testsuite/g++.dg/ext/new-delete-1.C28
-rw-r--r--gcc/testsuite/g++.dg/ext/new-delete-2.C28
-rw-r--r--gcc/testsuite/g++.dg/kext1.C11
-rw-r--r--gcc/testsuite/g++.dg/kext10.C23
-rw-r--r--gcc/testsuite/g++.dg/kext11.C39
-rw-r--r--gcc/testsuite/g++.dg/kext2.C13
-rw-r--r--gcc/testsuite/g++.dg/kext3.C18
-rw-r--r--gcc/testsuite/g++.dg/kext4.C27
-rw-r--r--gcc/testsuite/g++.dg/kext5.C16
-rw-r--r--gcc/testsuite/g++.dg/kext6.C29
-rw-r--r--gcc/testsuite/g++.dg/kext7.C20
-rw-r--r--gcc/testsuite/g++.dg/kext8.C36
-rw-r--r--gcc/testsuite/g++.dg/kext9.C13
-rw-r--r--gcc/testsuite/g++.dg/pascal-strings-1.C44
-rw-r--r--gcc/testsuite/g++.dg/pascal-strings-2.C43
-rw-r--r--gcc/testsuite/g++.dg/pascal-strings-3.C20
-rw-r--r--gcc/testsuite/g++.dg/pascal-strings-4.C20
-rw-r--r--gcc/testsuite/g++.dg/preserve-PPC-CR.C41
-rw-r--r--gcc/testsuite/g++.old-deja/g++.abi/align.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.mike/pascal.C5
-rw-r--r--gcc/testsuite/gcc.apple/Wextra-tokens.c21
-rw-r--r--gcc/testsuite/gcc.apple/Wfour-char-constants-1.c12
-rw-r--r--gcc/testsuite/gcc.apple/Wfour-char-constants-2.c12
-rw-r--r--gcc/testsuite/gcc.apple/Wmost.c19
-rw-r--r--gcc/testsuite/gcc.apple/Wno-newline-1.c3
-rw-r--r--gcc/testsuite/gcc.apple/Wno-newline-2.c4
-rw-r--r--gcc/testsuite/gcc.apple/align-test-1.c613
-rw-r--r--gcc/testsuite/gcc.apple/align-test-2.c163
-rw-r--r--gcc/testsuite/gcc.apple/align-test-3.c136
-rw-r--r--gcc/testsuite/gcc.apple/align-test-4.c233
-rw-r--r--gcc/testsuite/gcc.apple/align-test-4.h43
-rw-r--r--gcc/testsuite/gcc.apple/align-test-5a.c87
-rw-r--r--gcc/testsuite/gcc.apple/align-test-5b.c87
-rw-r--r--gcc/testsuite/gcc.apple/align-test-5c.c87
-rw-r--r--gcc/testsuite/gcc.apple/align-test-5d.c90
-rw-r--r--gcc/testsuite/gcc.apple/altivec-1.c124
-rw-r--r--gcc/testsuite/gcc.apple/altivec-19.c15
-rw-r--r--gcc/testsuite/gcc.apple/altivec-2.c22
-rw-r--r--gcc/testsuite/gcc.apple/altivec-20.c7
-rw-r--r--gcc/testsuite/gcc.apple/altivec-3.c14
-rw-r--r--gcc/testsuite/gcc.apple/altivec-4.c23
-rw-r--r--gcc/testsuite/gcc.apple/altivec-5.c33
-rw-r--r--gcc/testsuite/gcc.apple/altivec-faltivec-1.c135
-rw-r--r--gcc/testsuite/gcc.apple/altivec-faltivec-2.c135
-rw-r--r--gcc/testsuite/gcc.apple/altivec-maltivec-1.c135
-rw-r--r--gcc/testsuite/gcc.apple/altivec-test-macro.c30
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-1.c64
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-10.c81
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-11.c23
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-12.c395
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-13.c43
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-14.c15
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-15.c39
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-2.c95
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-3.c14
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-4.c20
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-5.c31
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-6.c31
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-7.c34
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-8.c36
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-9.c9
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-abi-test.c39
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-abi.c66
-rw-r--r--gcc/testsuite/gcc.apple/apple-altivec-builtin-nanf.c8
-rw-r--r--gcc/testsuite/gcc.apple/applecc.c14
-rw-r--r--gcc/testsuite/gcc.apple/asm-block-1.c75
-rw-r--r--gcc/testsuite/gcc.apple/asm-block-2.c88
-rw-r--r--gcc/testsuite/gcc.apple/asm-block-3.c11
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-1.c51
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-10.c16
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-11.c24
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-12.c18
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-13.c26
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-14.c11
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-2.c73
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-3.c26
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-4.c62
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-5.c49
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-6.c33
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-7.c17
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-8.c14
-rw-r--r--gcc/testsuite/gcc.apple/asm-function-9.c12
-rw-r--r--gcc/testsuite/gcc.apple/const-cfstring-1.c29
-rw-r--r--gcc/testsuite/gcc.apple/const-cfstring-2.c13
-rw-r--r--gcc/testsuite/gcc.apple/const-cfstring-3.c29
-rw-r--r--gcc/testsuite/gcc.apple/const-cfstring-4.c30
-rw-r--r--gcc/testsuite/gcc.apple/cw-altivec-asm-block.c35
-rw-r--r--gcc/testsuite/gcc.apple/darwin-fsel-3.c12
-rw-r--r--gcc/testsuite/gcc.apple/dg.exp40
-rw-r--r--gcc/testsuite/gcc.apple/execute/bitfield-1.c52
-rw-r--r--gcc/testsuite/gcc.apple/execute/execute.exp43
-rw-r--r--gcc/testsuite/gcc.apple/fenv-minmax-1.c11
-rw-r--r--gcc/testsuite/gcc.apple/framework1.c12
-rw-r--r--gcc/testsuite/gcc.apple/fwritable-strings.c19
-rw-r--r--gcc/testsuite/gcc.apple/import.c9
-rw-r--r--gcc/testsuite/gcc.apple/importee.h3
-rw-r--r--gcc/testsuite/gcc.apple/inttypes-1.c21
-rw-r--r--gcc/testsuite/gcc.apple/inttypes-2.c45
-rw-r--r--gcc/testsuite/gcc.apple/inttypes-3.c51
-rw-r--r--gcc/testsuite/gcc.apple/inttypes-4.c43
-rw-r--r--gcc/testsuite/gcc.apple/inttypes-wchar-1.c26
-rw-r--r--gcc/testsuite/gcc.apple/inttypes-wchar-2.c26
-rw-r--r--gcc/testsuite/gcc.apple/lazy-ptr-test.c18
-rw-r--r--gcc/testsuite/gcc.apple/mac68k-align-unsup.c9
-rw-r--r--gcc/testsuite/gcc.apple/no-math-errno.c8
-rw-r--r--gcc/testsuite/gcc.apple/no-warning.c8
-rw-r--r--gcc/testsuite/gcc.apple/non-lazy-ptr-test.c40
-rw-r--r--gcc/testsuite/gcc.apple/notailcall-1.c73
-rw-r--r--gcc/testsuite/gcc.apple/objcpp.c6
-rw-r--r--gcc/testsuite/gcc.apple/one.framework/Headers/one.h3
-rw-r--r--gcc/testsuite/gcc.apple/pascal-strings-1.c46
-rw-r--r--gcc/testsuite/gcc.apple/pascal-strings-2.c45
-rw-r--r--gcc/testsuite/gcc.apple/pascal-strings-3.c20
-rw-r--r--gcc/testsuite/gcc.apple/power-align-unsup.c8
-rw-r--r--gcc/testsuite/gcc.apple/ppc-ignored-options.c11
-rw-r--r--gcc/testsuite/gcc.apple/ppc_intrinsics-1.c35
-rw-r--r--gcc/testsuite/gcc.apple/ppc_intrinsics-2.c66
-rw-r--r--gcc/testsuite/gcc.apple/preprocess.s16
-rw-r--r--gcc/testsuite/gcc.apple/shorten.c20
-rw-r--r--gcc/testsuite/gcc.apple/special/liblongcall.c10
-rw-r--r--gcc/testsuite/gcc.apple/special/longcall-prog.c18
-rw-r--r--gcc/testsuite/gcc.apple/special/longcall.exp69
-rw-r--r--gcc/testsuite/gcc.apple/special/special.exp42
-rw-r--r--gcc/testsuite/gcc.apple/special/zerofill.c5
-rw-r--r--gcc/testsuite/gcc.apple/string-insns.c9
-rw-r--r--gcc/testsuite/gcc.apple/test-ldouble.c24
-rw-r--r--gcc/testsuite/gcc.apple/test-local-static-longlong.c19
-rw-r--r--gcc/testsuite/gcc.apple/x86-ignored-options.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20050303-1.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/simd-4.x4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/pr17133.c28
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/simd-1.x7
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/simd-2.x7
-rw-r--r--gcc/testsuite/gcc.dg/c99-tgmath-1.c248
-rw-r--r--gcc/testsuite/gcc.dg/c99-tgmath-2.c15
-rw-r--r--gcc/testsuite/gcc.dg/c99-tgmath-3.c15
-rw-r--r--gcc/testsuite/gcc.dg/c99-tgmath-4.c15
-rw-r--r--gcc/testsuite/gcc.dg/cast-lvalue-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/cast-ptr-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/cond-lvalue-1.c6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/c++98-pedantic.cc11
-rw-r--r--gcc/testsuite/gcc.dg/cpp/c++98.cc11
-rw-r--r--gcc/testsuite/gcc.dg/cpp/cpp.exp7
-rw-r--r--gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/extratokens.c3
-rw-r--r--gcc/testsuite/gcc.dg/cpp/headermap-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/cpp/headermap-2.c15
-rw-r--r--gcc/testsuite/gcc.dg/cpp/headermap.hmapbin0 -> 932 bytes
-rw-r--r--gcc/testsuite/gcc.dg/cpp/if-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/inc/A.h6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/inc/bA.h6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/inc/c.h6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/inc/d/d.h7
-rw-r--r--gcc/testsuite/gcc.dg/cpp/include2.c6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c1
-rw-r--r--gcc/testsuite/gcc.dg/cpp/skipping2.c2
-rw-r--r--gcc/testsuite/gcc.dg/lvalue-cast-1.c23
-rw-r--r--gcc/testsuite/gcc.dg/lvalue-cast-2.c14
-rw-r--r--gcc/testsuite/gcc.dg/lvalue-cond-1.c30
-rw-r--r--gcc/testsuite/gcc.dg/lvalue1.c2
-rw-r--r--gcc/testsuite/gcc.dg/mac68k-pragma-unsup-1.c12
-rw-r--r--gcc/testsuite/gcc.dg/pch/apple-altivec-1.c126
-rw-r--r--gcc/testsuite/gcc.dg/pch/apple-altivec-1.hs2
-rw-r--r--gcc/testsuite/gcc.dg/pch/faltivec-1.c17
-rw-r--r--gcc/testsuite/gcc.dg/pch/faltivec-1.hs3
-rw-r--r--gcc/testsuite/gcc.dg/pch/pch.exp23
-rw-r--r--gcc/testsuite/gcc.dg/pr20216.c16
-rw-r--r--gcc/testsuite/gcc.dg/pragma-darwin.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/20040216-1.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c36
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-02.c29
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-03.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-04.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c33
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-06.c51
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-07.c28
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-08.c32
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-09.c42
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c31
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c.ddall59
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-11.c60
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c33
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c33
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c37
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-15.c24
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-16.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-17.c36
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c32
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-19.c21
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-20.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-21.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-22.c24
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-23.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-24.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-25.c29
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-26.c26
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-27.c41
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-28.c40
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-29.c41
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c.ddall96
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c20
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c.ddall37
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c36
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c.ddall5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c47
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c.ddall5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c34
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c.ddall5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c35
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c.ddall59
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c28
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c.ddall59
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-37.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-38.c49
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c46
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-40.c23
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-41.c53
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-42.c31
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-43.c65
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-44.c39
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-45.c45
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-46.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-47.c36
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-48.c30
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-49.c26
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-50.c27
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-51.c23
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c23
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c.ddall49
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c129
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-54.c34
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-55.c17
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-56.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-57.c24
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-58.c23
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-59.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-59.c.ddall80
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-60.c22
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-60.c.ddall51
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-chrec/tree-ssa-scev.exp36
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-vect/ifc-01.c55
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-vect/ifc-02.c49
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-vect/pr16105.c23
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-31.c44
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-35.c43
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect.exp36
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa-vect/tree-vect.h25
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c3
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040308-1.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040308-2.c19
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/20040308-3.c18
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c38
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-dv-1.c21
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-1.c76
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c33
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c32
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c33
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c33
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c33
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c33
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-8.c37
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c40
-rw-r--r--gcc/testsuite/gcc.dg/vect/vect-none.c6
-rw-r--r--gcc/testsuite/gcc.dg/verbose-asm-2.c13
-rw-r--r--gcc/testsuite/lib/g++.exp5
-rw-r--r--gcc/testsuite/lib/gcc.exp5
-rw-r--r--gcc/testsuite/lib/obj-c++-dg.exp29
-rw-r--r--gcc/testsuite/lib/obj-c++.exp366
-rw-r--r--gcc/testsuite/lib/scantree.exp63
-rw-r--r--gcc/testsuite/obj-c++.dg/basic.mm22
-rw-r--r--gcc/testsuite/obj-c++.dg/comp-types-1.mm17
-rw-r--r--gcc/testsuite/obj-c++.dg/cxx-class-1.mm20
-rw-r--r--gcc/testsuite/obj-c++.dg/cxx-ivars-1.mm42
-rw-r--r--gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm77
-rw-r--r--gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm46
-rw-r--r--gcc/testsuite/obj-c++.dg/cxx-scope-1.mm54
-rw-r--r--gcc/testsuite/obj-c++.dg/cxx-scope-2.mm21
-rw-r--r--gcc/testsuite/obj-c++.dg/defs.mm44
-rw-r--r--gcc/testsuite/obj-c++.dg/dg.exp38
-rw-r--r--gcc/testsuite/obj-c++.dg/empty-private-1.mm9
-rw-r--r--gcc/testsuite/obj-c++.dg/encode-1.mm23
-rw-r--r--gcc/testsuite/obj-c++.dg/encode-2.mm16
-rw-r--r--gcc/testsuite/obj-c++.dg/extern-c-1.mm19
-rw-r--r--gcc/testsuite/obj-c++.dg/extra-semi.mm10
-rw-r--r--gcc/testsuite/obj-c++.dg/isa-field-1.mm44
-rw-r--r--gcc/testsuite/obj-c++.dg/ivar-list-semi.mm13
-rw-r--r--gcc/testsuite/obj-c++.dg/local-decl-1.mm43
-rw-r--r--gcc/testsuite/obj-c++.dg/lookup-1.mm9
-rw-r--r--gcc/testsuite/obj-c++.dg/lookup-2.mm57
-rw-r--r--gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm32
-rw-r--r--gcc/testsuite/obj-c++.dg/method-1.mm30
-rw-r--r--gcc/testsuite/obj-c++.dg/method-2.mm56
-rw-r--r--gcc/testsuite/obj-c++.dg/method-3.mm24
-rw-r--r--gcc/testsuite/obj-c++.dg/method-4.mm24
-rw-r--r--gcc/testsuite/obj-c++.dg/method-5.mm30
-rw-r--r--gcc/testsuite/obj-c++.dg/no-extra-load.mm23
-rw-r--r--gcc/testsuite/obj-c++.dg/objc-fast-1.mm24
-rw-r--r--gcc/testsuite/obj-c++.dg/objc-fast-2.mm29
-rw-r--r--gcc/testsuite/obj-c++.dg/objc-fast-3.mm33
-rw-r--r--gcc/testsuite/obj-c++.dg/objc-fast-4.mm13
-rw-r--r--gcc/testsuite/obj-c++.dg/objc-gc-1.mm145
-rw-r--r--gcc/testsuite/obj-c++.dg/objc-gc-2.mm60
-rw-r--r--gcc/testsuite/obj-c++.dg/overload-1.mm11
-rw-r--r--gcc/testsuite/obj-c++.dg/pascal-strings-1.mm20
-rw-r--r--gcc/testsuite/obj-c++.dg/pascal-strings-2.mm20
-rw-r--r--gcc/testsuite/obj-c++.dg/pragma-1.mm12
-rw-r--r--gcc/testsuite/obj-c++.dg/pragma-2.mm24
-rw-r--r--gcc/testsuite/obj-c++.dg/private-1.mm59
-rw-r--r--gcc/testsuite/obj-c++.dg/private-2.mm55
-rw-r--r--gcc/testsuite/obj-c++.dg/proto-qual-1.mm52
-rw-r--r--gcc/testsuite/obj-c++.dg/qual-types-1.mm72
-rw-r--r--gcc/testsuite/obj-c++.dg/selector-1.mm32
-rw-r--r--gcc/testsuite/obj-c++.dg/super-class-1.mm30
-rw-r--r--gcc/testsuite/obj-c++.dg/super-dealloc-1.mm47
-rw-r--r--gcc/testsuite/obj-c++.dg/super-dealloc-2.mm47
-rw-r--r--gcc/testsuite/obj-c++.dg/template-1.mm49
-rw-r--r--gcc/testsuite/obj-c++.dg/template-2.mm29
-rw-r--r--gcc/testsuite/obj-c++.dg/template-3.mm80
-rw-r--r--gcc/testsuite/obj-c++.dg/template-4.mm82
-rw-r--r--gcc/testsuite/obj-c++.dg/template-5.mm17
-rw-r--r--gcc/testsuite/obj-c++.dg/template-6.mm16
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-1.mm42
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-2.mm80
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-3.mm20
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-4.mm27
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-5.mm28
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-6.mm14
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-7.mm29
-rw-r--r--gcc/testsuite/obj-c++.dg/try-catch-8.mm28
-rw-r--r--gcc/testsuite/obj-c++.dg/va-meth-1.mm74
-rw-r--r--gcc/testsuite/objc.dg/comp-types-8.m25
-rw-r--r--gcc/testsuite/objc.dg/const-cfstring-1.m57
-rw-r--r--gcc/testsuite/objc.dg/const-cfstring-2.m26
-rw-r--r--gcc/testsuite/objc.dg/const-cfstring-3.m26
-rw-r--r--gcc/testsuite/objc.dg/const-cfstring-4.m12
-rw-r--r--gcc/testsuite/objc.dg/dg.exp3
-rw-r--r--gcc/testsuite/objc.dg/encode-1.m13
-rw-r--r--gcc/testsuite/objc.dg/encode-6.m23
-rw-r--r--gcc/testsuite/objc.dg/extra-semi.m10
-rw-r--r--gcc/testsuite/objc.dg/isa-field-1.m44
-rw-r--r--gcc/testsuite/objc.dg/lookup-1.m55
-rw-r--r--gcc/testsuite/objc.dg/lvalue-cast-1.m32
-rw-r--r--gcc/testsuite/objc.dg/method-15.m56
-rw-r--r--gcc/testsuite/objc.dg/method-16.m24
-rw-r--r--gcc/testsuite/objc.dg/method-17.m26
-rw-r--r--gcc/testsuite/objc.dg/method-18.m30
-rw-r--r--gcc/testsuite/objc.dg/method-6.m8
-rw-r--r--gcc/testsuite/objc.dg/method-7.m7
-rw-r--r--gcc/testsuite/objc.dg/method-9.m8
-rw-r--r--gcc/testsuite/objc.dg/next-runtime-1.m18
-rw-r--r--gcc/testsuite/objc.dg/no-extra-load.m5
-rw-r--r--gcc/testsuite/objc.dg/objc-fast-1.m24
-rw-r--r--gcc/testsuite/objc.dg/objc-fast-2.m29
-rw-r--r--gcc/testsuite/objc.dg/objc-fast-3.m33
-rw-r--r--gcc/testsuite/objc.dg/objc-fast-4.m13
-rw-r--r--gcc/testsuite/objc.dg/objc-gc-1.m146
-rw-r--r--gcc/testsuite/objc.dg/objc-gc-2.m172
-rw-r--r--gcc/testsuite/objc.dg/objc-gc-3.m53
-rw-r--r--gcc/testsuite/objc.dg/objc.c6
-rw-r--r--gcc/testsuite/objc.dg/pascal-strings-1.m20
-rw-r--r--gcc/testsuite/objc.dg/pragma-1.m24
-rw-r--r--gcc/testsuite/objc.dg/selector-2.m10
-rw-r--r--gcc/testsuite/objc.dg/super-dealloc-1.m47
-rw-r--r--gcc/testsuite/objc.dg/super-dealloc-2.m47
-rw-r--r--gcc/testsuite/objc.dg/try-catch-6.m29
-rw-r--r--gcc/testsuite/objc.dg/try-catch-7.m28
-rw-r--r--gcc/testsuite/objc/execute/next_mapping.h34
-rw-r--r--gcc/timevar.c66
-rw-r--r--gcc/timevar.def9
-rw-r--r--gcc/toplev.c139
-rw-r--r--gcc/toplev.h4
-rw-r--r--gcc/tree-cfg.c37
-rw-r--r--gcc/tree-chrec.c142
-rw-r--r--gcc/tree-data-ref.c12
-rw-r--r--gcc/tree-data-ref.h7
-rw-r--r--gcc/tree-flow.h14
-rw-r--r--gcc/tree-if-conv.c3
-rw-r--r--gcc/tree-nested.c3
-rw-r--r--gcc/tree-optimize.c17
-rw-r--r--gcc/tree-pass.h14
-rw-r--r--gcc/tree-ssa-dom.c24
-rw-r--r--gcc/tree-ssa-forwprop.c231
-rw-r--r--gcc/tree-ssa-loop-ch.c3
-rw-r--r--gcc/tree-ssa-loop-memset.c733
-rw-r--r--gcc/tree-ssa-loop-niter.c83
-rw-r--r--gcc/tree-ssa-loop-prefetch.c891
-rw-r--r--gcc/tree-ssa-loop.c158
-rw-r--r--gcc/tree-ssa-operands.c36
-rw-r--r--gcc/tree-vectorizer.c283
-rw-r--r--gcc/tree-vectorizer.h6
-rw-r--r--gcc/tree.c34
-rw-r--r--gcc/tree.def5
-rw-r--r--gcc/tree.h43
-rw-r--r--gcc/value-prof.c5
-rw-r--r--gcc/varasm.c82
-rw-r--r--gcc/version.c18
-rw-r--r--include/demangle.h4
-rw-r--r--libcpp/ChangeLog.apple-ppc67
-rw-r--r--libcpp/charset.c52
-rw-r--r--libcpp/directives.c79
-rw-r--r--libcpp/errors.c27
-rw-r--r--libcpp/files.c210
-rw-r--r--libcpp/include/cpplib.h138
-rw-r--r--libcpp/init.c27
-rw-r--r--libcpp/internal.h15
-rw-r--r--libcpp/lex.c151
-rw-r--r--libcpp/macro.c84
-rw-r--r--libcpp/makedepend.c7
-rw-r--r--libcpp/pch.c36
-rw-r--r--libobjc/encoding.c21
-rw-r--r--libstdc++-v3/config/os/bsd/darwin/os_defines.h138
-rwxr-xr-xlibstdc++-v3/configure15
-rw-r--r--libstdc++-v3/configure.ac11
-rw-r--r--libstdc++-v3/configure.host4
-rw-r--r--libstdc++-v3/include/std/std_fstream.h6
-rw-r--r--libstdc++-v3/libsupc++/eh_alloc.cc8
-rw-r--r--libstdc++-v3/libsupc++/eh_globals.cc44
-rw-r--r--libstdc++-v3/libsupc++/eh_terminate.cc47
-rw-r--r--libstdc++-v3/libsupc++/new_handler.cc20
-rw-r--r--libstdc++-v3/libsupc++/new_op.cc25
-rw-r--r--libstdc++-v3/libsupc++/new_opnt.cc13
-rw-r--r--libstdc++-v3/libsupc++/pure.cc12
-rwxr-xr-xltconfig3
-rw-r--r--ltmain.sh30
-rw-r--r--more-hdrs/assert.h71
-rw-r--r--more-hdrs/float.h9
-rw-r--r--more-hdrs/inttypes.h299
-rw-r--r--more-hdrs/machine/limits.h11
-rw-r--r--more-hdrs/ppc_intrinsics.h1026
-rw-r--r--more-hdrs/stdarg.h6
-rw-r--r--more-hdrs/stdbool.h10
-rw-r--r--more-hdrs/stdint.h245
-rw-r--r--more-hdrs/varargs.h6
-rw-r--r--order-files/HOW TO BUILD170
-rw-r--r--order-files/cc1.order1188
-rw-r--r--order-files/cc1obj.order2163
-rw-r--r--order-files/cc1objplus.order952
-rw-r--r--order-files/cc1plus.order1356
656 files changed, 63640 insertions, 1383 deletions
diff --git a/CHANGES.Apple b/CHANGES.Apple
new file mode 100644
index 00000000000..98427f492d2
--- /dev/null
+++ b/CHANGES.Apple
@@ -0,0 +1,2 @@
+#APPLE LOCAL file metadata (see Apple_Local_GCC_Change_Organization/Metadata in Wiki)
+
diff --git a/ChangeLog.apple-ppc b/ChangeLog.apple-ppc
new file mode 100644
index 00000000000..8af736e83bf
--- /dev/null
+++ b/ChangeLog.apple-ppc
@@ -0,0 +1,287 @@
+2005-02-28 Stan Shebs <shebs@apple.com>
+ Ian Ollmann <iano@apple.com>
+
+ Radar 3951637
+ * more-hdrs/ppc_intrinsic.h: Make 64-bit friendly:
+ (__lwbrx, __rlwnm, __rlwinm, __mulhw, __mulhwu): Use int
+ instead of long for 32-bit values.
+ (__cntlzw, __cntlzd): Use existing builtins.
+
+2005-01-24 Robert Bowdidge <bowdidge@apple.com>
+ Radar 3971437
+ * build_gcc: run nmedit on libcc_kext.a so that dependent kexts can
+ all have their own copy of (say) divdi3. This returns libcc_kext.a to
+ how things were done in gcc-3.3.
+
+2005-01-18 Stuart Hastings <stuart@apple.com>
+
+ Radar 3939868
+ * more-hdrs/stdint.h (intmax_t, unitmax_t): Derive from __INTMAX_TYPE__,
+ __UINTMAX_TYPE__ if available.
+
+2004-12-16 Stan Shebs <shebs@apple.com>
+
+ * build_gcc: Lipo in the ppc64 libstdc++ dylib if it exists.
+
+2004-12-16 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3920294
+ * more-hdrs/float.h: Replace by stub for Metrowerks.
+ Radar 3920035
+ * more-hdrs/stdbool.h: Add Metrowerks stub-ness.
+
+2004-12-06 Mike Stump <mrs@apple.com>
+
+ Radar 3891870
+ * more-hdrs/machine/limits.h: Instead of fixincluding files we own,
+ just fix it.
+ * build_gcc (more-hdrs): Fix up nested header support.
+ * fixincludes/fixinc.in: Add apple local markers, avoid 64bit hack
+ when possible.
+
+2004-11-27 Stan Shebs <shebs@apple.com>
+
+ libstdc++-v3/configure.ac: Always treat Darwin 8.x targets as if they
+ were cross-compiling.
+ libstdc++-v3/configure: Regenerate.
+
+2004-11-23 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3893528
+ * build_gcc: Don't install any header from more-hdrs
+ that Libc has already provided.
+
+ * fixincludes/inclhack.def (darwin_stdint_guards_intn): Remove
+ _DECLARED from end of guard macro names.
+ (darwin_stdint_guards_intptr): Likewise.
+ (darwin_stdint_guards_uintptr): Likewise.
+ * more-hdrs/stdint.h: Likewise.
+ * fixincludes/fixincl.x: Regenerate.
+
+2004-11-23 Stan Shebs <shebs@apple.com>
+
+ * build_gcc: Detect Darwin version (7 vs 8), and append
+ version to all the "-apple-darwin" pathnames.
+ * libstdc++-v3/configure: Remove bringup hack.
+
+2004-11-13 Stan Shebs <shebs@apple.com>
+
+ * fixincludes/fixinc.in: Revive 64-bit bandaid.
+
+2004-11-12 Matt Austern <austern@apple.com>
+
+ * build_gcc: don't install more_hdrs/assert.h on Tiger systems.
+
+2004-11-09 Geoffrey Keating <geoffk@apple.com>
+
+ * build_gcc: lipo the libexec/.../install-tools files together.
+
+2004-11-08 Geoffrey Keating <geoffk@apple.com>
+
+ * fixincludes/inclhack.def (darwin_macosx_deployment_target): New.
+ * fixincludes/fixincl.x: Regenerate.
+
+2004-11-05 Geoffrey Keating <geoffk@apple.com>
+
+ * GNUmakefile: Say 'install' and 'clean' are phony targets.
+
+2004-11-02 Stan Shebs <shebs@apple.com>
+
+ * configure.in: Disable target-libobjc on Darwin for now.
+ * configure: Likewise.
+
+2004-10-13 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3476357
+ * more-hdrs/stdint.h: Don't include sys/types.h. Define
+ int*_t, intptr_t, and uintptr_t here, with guards. Define
+ WINT_{MIN,MAX} and SIG_ATOMIC_{MIN,MAX}.
+ * fixincludes/inclhack.def (darwin_stdint_guards_intn): New.
+ (darwin_stdint_guards_intptr): New.
+ (darwin_stdint_guards_uintptr): New.
+ * fixincludes/fixincl.x: Regenerate.
+
+2004-10-11 Devang Patel <dpatel@apple.com>
+
+ Radar 3208244
+ * more-hdrs/ppc_intrinsics.h (__lwsync, __cntlzd, __dcbzl,
+ __fctidz, __fctid, __fcfid, __nop): New.
+
+2004-10-07 Robert Bowdidge <bowdidge@apple.com>
+
+ * build_gcc: remove directories /usr/libexec/gcc/darwin/arch/4.0 and
+ /usr/lib/gcc/darwin/arch/4.0 that are no longer needed.
+
+2004-10-07 Robert Bowdidge <bowdidge@apple.com>
+
+ * build_gcc: Remove earlier patch for copying cpp into
+ /usr/libexec/blah. /usr/bin/cpp will now use gcc -E to do preprocessing
+ rather than each compiler's cpp.
+
+2004-09-27 Robert Bowdidge <bowdidge@apple.com>
+
+ * build_gcc: change cp -r to cp -R to ensure we copy symbolic links
+
+2004-09-27 Robert Bowdidge <bowdidge@apple.com>
+
+ * build_gcc: set install names and dependent library references
+ to the major name for each of the gcc-produced dylibs.
+
+2004-09-24 Stan Shebs <shebs@apple.com>
+
+ * more-hdrs/ppc_intrinsics.h: Test __ppc64__ also.
+
+2004-09-23 Stan Shebs <shebs@apple.com>
+
+ * build_gcc: Detect version 3.5.0, enable 64-bit bringup option
+ and disable dylib building, also manually copy ppc64 archives
+ to their preferred locations, and don't run strip on 64-bit
+ archives.
+ * libstdc++-v3/configure: Filter out -m64 option when configuring,
+ then add back for compilation proper.
+
+2004-09-23 Robert Bowdidge <bowdidge@apple.com>
+
+ Change build_gcc so it continues to put cpp in
+ /usr/libexec/gcc/darwin/(architecture)/(version).
+ This is neeed so /usr/bin/cpp will continue to work when changing
+ to gcc-3.5 or gcc-4.0. Radar 3763777.
+
+2004-09-23 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3784876
+ Merge in updated ObjC/ObjC++ bits from mainline.
+
+2004-09-15 Mike Stump <mrs@apple.com>
+
+ Merge in changes from mainline, from apple-ppc-merge-20040821
+ to apple-ppc-merge-20040907.
+
+2004-08-29 Andrew Pinski <apinski@apple.com>
+
+ * more-hdrs/ppc_intrinsics.h (__mfspr): Put __extension
+ in front of the statement expression.
+
+2004-08-23 Mike Stump <mrs@apple.com>
+
+ Merge in changes from mainline, from apple-ppc-mergepoint-20040816
+ to apple-ppc-merge-20040821.
+
+2004-08-19 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3719364
+ * more-hdrs/inttypes.h: Update copyright notice, revise handling
+ of macros for which Jaguar doesn't support the C99 modifiers,
+ correct *FASTn for n < 32, correct *PTR.
+
+2004-08-19 Geoffrey Keating <geoffk@apple.com>
+
+ * more-hdrs/stdint.h: Correct some typos in comments.
+
+2004-08-18 Matthew Sachs <msachs@apple.com>
+
+ * Merge apple-ppc-branch 2004-08-17\ 03:07:00Z
+ with -j lno-merge-20040718 -j apple-ppc-mergepoint-20040816 .
+ The first tag is the point on mainline which LNO merged from right
+ before our last merge with lno-branch; the second point is
+ HEAD:2004-08-15T17:16:16Z
+
+2004-08-16 Matthew Sachs <msachs@apple.com>
+
+ * Mark unmarked APPLE LOCAL changes and remove some ancient cruft
+
+2004-08-05 Robert Bowdidge <bowdidge@apple.com>
+
+ * Merge lno-branch as of 2004-07-19\ 00:00Z into
+ apple-ppc-branch. The merged compiler is tagged as
+ after-lno-20040719-merge-to-apple-ppc. The pre-merge compiler is
+ tagged as before-lno-20040719-merge-to-apple-ppc. The merge point
+ is tagged as apple-ppc-merge-20040719 on the lno-branch.
+
+ Merge lno-branch as of 2004:05:29 00:00 GMT into
+ apple-ppc-branch. Pre-merge apple-ppc-branch
+ is tagged as: before-lno-20040530-merge-to-apple-ppc
+
+2004-07-28 Matt Austern <austern@apple.com>
+
+ Backport radar 3721776 patch from FSF mainline.
+ * config/darwin.c (darwin_one_byte_bool): New global variable.
+ * config/darwin.h (darwin_one_byte_bool): Declare.
+ (SUBTARGET_OPTIONS): Define macro. (for -mone-byte-bool flag.)
+ * config/rs6000/darwin.h (BOOL_TYPE_SIZE): Conditionalize on
+ value of darwin_one_byte_bool.
+ * doc/invoke.texi: Document -mone-byte-bool flag.
+ * testsuite/gcc.dg/darwin-bool-1.c: New test.
+ * testsuite/gcc.dg/darwin-bool-2.c: New test.
+
+2004-07-26 Matt Austern <austern@apple.com>
+
+ Radar 3739315 and 3739328
+ * Forward-port dead-code-stripping changes in config/darwin.[ch]
+ from 3.3.
+
+2004-07-13 Matt Austern <austern@apple.com>
+
+ Radar 3278745, 3419910, 3432773
+ * Fix small problems in more-hdrs/stdint.h and more-hdrs/inttypes.h
+
+2004-06-25 Matthew Sachs <msachs@apple.com>
+
+ Radar 3693177
+ * Clean up APPLE LOCAL markers.
+
+2004-06-17 Jon Ziegler <jonz@apple.com>
+
+ Radar 3693664
+ * Update pointers to source code in documentation to reflect new location.
+
+2004-06-16 Jon Ziegler <jonz@apple.com>
+
+ Radar 3619941
+ * Revert to apple-gcc-1762 plus Dorit/Devang's 2004-06-15 patch.
+
+2004-06-15 Jon Ziegler <jonz@apple.com>
+
+ Radar 3646298
+ * build_gcc: run ranlib on archives after strip(1)
+
+2004-06-07 Jon Ziegler <jonz@apple.com>
+
+ Radar 3678979
+ * build_gcc: Change directory for developer docs.
+
+2005-06-04 Fariborz Jahanian <fjahanian@apple.com>
+
+ Merge lno-branch as of 2004:05:29 00:00 GMT into
+ apple-ppc-branch. Pre-merge apple-ppc-branch
+ is tagged as: before-lno-20040530-merge-to-apple-ppc
+
+2004-05-11 Devang Patel <dpatel@apple.com>
+
+ * build_gcc: Revert previous fix for g++ man page.
+ Fix name of installed g++ name page.
+
+2004-05-06 Mike Stump <mrs@apple.com>
+
+ * build_gcc: Fix manual page name for g++.1.
+
+2004-04-29 Robert Bowdidge <bowdidge@apple.com>
+
+ Radar 3628023
+ * build_gcc: correctly lipo gcov
+
+2004-04-29 Devang Patel <dpatel@apple.com>
+
+ Merge lno-branch as of 2004:04:18 00:00 into
+ apple-ppc-branch.
+
+2004-04-22 Devang Patel <dpatel@apple.com>
+
+ Radar 3401402 and 3511029
+ * build_gcc: Add support to build darwin driver.
+
+2004-04-21 Robert Bowdidge <bowdidge@apple.com>
+
+ * build_gcc: Add --disable-libmudflap to the list of options to
+ configure. Option needed to keep gcc building on recent internal
+ builds of the OS. [Radar 3630321]
diff --git a/ChangeLog.lno b/ChangeLog.lno
new file mode 100644
index 00000000000..262a07e9bd2
--- /dev/null
+++ b/ChangeLog.lno
@@ -0,0 +1,10 @@
+2004-05-19 Daniel Jacobowitz <drow@false.org>
+ Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.tpl (configure-build-[+module+]): Export aliases
+ for build targets.
+ (configure-target-[+module+]): Likewise for target modules.
+ (configure-[+module+], configure-gcc, configure-stage1-gcc)
+ (configure-stage2-gcc, configure-stage3-gcc): Likewise for host
+ modules.
+ * Makefile.in: Regenerated.
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 00000000000..5b9f57d4926
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,90 @@
+# APPLE LOCAL file build machinery
+# Apple GCC Compiler Makefile for use by buildit.
+#
+# This makefile is intended only for use with B&I buildit. For "normal"
+# builds use the conventional FSF top-level makefile.
+#
+# You can specify TARGETS=ppc (or i386) on the buildit command line to
+# limit the build to just one target. The default is for ppc and i386.
+# The compiler targetted at this host gets built anyway, but not installed
+# unless it's listed in TARGETS.
+
+# Include the set of standard Apple makefile definitions.
+ifndef CoreOSMakefiles
+CoreOSMakefiles = $(MAKEFILEPATH)/CoreOS
+endif
+include $(CoreOSMakefiles)/Standard/Standard.make
+
+# Enable Apple extensions to (gnu)make.
+USE_APPLE_PB_SUPPORT = all
+
+HOSTS = ppc i386 # `arch`
+targets = echo $${TARGETS:-'ppc i386'}
+TARGETS := $(shell $(targets))
+
+RC_ARCHS = $(HOSTS)
+
+SRCROOT = .
+
+SRC = `cd $(SRCROOT) && pwd | sed s,/private,,`
+OBJROOT = $(SRC)/obj
+SYMROOT = $(OBJROOT)/../sym
+DSTROOT = $(OBJROOT)/../dst
+
+PREFIX = /usr
+
+#######################################################################
+
+install: $(OBJROOT) $(SYMROOT) $(DSTROOT)
+ cd $(OBJROOT) && \
+ $(SRC)/build_gcc "$(RC_ARCHS)" "$(TARGETS)" \
+ $(SRC) $(PREFIX) $(DSTROOT) $(SYMROOT)
+
+# installhdrs does nothing, because the headers aren't useful until
+# the compiler is installed.
+installhdrs:
+
+# We build and install in one shell script.
+build:
+
+installsrc:
+ @echo
+ @echo ++++++++++++++++++++++
+ @echo + Installing sources +
+ @echo ++++++++++++++++++++++
+ @echo
+ if [ $(SRCROOT) != . ]; then \
+ $(PAX) -rw . $(SRCROOT); \
+ fi
+ find -d "$(SRCROOT)" \( -type d -a -name CVS -o \
+ -type f -a -name .DS_Store -o \
+ -name \*~ -o -name .\#\* \) \
+ -exec rm -rf {} \;
+
+#######################################################################
+
+clean:
+ @echo
+ @echo ++++++++++++
+ @echo + Cleaning +
+ @echo ++++++++++++
+ @echo
+ @if [ -d $(OBJROOT) -a "$(OBJROOT)" != / ]; then \
+ echo '*** DELETING ' $(OBJROOT); \
+ rm -rf $(OBJROOT); \
+ fi
+ @if [ -d $(SYMROOT) -a "$(SYMROOT)" != / ]; then \
+ echo '*** DELETING ' $(SYMROOT); \
+ rm -rf $(SYMROOT); \
+ fi
+ @if [ -d $(DSTROOT) -a "$(DSTROOT)" != / ]; then \
+ echo '*** DELETING ' $(DSTROOT); \
+ rm -rf $(DSTROOT); \
+ fi
+
+#######################################################################
+
+$(OBJROOT) $(SYMROOT) $(DSTROOT):
+ mkdir -p $@
+
+.PHONY: install installsrc clean
diff --git a/README.Apple b/README.Apple
new file mode 100644
index 00000000000..fc850b66c87
--- /dev/null
+++ b/README.Apple
@@ -0,0 +1,464 @@
+APPLE LOCAL file documentation
+
+This file describes Apple's version of GCC 3.x modified for Darwin /
+Mac OS X. Although Apple's stated policy is to contribute all of its
+GCC work to the FSF GCC mainstream, at any given moment there will be
+changes that are permanently unacceptable for FSF GCC, in need of
+rework before acceptance, or that we simply aren't ready to send in.
+This version of GCC contains all those changes.
+
+In keeping with provision 2a of the GPL, each Apple change is marked
+with a comment saying "APPLE LOCAL", followed by optional words "begin",
+"end", or "file", followed by a short phrase describing the change
+generally ("AltiVec" for instance, if the change is related to AltiVec
+support), followed by an optional date in the form yyyy-mm-dd,
+optionally followed by the initials or email address of the person
+making the change. The words "begin" and "end" indicate that the
+comments delimit a multi-line change, while the word "file" indicates
+that the entire file is an Apple addition. Additional explanatory
+comments should be in a separate comment.
+
+You may also isolate Apple's changes by diffing with the FSF mainline
+sources as of the date mentioned in gcc/version.c; this date is
+updated in the FSF repository daily, and is preserved when we import
+FSF sources into Apple's repository (the tag for the imported source
+is "fsf-cvs").
+
+The primary purpose of this version of GCC is to be the main system
+compiler for Darwin and Mac OS X. However, since additions such as
+PFE precompiled headers and Objective-C++ are of interest on other
+platforms, we have generally conditionalized Mac-specific code so that
+the compiler will build and run elsewhere. You may however run into
+mistakes; please let us know about them and we will
+fix these if possible.
+
+NOTE! It's best to assume that this code has been updated from FSF
+development sources recently, and has received very little testing
+before being imported. There is a good chance that your favorite
+program will not compile or run when compiled with this program. The
+version of the compiler that ships with OS X is the standard for
+correctness; any time something works with that compiler but fails
+with this one is probably a bug, and should be reported to
+darwin-development@lists.apple.com.
+
+PREREQUISITES
+
+Presumably if you're reading this, you've figured out how to get the
+sources. :-) But just to be complete, these sources are available from
+the Darwin repository at opensource.apple.com, CVS module "gcc",
+branch "apple-ppc-branch". See
+http://www.opensource.apple.com/tools/cvs if this isn't enough info
+yet.
+
+If you want C++ exception handling to work, you will need a modified
+crt1.o. (crt1.o is the bit of code that sets up for execution and
+calls your program's main().) The modified crt1.o is standard in 10.2,
+but 10.1, you will need to set it up yourself.
+
+If you can't get a modified crt1.o from somebody else, you can patch a
+copy of the sources to the "Csu" project and build it yourself. The
+patch is included in this directory, as "csu-patch". The build is
+easy, just say "make" in the Csu directory, and then copy the crt1.o
+to /usr/lib/crt1.o (as usual, it's prudent to keep around a copy of
+the original crt1.o, just in case). You will need to have built the
+"cctools" project as well, in order to get the helper tool "indr"
+(which is expected to be installed as /usr/local/bin/indr).
+
+BUILDING, THE APPLE WAY
+
+To build things the Apple way, just say (in the source directory)
+
+ mkdir -p build/obj build/dst build/sym
+ gnumake install RC_OS=macos RC_ARCHS=ppc TARGETS=ppc \
+ SRCROOT=`pwd` OBJROOT=`pwd`/build/obj \
+ DSTROOT=`pwd`/build/dst SYMROOT=`pwd`/build/sym
+
+This will configure and then do a full bootstrap build, with all the
+results going into the subdirectory build/ that you created. The
+final results will be in the "dest root" directory build/dst, in the
+form of an image of the installed directory structure. The drivers
+and other user-visible tools have a "3" suffixed, so for instance the
+driver is /usr/bin/gcc3, and the demangler is /usr/bin/c++filt3.
+
+To install the results, become root and do
+
+ ditto build/dst /
+
+Various knobs and switches are available, but even so, the Apple
+makefile machinery is mainly designed for mass builds of all the
+projects that make up Darwin and/or Mac OS X, and is thus not as
+flexible as the standard GCC build process.
+
+To build for i386 Darwin, set TARGETS=i386. To build fat, set
+RC_ARCHS='i386 ppc' TARGETS='i386 ppc'. Note that you must have a
+complete set of fat libraries and i386-targeting cctools for this
+all to work.
+
+You can set the four *ROOT variables to point anywhere, but they must
+always be absolute pathnames.
+
+This way of building may or may not work on non-Macs, and if it
+doesn't, you're on your own.
+
+BUILDING, THE FSF WAY
+
+In general, standard GCC procedures work for building this version.
+We recommend that you build in a separate objdir; create a sibling
+to the toplevel source dir, call it whatever you want, cd into it,
+and say "../gcc/configure". This way you can have more than one
+build using the same set of sources.
+
+If you insist on building in the source directory using "./configure",
+the GNUmakefile that supports the Apple build process (see above) will
+shadow your makefile, and you will need to override this behavior by
+saying "make -f Makefile" (or by moving GNUmakefile out of the way).
+
+For instance:
+
+ mkdir darwin
+ cd darwin
+ ../configure --prefix=/tmp/testplace
+ make bootstrap
+ make install
+
+does a full build, plus two generations of self-compilation for
+GCC proper, then an install.
+
+To avoid building every language, use --enable-languages argument to
+configure. For instance, '--enable-languages=objc,c++,objc++' skips
+the Fortran and Java compilers. (The C compiler will always be
+built.)
+
+To build an x86 cross-compiler, add "--target=i386-darwin" to the
+configure line. The x86 compiler works, but to make it useful you
+will need libraries and such from x86 Darwin.
+
+There is a ProjectBuilder (PB) project also, but at the moment it's
+only useful for browsing. We expect to make it useful for building
+eventually. To keep it out of the way until then, it's in
+"pbproj/gcc3.pbproj".
+
+Tools built the FSF way are *not* usually going to be dropin
+replacements for already-installed tools built the Apple way, because
+search paths and other details will be different.
+
+TESTING
+
+This package includes a copy of the test framework of DejaGNU, for
+convenience in running GCC's testsuite. If you've done a make
+from the top, DejaGNU will have been built already; otherwise at
+the top of the objdir say "make all-dejagnu".
+
+Once the DejaGNU is available, you can cd into the gcc objdir and type
+"make check" to run all the tests. This will take several hours. You
+can do things like "make check-gcc" just to run C tests, or "make
+check-g77" for Fortran tests, which take less time.
+
+USING
+
+While this compiler can be used with 10.1, it is aimed at 10.2
+(Jaguar) and later releases. Built correctly, using the "Apple way",
+it can be a dropin replacement for the 10.2 system compiler.
+
+* Compatibility Issues
+
+This section lists areas where this compiler behaves differently
+from other versions of GCC.
+
+Built-in functions are not automatically declared
+
+GCC knows about some functions, such as memcpy, so it can generate
+better code for them. However, 2.95.2 let C++ programs refer to them
+without ever declaring them. The current C++ compiler now does the
+right thing by requiring you to declare all functions.
+
+alloca is a built-in function
+
+Normally only __builtin_alloca is a built-in function, and user
+code #defines alloca as __builtin_alloca. This version of GCC
+also recognizes alloca as built-in, and compiles it into a single
+stack adjustment.
+
+va_arg cannot take chars, shorts, or floats
+
+You can no longer pass "char", "short", or "float" as the second
+argument to va_arg() when using varargs.
+
+#pragma once is silently accepted
+
+GCC handles #pragma once correctly, but the standard compiler warns
+that the pragma is obsolete. This version of GCC is silent by
+default. Use -Wpragma-once to see the warnings again.
+
+#import is silently accepted
+
+GCC handles #import correctly, but the standard compiler warns that
+the directive is obsolete. This version of GCC is silent by default.
+Use -Wimport to see the warnings again.
+
+Extra tokens after #endif and friends are silently accepted
+
+Standard GCC now warns about extra tokens after #endif and other
+preprocessor directives. This version of GCC is silent by default.
+Use -Wextra-tokens to see these warnings.
+
+Files with missing newlines are silently accepted
+
+Standard GCC warns about files that do not end with a newline.
+This seems to be common in Apple headers and sources, so this
+version does not warn. Use -Wnewline-eof to see these warnings.
+
+-fpermissive by default
+
+The C++ compiler is normally strict about adherence to the language
+standard, but the -fpermissive flag is available to convert many
+errors into warnings. Apple's compiler is set to be permissive
+by default. This is temporary as of 1/27/02.
+
+GNU stddef.h not installed
+
+If built the Apple way, GCC's stddef.h is installed as "gnu-stddef.h",
+and so by default you will get the /usr/include/stddef.h that comes
+with Darwin.
+
+libobjc not built
+
+Since GNU libobjc and its headers would mask the system library
+and headers, this version of GCC does not build or install them
+if targeting Darwin.
+
+Objective-C structure returns
+
+When using the NeXT runtime, methods returning structures will work,
+while they will fail when using FSF GCC.
+
+All assembly files are preprocessed
+
+FSF GCC only runs the C preprocessor on files with extension .S, and
+does not run it on files ending in .s. Apple GCC runs the
+preprocessor on .s files also.
+
+Bug reporting address different
+
+If the compiler gets an internal error, it will ask you to report the
+error to Apple, rather than to the FSF.
+
+* Extensions
+
+This section briefly describes Apple's extensions to GCC. Further
+details may be found in the GCC manual (usually).
+
+__APPLE_CC__
+
+The preprocessor symbol __APPLE_CC__ identifies a specific "build
+number" of the compiler. These numbers are finer-grained than the
+generic GCC version numbers, and for gcc3 they range from 1000 up
+(2.95.2 versions are in the 900s).
+
+Framework includes
+
+Headers may be found by pathname in the usual way, or as part of
+"frameworks" which are assemblages of library/headers/resources. For
+instance, #include <IOKit/IOTypes.h> will be found as
+/System/Library/Frameworks/IOKit.framework/Headers/IOTypes.h. The
+-F<pathname> adds <pathname> as a place to search for frameworks; by
+default, the compiler will look in /System/Library/Frameworks,
+/Library/Frameworks, and /Local/Library/Frameworks.
+
+Frameworks may also have subframeworks, and the framework include
+machinery will find headers in subframeworks if the outer framework
+(known as an "umbrella framework) is being included.
+
+Objective-C++
+
+Objective-C++ is C++ extended to understand Objective-C constructs.
+The two object models are separate and "mutually oblivious", so C++
+code generally works unchanged, as well as Objective-C code that
+conforms to C++ restrictions (similar to the restrictions placed on
+plain C code by C++). Objective-C++ files must have the extension .mm
+or .M (but note that .M will conflict with .m files on HFS
+filesystems, so .mm is preferred).
+
+Pascal strings
+
+The flag -fpascal-strings enables the use of "\p" to designate a
+length byte, originally used for C-Pascal interoperation on Macs, but
+now mostly a human-appendix-like compatibility option.
+
+Macintosh alignment
+
+The options -malign-mac68k, -malign-power, and -malign-natural are
+available to control whether the alignment of structure fields
+follows 68K, PowerPC, or "natural" rules. These options are
+useful to applications which need to be binary-compatible with
+very old Mac applications, libraries, or resources. The "natural"
+alignment mode may be useful to applications whose performance is
+sensitive to misaligned data accesses.
+
+In addition, #pragma options align=<option> is available, where
+<option> may be mac68k, native, natural, packed, power, or reset.
+(native == power on a PowerPC.) The pragma effectively pushes the
+alignment onto a stack, while align=reset pops the alignment, thus
+allowing nested pragmas to work. #pragma pack is also available and
+works with the same stack.
+
+private extern symbols
+
+You can declare symbols as "private extern", which means that they
+behave as extern until linking, then they are made private, and are
+not visible outside the library. To declare something as private
+extern, add "__private_extern__" where you might normally say
+"extern".
+
+Coalescing
+
+Using "-fcoalesce", "-fcoalesce-templates" and "-fweak-coalesced"
+flags can reduce the amount of duplicated code. Coalescing and C++
+template coalescing are enabled by default, at least if a
+recent-enough cctools version (10.2 or later) has been installed.
+
+-dynamiclib
+
+You can build shared libraries (aka dylibs) by using -dynamiclib.
+This invokes libtool (not to be confused with GNU libtool) instead of
+ld. See the libtool man page for more detail on options that can be
+passed to libtool.
+
+Linker flags
+
+This version of GCC understands the plethora of linker-related flags,
+such as -framework, -flat_namespace, etc. The functionality should be
+the same as for 2.95.2 and as documented in the linker man page; any
+discrepancies are probably bugs.
+
+AltiVec
+
+The complete AltiVec programming interface, as defined in the PIM, is
+available. Use -faltivec to enable it.
+
+Note that the PIM, section 2.1 mentions that AltiVec data types using
+the 'long' keyword (i.e., vector [un]signed long) are deprecated and
+that the 'int' should be used. The compiler will thus issue a warning
+for these cases. The warning may be suppressed by specifying
+-Wno-altivec-long-deprecated.
+
+-mdynamic-no-pic
+
+The option -mdynamic-no-pic generates code that make references to
+PIC, but is not itself position-independent and thus more efficient.
+This option is suitable for applications but not dylibs.
+
+unavailable attribute
+
+The attribute "unavailable" is available :-) to declare that a
+symbol is not available.
+
+weak_import attribute
+
+The attribute weak_import is available to declare that a symbol
+should be designated as a weak reference.
+
+CALL_ON_LOAD and CALL_ON_UNLOAD pragmas
+
+The pragmas CALL_ON_LOAD and CALL_ON_UNLOAD allow you to declare
+that a given name is the name of a function to be called when
+a module is loaded or unloaded by the system.
+
+IOKit support
+
+There are a number of changes to support the building of IOKit drivers.
+
+The option -findirect-virtual-calls forces all virtual calls to go
+through the vtable, while the option -fterminated-vtables adds a null
+termination to vtables. -fapple-kext turns on all of these, plus any
+future options that may be needed to compile kexts.
+
+There is a library libcc_kext.a that is libgcc.a compiled static and
+including only routines that are allowed in the kernel.
+
+The PowerPC-only option -mlong-branch is available to generate full
+32-bit jumps, since kexts may not be loaded at addresses close to the
+kernel.
+
+Dependency file names
+
+When you use -MD to output dependencies, you can also use
+-dependency-file <name> to write the dependencies into the file named
+<name>. (By default, they go into <inputfilename>.d .)
+
+Fat builds
+
+You can compile for a specific target type by using -arch <archname>.
+Multiple -arch options also work, and result in "fat binaries". -arch
+works with -c, -precomp (to make fat precomps), but not -S or
+-save-temps.
+
+At present, only "i386" and "ppc" may be used as architecture names.
+Note that building for a specific arch will only work if you have
+assembler and libraries for that arch.
+
+-ObjC, -ObjC++
+
+These options set the default language to be Objective-C and
+Objective-C++, respectively. Note that this behavior is slightly
+different from the -x options, because -x affects only the files
+appearing after it on the command line, while -ObjC and -ObjC++ affect
+all input files. Nevertheless, -x is standard and thus preferable.
+(-fobjc works and is equivalent to -ObjC, but it's even more
+deprecated.)
+
+-Wmost
+
+The option -Wmost is equivalent to -Wall -Wno-parentheses. It is
+present for compatibility with some existing Mac OS X projects.
+
+-Wno-#warnings
+
+The option -Wno-#warnings suppresses warnings issued by #warning.
+
+-Wno-altivec-long-deprecated
+
+The option -Wno-altivec-long-deprecated suppresses warnings about
+'int' being preferred to 'long' in AltiVec vector types.
+
+-Werror suppression
+
+The environment variable QA_DISABLE_WERROR, if set (to any value),
+disables the effect of -Werror on the command line; warnings will
+not result in an error.
+
+PB indexing
+
+If the environment variable PB_INDEX_SOCKET_PORT is defined, then the
+compiler will output PB indexing information to that port. The option
+-fdebug-gen-index will do the same port, but sending the information
+to standard output, for debugging indexing.
+
+Header mapfiles
+
+This is the support for a PB feature where actual pathnames for
+headers come from a given file rather than being searched for in the
+various include paths. It's not useful outside of the PB environment.
+
+QA_OVERRIDE_GCC3_OPTIONS environment variable
+
+Allows overriding, adding, or changing options sent to toplev.c. This
+allows you, for example, to override the -O setting that the driver
+sends to the command line. Documentation is in toplev.c.
+
+* Miscellaneous Issues
+
+GCC uses a syntax for rlwinm instructions that is only supported
+by the assembler in 10.1 or later. If you need to run 10.0, and
+can't build cctools-364, then you can try to dig up the workaround;
+versions of gcc3 before December 2001 have it, look for references
+to rlwinm in gcc/config/rs6000/rs6000.md.
+
+TO DO
+
+This section lists specific features that we're still working on.
+
+Make fat building work when the compiler is built the FSF way.
+
+Implement floating point precision control (-ffppc) for i386.
+
diff --git a/build_gcc b/build_gcc
new file mode 100755
index 00000000000..7825bfa8dcf
--- /dev/null
+++ b/build_gcc
@@ -0,0 +1,513 @@
+#!/bin/sh
+# APPLE LOCAL file B&I
+
+set -x
+
+# -arch arguments are different than configure arguments. We need to
+# translate them.
+
+TRANSLATE_ARCH="sed -e s/ppc/powerpc/ -e s/i386/i686/"
+
+# Build GCC the "Apple way".
+# Parameters:
+
+# The first parameter is a space-separated list of the architectures
+# the compilers will run on. For instance, "ppc i386". If the
+# current machine isn't in the list, it will (effectively) be added.
+HOSTS=`echo $1 | $TRANSLATE_ARCH `
+
+# The second parameter is a space-separated list of the architectures the
+# compilers will generate code for. If the current machine isn't in
+# the list, a compiler for it will get built anyway, but won't be
+# installed.
+TARGETS=`echo $2 | $TRANSLATE_ARCH`
+
+# The GNU makefile target ('bootstrap' by default).
+BOOTSTRAP=${BOOTSTRAP-bootstrap}
+
+# The B&I build srcript (~rc/bin/buildit) accepts an '-othercflags'
+# command-line flag, and captures the argument to that flag in
+# $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).
+# We will allow this to override the default $CFLAGS and $CXXFLAGS.
+
+CFLAGS=${RC_NONARCH_CFLAGS/-pipe/}
+CFLAGS=${CFLAGS:-"-g -O2"}
+
+# This isn't a parameter; it is the architecture of the current machine.
+BUILD=`arch | $TRANSLATE_ARCH`
+
+# The third parameter is the path to the compiler sources. There should
+# be a shell script named 'configure' in this directory. This script
+# makes a copy...
+ORIG_SRC_DIR="$3"
+
+# The fourth parameter is the location where the compiler will be installed,
+# normally "/usr". You can move it once it's built, so this mostly controls
+# the layout of $DEST_DIR.
+DEST_ROOT="$4"
+
+# The fifth parameter is the place where the compiler will be copied once
+# it's built.
+DEST_DIR="$5"
+
+# The sixth parameter is a directory in which to place information (like
+# unstripped executables and generated source files) helpful in debugging
+# the resulting compiler.
+SYM_DIR="$6"
+
+# The current working directory is where the build will happen.
+# It may already contain a partial result of an interrupted build,
+# in which case this script will continue where it left off.
+DIR=`pwd`
+
+# This isn't a parameter; it's the version of the compiler that we're
+# about to build. It's included in the names of various files and
+# directories in the installed image.
+VERS=`sed -n -e '/version_string/s/.*\"\([^ \"]*\)[ \"].*/\1/p' \
+ < $ORIG_SRC_DIR/gcc/version.c || exit 1`
+
+# This isn't a parameter either, it's the major version of the compiler
+# to be built. It's VERS but only up to the second '.' (if there is one).
+MAJ_VERS=`echo $VERS | sed 's/\([0-9]*\.[0-9]*\)[.-].*/\1/'`
+
+# Sniff to see if we can do ppc64 building.
+DARWIN_VERS=8
+if [ x"`file /usr/lib/crt1.o | grep 'architecture ppc64'`" == x ]; then
+ DARWIN_VERS=7
+fi
+
+echo DARWIN_VERS = $DARWIN_VERS
+
+########################################
+# Run the build.
+
+# Create the source tree we'll actually use to build, deleting
+# tcl since it doesn't actually build properly in a cross environment
+# and we don't really need it.
+SRC_DIR=$DIR/src
+rm -rf $SRC_DIR || exit 1
+mkdir $SRC_DIR || exit 1
+ln -s $ORIG_SRC_DIR/* $SRC_DIR/ || exit 1
+rm -rf $SRC_DIR/tcl $SRC_DIR/expect $SRC_DIR/dejagnu || exit 1
+
+# These are the configure and build flags that are used.
+# MERGE FIXME: obj-c++ in languages
+CONFIGFLAGS="--disable-checking \
+ --prefix=$DEST_ROOT \
+ --mandir=\${prefix}/share/man \
+ --enable-languages=c,objc,c++,obj-c++ \
+ --program-transform-name=/^[cg][^+.-]*$/s/$/-$MAJ_VERS/ \
+ --with-gxx-include-dir=\${prefix}/include/gcc/darwin/$MAJ_VERS/c++ \
+ --build=$BUILD-apple-darwin$DARWIN_VERS"
+
+# For 64-bit bringup
+if [ "$VERS" == "3.5.0" ]; then
+ CONFIGFLAGS="$CONFIGFLAGS --enable-bringup --disable-shared --enable-static"
+fi
+
+# Figure out how many make processes to run.
+SYSCTL=`sysctl -n hw.activecpu`
+
+# hw.activecpu only available in 10.2.6 and later
+if [ -z "$SYSCTL" ]; then
+ SYSCTL=`sysctl -n hw.ncpu`
+fi
+
+# sysctl -n hw.* does not work when invoked via B&I chroot /BuildRoot.
+# Builders can default to 2, since even if they are single processor,
+# nothing else is running on the machine.
+if [ -z "$SYSCTL" ]; then
+ SYSCTL=2
+fi
+
+# The $LOCAL_MAKEFLAGS variable can be used to override $MAKEFLAGS.
+MAKEFLAGS=${LOCAL_MAKEFLAGS-"-j $SYSCTL"}
+
+# Build the native GCC. Do this even if the user didn't ask for it
+# because it'll be needed for the bootstrap.
+mkdir -p $DIR/obj-$BUILD-$BUILD $DIR/dst-$BUILD-$BUILD || exit 1
+cd $DIR/obj-$BUILD-$BUILD || exit 1
+if [ \! -f $DIR/$BUILD-configured ] ; then
+ $SRC_DIR/configure $CONFIGFLAGS \
+ --host=$BUILD-apple-darwin$DARWIN_VERS --target=$BUILD-apple-darwin$DARWIN_VERS || exit 1
+ touch $DIR/$BUILD-configured || exit 1
+fi
+make $MAKEFLAGS $BOOTSTRAP CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+make $MAKEFLAGS html CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$BUILD install-gcc install-target \
+ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+
+# Add the compiler we just built to the path, giving it appropriate names.
+D=$DIR/dst-$BUILD-$BUILD/usr/bin
+ln -f $D/gcc-$MAJ_VERS $D/gcc || exit 1
+ln -f $D/gcc $D/$BUILD-apple-darwin$DARWIN_VERS-gcc || exit 1
+PATH=$DIR/dst-$BUILD-$BUILD/usr/bin:$PATH
+
+# The cross-tools' build process expects to find certain programs
+# under names like 'i386-apple-darwin$DARWIN_VERS-ar'; so make them.
+# Annoyingly, ranlib changes behaviour depending on what you call it,
+# so we have to use a shell script for indirection, grrr.
+rm -rf $DIR/bin || exit 1
+mkdir $DIR/bin || exit 1
+for prog in ar nm ranlib ; do
+ for t in `echo $TARGETS $HOSTS | sort -u`; do
+ P=$DIR/bin/${t}-apple-darwin$DARWIN_VERS-${prog}
+ echo '#!/bin/sh' > $P || exit 1
+ echo 'exec /usr/bin/'${prog}' $*' >> $P || exit 1
+ chmod a+x $P || exit 1
+ done
+done
+for t in `echo $1 $2 | sort -u`; do
+ gt=`echo $t | $TRANSLATE_ARCH`
+ P=$DIR/bin/${gt}-apple-darwin$DARWIN_VERS-as
+ echo '#!/bin/sh' > $P || exit 1
+ echo 'exec /usr/bin/as -arch '${t}' $*' >> $P || exit 1
+ chmod a+x $P || exit 1
+done
+PATH=$DIR/bin:$PATH
+
+# Build the cross-compilers, using the compiler we just built.
+for t in $TARGETS ; do
+ if [ $t != $BUILD ] ; then
+ mkdir -p $DIR/obj-$BUILD-$t $DIR/dst-$BUILD-$t || exit 1
+ cd $DIR/obj-$BUILD-$t || exit 1
+ $SRC_DIR/configure $CONFIGFLAGS \
+ --program-prefix=$t-apple-darwin$DARWIN_VERS- \
+ --host=$BUILD-apple-darwin$DARWIN_VERS --target=$t-apple-darwin$DARWIN_VERS || exit 1
+ make $MAKEFLAGS all CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+ make $MAKEFLAGS DESTDIR=$DIR/dst-$BUILD-$t install-gcc install-target \
+ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+
+ # Add the compiler we just built to the path.
+ PATH=$DIR/dst-$BUILD-$t/usr/bin:$PATH
+ fi
+done
+
+# Rearrange various libraries, for no really good reason.
+for t in $TARGETS ; do
+ DT=$DIR/dst-$BUILD-$t
+ D=`echo $DT/usr/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
+ if [ $t == $BUILD ] ; then
+ mv $DT/usr/lib/libstdc++.a $D || exit 1
+ mv $DT/usr/lib/libsupc++.a $D || exit 1
+ # 64-bit bringup
+ if [ -f $DT/usr/lib/ppc64/libstdc++.a ]; then
+ mv $DT/usr/lib/ppc64/libstdc++.a $D/ppc64 || exit 1
+ mv $DT/usr/lib/ppc64/libsupc++.a $D/ppc64 || exit 1
+ fi
+ else
+ DD=$DT/usr/${t}-apple-darwin$DARWIN_VERS/lib
+ mv $DD/libstdc++.a $D || exit 1
+ mv $DD/libsupc++.a $D || exit 1
+ # 64-bit bringup
+ if [ -f $DD/ppc64/libstdc++.a ]; then
+ mv $DD/ppc64/libstdc++.a $D/ppc64 || exit 1
+ mv $DD/ppc64/libsupc++.a $D/ppc64 || exit 1
+ fi
+ fi
+ mv $D/static/libgcc.a $D/libgcc_static.a || exit 1
+ mv $D/kext/libgcc.a $D/libcc_kext.a || exit 1
+ rm -r $D/static $D/kext || exit 1
+done
+
+# Make all symbols in libgcc.a private extern. This is a temporary fix
+# and should be removed after we merge with mainline 4.0 final.
+for t in $TARGETS ; do
+ DT=$DIR/dst-$BUILD-$t
+ D=`echo $DT/usr/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS`
+ D64=$D/ppc64
+
+ for lib in $D/libgcc.a $D/libgcc_eh.a $D/libgcc_static.a $D/libgcc_eh.a $D64/libgcc.a $D64/libgcc_eh.a $D/libcc_kext.a ; do
+ if [ -f $lib ] ; then
+ nmedit -p $lib
+ fi
+ done
+done
+
+# Build the cross-hosted compilers.
+for h in $HOSTS ; do
+ if [ $h != $BUILD ] ; then
+ for t in $TARGETS ; do
+ mkdir -p $DIR/obj-$h-$t $DIR/dst-$h-$t || exit 1
+ cd $DIR/obj-$h-$t || exit 1
+ if [ $h = $t ] ; then
+ pp=
+ else
+ pp=$t-apple-darwin$DARWIN_VERS-
+ fi
+
+ $SRC_DIR/configure $CONFIGFLAGS \
+ --program-prefix=$pp \
+ --host=$h-apple-darwin$DARWIN_VERS --target=$t-apple-darwin$DARWIN_VERS || exit 1
+ make $MAKEFLAGS all-gcc CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+ make $MAKEFLAGS DESTDIR=$DIR/dst-$h-$t install-gcc \
+ CFLAGS="$CFLAGS" CXXFLAGS="$CFLAGS" || exit 1
+ done
+ fi
+done
+
+########################################
+# Construct the actual destination root, by copying stuff from
+# $DIR/dst-* to $DEST_DIR, with occasional 'lipo' commands.
+
+cd $DEST_DIR || exit 1
+
+# Clean out DEST_DIR in case -noclean was passed to buildit.
+rm -rf * || exit 1
+
+# HTML documentation
+HTMLDIR="/Developer/ADC Reference Library/documentation/DeveloperTools"
+mkdir -p ".$HTMLDIR" || exit 1
+cp -Rp $DIR/obj-$BUILD-$BUILD/gcc/HTML/* ".$HTMLDIR/" || exit 1
+
+# Manual pages
+mkdir -p .$DEST_ROOT/share || exit 1
+cp -Rp $DIR/dst-$BUILD-$BUILD$DEST_ROOT/share/man .$DEST_ROOT/share/ \
+ || exit 1
+
+# libexec
+cd $DIR/dst-$BUILD-$BUILD$DEST_ROOT/libexec/gcc/$BUILD-apple-darwin$DARWIN_VERS/$VERS \
+ || exit 1
+LIBEXEC_FILES=`find . -type f -print || exit 1`
+LIBEXEC_DIRS=`find . -type d -print || exit 1`
+cd $DEST_DIR || exit 1
+for t in $TARGETS ; do
+ DL=$DEST_ROOT/libexec/gcc/$t-apple-darwin$DARWIN_VERS/$VERS
+ for d in $LIBEXEC_DIRS ; do
+ mkdir -p .$DL/$d || exit 1
+ done
+ for f in $LIBEXEC_FILES ; do
+ if file $DIR/dst-*-$t$DL/$f | grep -q 'Mach-O executable' ; then
+ lipo -output .$DL/$f -create $DIR/dst-*-$t$DL/$f || exit 1
+ else
+ cp -p $DIR/dst-$BUILD-$t$DL/$f .$DL/$f || exit 1
+ fi
+ done
+done
+
+# bin
+# The native drivers ('native' is different in different architectures).
+BIN_FILES=`ls $DIR/dst-$BUILD-$BUILD$DEST_ROOT/bin | grep '^[^-]*-[0-9.]*$' \
+ | grep -v gccbug | grep -v gcov || exit 1`
+mkdir .$DEST_ROOT/bin
+for f in $BIN_FILES ; do
+ lipo -output .$DEST_ROOT/bin/$f -create $DIR/dst-*$DEST_ROOT/bin/$f || exit 1
+done
+# gcov, which is special only because it gets built multiple times and lipo
+# will complain if we try to add two architectures into the same output.
+TARG0=`echo $TARGETS | cut -d ' ' -f 1`
+lipo -output .$DEST_ROOT/bin/gcov-$MAJ_VERS -create \
+ $DIR/dst-*-$TARG0$DEST_ROOT/bin/*gcov* || exit 1
+# The fully-named drivers, which have the same target on every host.
+for t in $TARGETS ; do
+ lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS -create \
+ $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS || exit 1
+ lipo -output .$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++-$VERS -create \
+ $DIR/dst-*-$t$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-g++ || exit 1
+done
+
+# lib
+mkdir -p .$DEST_ROOT/lib/gcc || exit 1
+for t in $TARGETS ; do
+ cp -Rp $DIR/dst-$BUILD-$t$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS \
+ .$DEST_ROOT/lib/gcc || exit 1
+done
+
+SHARED_LIBS=`ls $DIR/dst-$BUILD-$BUILD$DEST_ROOT/lib | grep '\.dylib$'`
+for l in $SHARED_LIBS ; do
+ F=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/lib/$l
+ if [ \! -L $F ] ; then
+ # The following bit sniffs for a ppc64 libstdc++ dylib to lipo in.
+ multi=$DIR/dst-$BUILD-$BUILD$DEST_ROOT/lib/ppc64/$l
+ if [ \! -f $multi ] ; then
+ multi=
+ fi
+ if [ -f $DIR/dst-$BUILD-*$DEST_ROOT/*-apple-darwin$DARWIN_VERS/lib/$l ] ; then
+ lipo -output .$DEST_ROOT/lib/$l -create $F $multi \
+ $DIR/dst-$BUILD-*$DEST_ROOT/*-apple-darwin$DARWIN_VERS/lib/$l || exit 1
+ else
+ cp -p $F .$DEST_ROOT/lib/$l || exit 1
+ fi
+ F1=`echo $l \
+ | sed 's/\(\.[0-9]\{1,\}\)\(\.[0-9]\{1,\}\)\{1,\}\.dylib/\1.dylib/'`
+ F0=`echo $l | sed 's/\(\.[0-9]\{1,\}\)\{1,\}\.dylib/.dylib/'`
+ ln -s $l .$DEST_ROOT/lib/$F1 || exit 1
+ for t in $TARGETS ; do
+ ln -s ../../../$F1 .$DEST_ROOT/lib/gcc/$t-apple-darwin$DARWIN_VERS/$VERS/$F0 \
+ || exit 1
+ done
+ fi
+done
+
+for l in $SHARED_LIBS ; do
+ F=$DEST_ROOT/lib/$l
+ F1=`echo $l \
+ | sed 's/\(\.[0-9]\{1,\}\)\(\.[0-9]\{1,\}\)\{1,\}\.dylib/\1.dylib/'`
+ if [ -f .$F ] ; then
+
+ # Now that we've lipo'ed things together, change the install name
+ # to match the official path. The destination should always be
+ # shorter than the full name, so this should always work. The
+ # install name should be the symlink with the major version number
+ # so that apps using the library (and the install name) will link
+ # against the symlink and get the latest version.
+ # Also change dependent library names so that libstdc++.6.0.2.dylib
+ # (for example) links against libgcc.1.dylib to avoid link errors.
+
+ install_name_tool -id $DEST_ROOT/lib/$F1 .$F
+
+ # At this point, l is the name of the library we're rewriting.
+ # .$DEST_ROOT/lib/$F1 is the major version of the library.
+
+ # For every other shared library: change the name from short name to major
+ for subl in $SHARED_LIBS ; do
+ SUBF=.$DEST_ROOT/lib/$subl
+ if [ -f $SUBF ] ; then
+ install_name_tool -change $DEST_ROOT/lib/$l $DEST_ROOT/lib/$F1 $SUBF
+ fi
+ done
+
+ # For every other library and architecture, check to see if any of the
+ # dependent library names happens to be the bogus name given during a cross
+ # compile.
+ for usinglib in $SHARED_LIBS ; do
+ USINGPATH=.$DEST_ROOT/lib/$usinglib
+ if [ -f $USINGPATH ] ; then
+ for t1 in $TARGETS ; do
+ BADPATH=$DEST_ROOT/$t-apple-darwin$DARWIN_VERS/lib/$l
+ GOODPATH=$DEST_ROOT/lib/$F1
+ # Deal with the weird names generated for cross compiler portions.
+ install_name_tool -change $BADPATH $GOODPATH $USINGPATH
+ done
+ fi
+ done
+ fi
+done
+
+# include
+HEADERPATH=$DEST_ROOT/include/gcc/darwin/$MAJ_VERS
+mkdir -p .$HEADERPATH || exit 1
+cp -Rp $DIR/dst-$BUILD-$BUILD$HEADERPATH/c++ \
+ .$HEADERPATH/ || exit 1
+for t in $TARGETS ; do
+ DS=$HEADERPATH/c++
+ [ $t = $BUILD ] || \
+ cp -Rp $DIR/dst-$BUILD-$t$DS/$t-apple-darwin$DARWIN_VERS .$DS/ || exit 1
+done
+
+# Some headers are installed from more-hdrs/. They all share
+# one common feature: they shouldn't be installed here. Sometimes,
+# they should be part of FSF GCC and installed from there; sometimes,
+# they should be installed by some completely different package; sometimes,
+# they only exist for codewarrior compatibility and codewarrior should provide
+# its own. We take care not to install the headers if Libc is already
+# providing them.
+cd $SRC_DIR/more-hdrs
+for h in `echo *.h` ; do
+ if [ ! -f /usr/include/$h -o -L /usr/include/$h ] ; then
+ cp -R $h $DEST_DIR$HEADERPATH/$h || exit 1
+ for t in $TARGETS ; do
+ THEADERPATH=$DEST_DIR$DEST_ROOT/lib/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include
+ [ -f $THEADERPATH/$h ] || \
+ ln -s ../../../../../include/gcc/darwin/$MAJ_VERS/$h $THEADERPATH/$h || \
+ exit 1
+ done
+ fi
+done
+mkdir -p $DEST_DIR$HEADERPATH/machine
+for h in `echo */*.h` ; do
+ if [ ! -f /usr/include/$h -o -L /usr/include/$h ] ; then
+ cp -R $h $DEST_DIR$HEADERPATH/$h || exit 1
+ for t in $TARGETS ; do
+ THEADERPATH=$DEST_DIR$DEST_ROOT/lib/gcc/${t}-apple-darwin$DARWIN_VERS/$VERS/include
+ mkdir -p $THEADERPATH/machine
+ # In fixincludes/fixinc.in we created this file... always link for now
+ [ -f /disable/$THEADERPATH/$h ] || \
+ ln -f -s ../../../../../../include/gcc/darwin/$MAJ_VERS/$h $THEADERPATH/$h || \
+ exit 1
+ done
+ fi
+done
+
+# Install man pages using version number.
+# Only g++ man page needs rename. gcc, cpp and gcov man page are already
+# installed using proper name.
+mv $DEST_DIR$DEST_ROOT/share/man/man1/g++.1 \
+ $DEST_DIR$DEST_ROOT/share/man/man1/g++-$MAJ_VERS.1
+ln -f $DEST_DIR$DEST_ROOT/share/man/man1/g++-$MAJ_VERS.1 \
+ $DEST_DIR$DEST_ROOT/share/man/man1/c++-$MAJ_VERS.1
+for t in $TARGETS ; do
+ ln -f $DEST_DIR$DEST_ROOT/share/man/man1/gcc-$MAJ_VERS.1 \
+ $DEST_DIR$DEST_ROOT/share/man/man1/$t-apple-darwin$DARWIN_VERS-gcc-$VERS.1
+ ln -f $DEST_DIR$DEST_ROOT/share/man/man1/g++-$MAJ_VERS.1 \
+ $DEST_DIR$DEST_ROOT/share/man/man1/$t-apple-darwin$DARWIN_VERS-g++-$VERS.1
+done
+
+# Build driver-driver using fully-named drivers
+for t in $TARGETS ; do
+ $DEST_DIR$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS \
+ $ORIG_SRC_DIR/gcc/config/darwin-driver.c \
+ -DPDN="\"-apple-darwin$DARWIN_VERS-gcc-$VERS\"" \
+ -DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
+ -I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \
+ -liberty -L$DIR/dst-$BUILD-$t$DEST_ROOT/lib/ \
+ -L$DIR/dst-$BUILD-$t$DEST_ROOT/$t-apple-darwin$DARWIN_VERS/lib/ \
+ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$t-gcc-$MAJ_VERS || exit 1
+
+ $DEST_DIR$DEST_ROOT/bin/$t-apple-darwin$DARWIN_VERS-gcc-$VERS \
+ $ORIG_SRC_DIR/gcc/config/darwin-driver.c \
+ -DPDN="\"-apple-darwin$DARWIN_VERS-g++-$VERS\"" \
+ -DIL="\"$DEST_ROOT/bin/\"" -I $ORIG_SRC_DIR/include \
+ -I $ORIG_SRC_DIR/gcc -I $ORIG_SRC_DIR/gcc/config \
+ -liberty -L$DIR/dst-$BUILD-$t$DEST_ROOT/lib/ \
+ -L$DIR/dst-$BUILD-$t$DEST_ROOT/$t-apple-darwin$DARWIN_VERS/lib/ \
+ -o $DEST_DIR/$DEST_ROOT/bin/tmp-$t-g++-$MAJ_VERS || exit 1
+done
+
+lipo -output $DEST_DIR/$DEST_ROOT/bin/gcc-$MAJ_VERS -create \
+ $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcc-$MAJ_VERS || exit 1
+
+lipo -output $DEST_DIR/$DEST_ROOT/bin/g++-$MAJ_VERS -create \
+ $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1
+
+ln -f $DEST_DIR/$DEST_ROOT/bin/g++-$MAJ_VERS $DEST_DIR/$DEST_ROOT/bin/c++-$MAJ_VERS || exit 1
+
+rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-gcc-$MAJ_VERS || exit 1
+rm $DEST_DIR/$DEST_ROOT/bin/tmp-*-g++-$MAJ_VERS || exit 1
+
+
+########################################
+# Save the source files and objects needed for debugging
+
+cd $SYM_DIR || exit 1
+
+# Clean out SYM_DIR in case -noclean was passed to buildit.
+rm -rf * || exit 1
+
+# Save executables and libraries.
+cd $DEST_DIR || exit 1
+find . \( -perm -0111 -or -name \*.a \) -type f -print \
+ | cpio -pdml $SYM_DIR || exit 1
+# Save source files.
+mkdir $SYM_DIR/src || exit 1
+cd $DIR || exit 1
+find obj-* -name \*.\[chy\] -print | cpio -pdml $SYM_DIR/src || exit 1
+
+########################################
+# Strip the executables and libraries
+find $DEST_DIR -perm -0111 \! -name \*.dylib -type f -print \
+ | xargs strip || exit 1
+find $DEST_DIR \( -name \*.a -or -name \*.dylib \) -type f -print \
+ | xargs strip -SX || exit 1
+find $DEST_DIR -name \*.a -type f -print \
+ | xargs ranlib || exit 1
+
+if [ "$MAJ_VERS" = "3.5" ]; then
+ rm -f `find $DEST_DIR -name \*.dylib -print`
+ rm -f $DEST_DIR$DEST_ROOT/share/man/man7/fsf-funding.7
+ rm -f $DEST_DIR$DEST_ROOT/share/man/man7/gfdl.7
+ rm -f $DEST_DIR$DEST_ROOT/share/man/man7/gpl.7
+fi
+
+# Done!
+exit 0
diff --git a/configure b/configure
index 24cfc0175fe..2dcee385553 100755
--- a/configure
+++ b/configure
@@ -1170,10 +1170,13 @@ case "${target}" in
;;
powerpc-*-darwin*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ # APPLE LOCAL 64-bit bringup
+ noconfigdirs="$noconfigdirs target-libobjc"
;;
*-*-darwin*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
- noconfigdirs="$noconfigdirs ${libgcj}"
+ # APPLE LOCAL 64-bit bringup
+ noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
;;
*-*-freebsd[12] | *-*-freebsd[12].* | *-*-freebsd*aout*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
diff --git a/configure.in b/configure.in
index e5068f22f48..e3d83a26bc3 100644
--- a/configure.in
+++ b/configure.in
@@ -368,10 +368,13 @@ case "${target}" in
;;
powerpc-*-darwin*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
+ # APPLE LOCAL 64-bit bringup
+ noconfigdirs="$noconfigdirs target-libobjc"
;;
*-*-darwin*)
noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes gdb gprof"
- noconfigdirs="$noconfigdirs ${libgcj}"
+ # APPLE LOCAL 64-bit bringup
+ noconfigdirs="$noconfigdirs target-libobjc ${libgcj}"
;;
*-*-freebsd[[12]] | *-*-freebsd[[12]].* | *-*-freebsd*aout*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x
index 2eabf1f572e..5f9de04edba 100644
--- a/fixincludes/fixincl.x
+++ b/fixincludes/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Friday November 26, 2004 at 09:59:26 PM UTC
+ * It has been AutoGen-ed Friday February 18, 2005 at 05:22:58 PM PST
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Nov 26 21:59:26 UTC 2004
+/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Feb 18 17:22:58 PST 2005
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 177 fixup descriptions.
+ * This file contains 182 fixup descriptions.
*
* See README for more information.
*
@@ -42,6 +42,50 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Aab_Darwin_Fenv_H fix
+ */
+tSCC zAab_Darwin_Fenv_HName[] =
+ "AAB_darwin_fenv_h";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAab_Darwin_Fenv_HList[] =
+ "|fenv.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAab_Darwin_Fenv_HMachs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zAab_Darwin_Fenv_HBypass0[] =
+ "#pragma GCC fenv";
+
+#define AAB_DARWIN_FENV_H_TEST_CT 1
+static tTestDesc aAab_Darwin_Fenv_HTests[] = {
+ { TT_NEGREP, zAab_Darwin_Fenv_HBypass0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Aab_Darwin_Fenv_H
+ */
+static const char* apzAab_Darwin_Fenv_HPatch[] = {
+"/* This file is a backwards compability hack to allow \n\
+ no-trapping-math to be the default. */\n\
+#ifndef _DARWIN_FENV_H_WRAPPER\n\
+#if defined(__GNUC__) && __GNUC__ >= 4\n\
+#pragma GCC fenv\n\
+#endif\n\
+#include_next <fenv.h>\n\
+#define _DARWIN_FENV_H_WRAPPER\n\
+#endif /* _DARWIN_FENV_H_WRAPPER */",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Aab_Fd_Zero_Asm_Posix_Types_H fix
*/
tSCC zAab_Fd_Zero_Asm_Posix_Types_HName[] =
@@ -1720,6 +1764,46 @@ static const char* apzDarwin_Gcc4_BreakagePatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Darwin_Macosx_Deployment_Target fix
+ */
+tSCC zDarwin_Macosx_Deployment_TargetName[] =
+ "darwin_macosx_deployment_target";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Macosx_Deployment_TargetList[] =
+ "|AvailabilityMacros.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Macosx_Deployment_TargetMachs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zDarwin_Macosx_Deployment_TargetBypass0[] =
+ "__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__";
+
+#define DARWIN_MACOSX_DEPLOYMENT_TARGET_TEST_CT 1
+static tTestDesc aDarwin_Macosx_Deployment_TargetTests[] = {
+ { TT_NEGREP, zDarwin_Macosx_Deployment_TargetBypass0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Macosx_Deployment_Target
+ */
+static const char* apzDarwin_Macosx_Deployment_TargetPatch[] = {
+ "format",
+ "#if ! defined (MAC_OS_X_VERSION_MIN_REQUIRED) && defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)\n\
+ #define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__\n\
+#elif ! defined (MAC_OS_X_VERSION_MIN_REQUIRED)\n",
+ "#ifndef MAC_OS_X_VERSION_MIN_REQUIRED\n",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Darwin_Private_Extern fix
*/
tSCC zDarwin_Private_ExternName[] =
@@ -1758,6 +1842,132 @@ static const char* apzDarwin_Private_ExternPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Darwin_Stdint_Guards_Intn fix
+ */
+tSCC zDarwin_Stdint_Guards_IntnName[] =
+ "darwin_stdint_guards_intn";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_Guards_IntnList[] =
+ "|ppc/types.h|i386/types.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_Guards_IntnMachs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zDarwin_Stdint_Guards_IntnBypass0[] =
+ "_INT32_T[ \n\
+]";
+
+#define DARWIN_STDINT_GUARDS_INTN_TEST_CT 1
+static tTestDesc aDarwin_Stdint_Guards_IntnTests[] = {
+ { TT_NEGREP, zDarwin_Stdint_Guards_IntnBypass0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_Guards_Intn
+ */
+static const char* apzDarwin_Stdint_Guards_IntnPatch[] = {
+ "format",
+ "#ifndef _INT%2_T\n\
+#define _INT%2_T\n\
+%0\n\
+#endif",
+ "typedef[ \t]([_a-z ]*\t+)int([0-9]+)_t;",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Darwin_Stdint_Guards_Intptr fix
+ */
+tSCC zDarwin_Stdint_Guards_IntptrName[] =
+ "darwin_stdint_guards_intptr";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_Guards_IntptrList[] =
+ "|ppc/types.h|i386/types.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_Guards_IntptrMachs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zDarwin_Stdint_Guards_IntptrBypass0[] =
+ "_INTPTR_T[ \n\
+]";
+
+#define DARWIN_STDINT_GUARDS_INTPTR_TEST_CT 1
+static tTestDesc aDarwin_Stdint_Guards_IntptrTests[] = {
+ { TT_NEGREP, zDarwin_Stdint_Guards_IntptrBypass0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_Guards_Intptr
+ */
+static const char* apzDarwin_Stdint_Guards_IntptrPatch[] = {
+ "format",
+ "#ifndef _INTPTR_T\n\
+#define _INTPTR_T\n\
+%0\n\
+#endif",
+ "typedef[ \t]([_a-z \t]+)[ \t]+intptr_t;",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
+ * Description of Darwin_Stdint_Guards_Uintptr fix
+ */
+tSCC zDarwin_Stdint_Guards_UintptrName[] =
+ "darwin_stdint_guards_uintptr";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Stdint_Guards_UintptrList[] =
+ "|ppc/types.h|i386/types.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Stdint_Guards_UintptrMachs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content bypass pattern - skip fix if pattern found
+ */
+tSCC zDarwin_Stdint_Guards_UintptrBypass0[] =
+ "_UINTPTR_T[ \n\
+]";
+
+#define DARWIN_STDINT_GUARDS_UINTPTR_TEST_CT 1
+static tTestDesc aDarwin_Stdint_Guards_UintptrTests[] = {
+ { TT_NEGREP, zDarwin_Stdint_Guards_UintptrBypass0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Stdint_Guards_Uintptr
+ */
+static const char* apzDarwin_Stdint_Guards_UintptrPatch[] = {
+ "format",
+ "#ifndef _UINTPTR_T\n\
+#define _UINTPTR_T\n\
+%0\n\
+#endif",
+ "typedef[ \t]([_a-z \t]+)[ \t]+uintptr_t;",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Dec_Intern_Asm fix
*/
tSCC zDec_Intern_AsmName[] =
@@ -7085,14 +7295,15 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 207
+#define REGEX_COUNT 212
#define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT 177
+#define FIX_COUNT 182
/*
* Enumerate the fixes
*/
typedef enum {
+ AAB_DARWIN_FENV_H_FIXIDX,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_FIXIDX,
AAB_FD_ZERO_GNU_TYPES_H_FIXIDX,
AAB_FD_ZERO_SELECTBITS_H_FIXIDX,
@@ -7133,7 +7344,11 @@ typedef enum {
CTRL_QUOTES_USE_FIXIDX,
CXX_UNREADY_FIXIDX,
DARWIN_GCC4_BREAKAGE_FIXIDX,
+ DARWIN_MACOSX_DEPLOYMENT_TARGET_FIXIDX,
DARWIN_PRIVATE_EXTERN_FIXIDX,
+ DARWIN_STDINT_GUARDS_INTN_FIXIDX,
+ DARWIN_STDINT_GUARDS_INTPTR_FIXIDX,
+ DARWIN_STDINT_GUARDS_UINTPTR_FIXIDX,
DEC_INTERN_ASM_FIXIDX,
DJGPP_WCHAR_H_FIXIDX,
ECD_CURSOR_FIXIDX,
@@ -7273,6 +7488,11 @@ typedef enum {
} t_fixinc_idx;
tFixDesc fixDescList[ FIX_COUNT ] = {
+ { zAab_Darwin_Fenv_HName, zAab_Darwin_Fenv_HList,
+ apzAab_Darwin_Fenv_HMachs,
+ AAB_DARWIN_FENV_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
+ aAab_Darwin_Fenv_HTests, apzAab_Darwin_Fenv_HPatch, 0 },
+
{ zAab_Fd_Zero_Asm_Posix_Types_HName, zAab_Fd_Zero_Asm_Posix_Types_HList,
apzAab_Fd_Zero_Asm_Posix_Types_HMachs,
AAB_FD_ZERO_ASM_POSIX_TYPES_H_TEST_CT, FD_MACH_ONLY | FD_REPLACEMENT,
@@ -7473,11 +7693,31 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
DARWIN_GCC4_BREAKAGE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Gcc4_BreakageTests, apzDarwin_Gcc4_BreakagePatch, 0 },
+ { zDarwin_Macosx_Deployment_TargetName, zDarwin_Macosx_Deployment_TargetList,
+ apzDarwin_Macosx_Deployment_TargetMachs,
+ DARWIN_MACOSX_DEPLOYMENT_TARGET_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Macosx_Deployment_TargetTests, apzDarwin_Macosx_Deployment_TargetPatch, 0 },
+
{ zDarwin_Private_ExternName, zDarwin_Private_ExternList,
apzDarwin_Private_ExternMachs,
DARWIN_PRIVATE_EXTERN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aDarwin_Private_ExternTests, apzDarwin_Private_ExternPatch, 0 },
+ { zDarwin_Stdint_Guards_IntnName, zDarwin_Stdint_Guards_IntnList,
+ apzDarwin_Stdint_Guards_IntnMachs,
+ DARWIN_STDINT_GUARDS_INTN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_Guards_IntnTests, apzDarwin_Stdint_Guards_IntnPatch, 0 },
+
+ { zDarwin_Stdint_Guards_IntptrName, zDarwin_Stdint_Guards_IntptrList,
+ apzDarwin_Stdint_Guards_IntptrMachs,
+ DARWIN_STDINT_GUARDS_INTPTR_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_Guards_IntptrTests, apzDarwin_Stdint_Guards_IntptrPatch, 0 },
+
+ { zDarwin_Stdint_Guards_UintptrName, zDarwin_Stdint_Guards_UintptrList,
+ apzDarwin_Stdint_Guards_UintptrMachs,
+ DARWIN_STDINT_GUARDS_UINTPTR_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Stdint_Guards_UintptrTests, apzDarwin_Stdint_Guards_UintptrPatch, 0 },
+
{ zDec_Intern_AsmName, zDec_Intern_AsmList,
apzDec_Intern_AsmMachs,
DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY,
diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def
index 28dbd46533e..08361cd0dcb 100644
--- a/fixincludes/inclhack.def
+++ b/fixincludes/inclhack.def
@@ -20,6 +20,43 @@ autogen definitions fixincl;
FIXINC_DEBUG = yes;
#endif
+/* APPLE LOCAL begin pragma fenv */
+/*
+ * This adds #pragma GCC fenv to <fenv.h>. This is part of a
+ * kludge to allow no-trapping-math be the default, yet handle
+ * all the edge cases in C99 right, although FENV_ACCESS doesn't
+ * work in a useful fashion. It should be possible to remove
+ * this if and when FENV_ACCESS is fully implemented.
+ *
+ * For Tiger the macro is already added to the standard header.
+ * This exists to support backwards compatibility in SDKs.
+ */
+fix = {
+ hackname = AAB_darwin_fenv_h;
+ files = fenv.h;
+ mach = '*-*-darwin*';
+ bypass = '#pragma GCC fenv';
+
+ /*
+ * Define _DARWIN_FENV_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 <fenv.h>.
+ */
+ replace = <<- _EndOfHeader_
+ /* This file is a backwards compability hack to allow
+ no-trapping-math to be the default. */
+ #ifndef _DARWIN_FENV_H_WRAPPER
+ #if defined(__GNUC__) && __GNUC__ >= 4
+ #pragma GCC fenv
+ #endif
+ #include_next <fenv.h>
+ #define _DARWIN_FENV_H_WRAPPER
+ #endif /* _DARWIN_FENV_H_WRAPPER */
+ _EndOfHeader_;
+};
+/* APPLE LOCAL end pragma fenv */
+
/*
* This fixes __FD_ZERO bug for linux 2.x.y (x <= 2 && y <= some n)
*/
@@ -1038,6 +1075,26 @@ fix = {
};
+/* APPLE LOCAL begin deployment target */
+/*
+ * GCC used to set MAC_OS_X_VERSION_MIN_REQUIRED directly, but that isn't
+ * namespace-clean.
+ */
+fix = {
+ hackname = darwin_macosx_deployment_target;
+ mach = "*-*-darwin*";
+ files = AvailabilityMacros.h;
+ bypass = "__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__";
+ c_fix = format;
+ c_fix_arg = "#if ! defined (MAC_OS_X_VERSION_MIN_REQUIRED) && defined (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)\n #define MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__\n#elif ! defined (MAC_OS_X_VERSION_MIN_REQUIRED)\n";
+ c_fix_arg = "#ifndef MAC_OS_X_VERSION_MIN_REQUIRED\n";
+ test_text = "__private_extern__ int _dyld_func_lookup(\n"
+ "const char *dyld_func_name,\n"
+ "unsigned long *address);\n";
+};
+/* APPLE LOCAL end deployment target */
+
+
/*
* __private_extern__ doesn't exist in FSF GCC. Even if it did,
* why would you ever put it in a system header file?
@@ -1056,6 +1113,52 @@ fix = {
};
+/* APPLE LOCAL begin stdint.h */
+/*
+ * To support a fully namespace-clean stdint.h, <machine/types.h> can't
+ * be included; and that means that the various types.h files must
+ * cooperate with stdint.h.
+ */
+fix = {
+ hackname = darwin_stdint_guards_intn;
+ mach = "*-*-darwin*";
+ files = ppc/types.h;
+ files = i386/types.h;
+ bypass = "_INT32_T[ \n]";
+ c_fix = format;
+ c_fix_arg = "#ifndef _INT%2_T\n#define _INT%2_T\n%0\n#endif";
+ c_fix_arg = "typedef[ \t]([_a-z ]*\t+)int([0-9]+)_t;";
+ test_text = "typedef\t__signed char\t\tint8_t;\n";
+};
+
+
+fix = {
+ hackname = darwin_stdint_guards_intptr;
+ mach = "*-*-darwin*";
+ files = ppc/types.h;
+ files = i386/types.h;
+ bypass = "_INTPTR_T[ \n]";
+ c_fix = format;
+ c_fix_arg = "#ifndef _INTPTR_T\n#define _INTPTR_T\n%0\n#endif";
+ c_fix_arg = "typedef[ \t]([_a-z \t]+)[ \t]+intptr_t;";
+ test_text = "typedef long int\t\tintptr_t;\n";
+};
+
+
+fix = {
+ hackname = darwin_stdint_guards_uintptr;
+ mach = "*-*-darwin*";
+ files = ppc/types.h;
+ files = i386/types.h;
+ bypass = "_UINTPTR_T[ \n]";
+ c_fix = format;
+ c_fix_arg = "#ifndef _UINTPTR_T\n#define _UINTPTR_T\n%0\n#endif";
+ c_fix_arg = "typedef[ \t]([_a-z \t]+)[ \t]+uintptr_t;";
+ test_text = "typedef unsigned long int\tuintptr_t;\n";
+};
+/* APPLE LOCAL end stdint.h */
+
+
/*
* Fix <c_asm.h> on Digital UNIX V4.0:
* It contains a prototype for a DEC C internal asm() function,
diff --git a/gcc/ChangeLog.apple-ppc b/gcc/ChangeLog.apple-ppc
new file mode 100644
index 00000000000..533ca3dbfe9
--- /dev/null
+++ b/gcc/ChangeLog.apple-ppc
@@ -0,0 +1,3783 @@
+2005-03-09 Devang Patel <dpatel@apple.com>
+
+ * tree-vectorizer.c (vect_analyze_loop): Reorder data refs alignment analysis.
+
+2005-03-08 Dale Johannesen <dalej@apple.com>
+
+ * Makefile.in: Remove useless code from LNO branch.
+ * tree-ssa-loop-ch.c: Local marker cleanup.
+ * tree-pass.h: Ditto.
+ * tree-ssa-loop.c: Ditto both the above.
+
+2005-03-08 Dale Johannesen <dalej@apple.com>
+
+ * Makefile.in: Remove useless code from LNO branch.
+ * cfgloop.h: Ditto.
+ * cfgloopmanip.c: Ditto.
+ * common.opt: Ditto.
+ * lambda-trans.c: Ditto.
+ * opts.c: Ditto.
+ * rtl.h: Ditto.
+ * timevar.def: Ditto.
+ * toplev.c: Ditto.
+ * toplev.h: Ditto.
+ * tree-flow.h: Ditto.
+ * tree-optimize.c: Ditto.
+ * tree-pass.h: Ditto.
+ * tree-ssa-loop-ch.c: Ditto.
+ * tree-ssa-loop.c: Ditto.
+ * tree.h: Ditto.
+ * varray.h: Ditto.
+
+2005-03-07 Devang Patel <dpatel@apple.com>
+
+ * target-def.h (TARGET_VECT): Remove.
+ * target.h (tree.h, tree-flow.h): Do not include.
+ (struct gcc_target): Remove struct vect.
+ * config/rs6000/rs6000.c (cfgloop.h): Do not include.
+ (rs6000_support_misaligned_vloads, rs6000_permute_misaligned_vloads,
+ rs6000_build_builtin_lvsl, rs6000_build_builtin_lvsr,
+ rs6000_build_builtin_vperm, rs6000_support_vmul_uch_p,
+ rs6000_build_vmul_uch, rs6000_support_vector_init_p,
+ get_vector_init_fns_for_type, rs6000_build_vector_init): Remove.
+ (TARGET_VECT_SUPPORT_MISALIGNED_LOADS, TARGET_VECT_PERMUTE_MISALIGNED_LOADS,
+ TARGET_VECT_BUILD_BUILTIN_LVSL, TARGET_VECT_BUILD_BUILTIN_LVSR,
+ TARGET_VECT_BUILD_BUILTIN_VPERM, TARGET_VECT_SUPPORT_VMUL_UCH_P,
+ TARGET_VECT_BUILD_VMUL_UCH, TARGET_VECT_SUPPORT_VECTOR_INIT_P,
+ TARGET_VECT_BUILD_VECTOR_INIT, TARGET_GIMPLIFY_VA_ARG_EXPR): Remove.
+ * c-incpath.c (errors.h): Include.
+
+2005-03-06 Devang Patel <dpatel@apple.com>
+
+ * config/darwin.h (LINK_COMMAND_SPEC): Remove foutput-dbg.
+
+2005-03-06 Devang Patel <dpatel@apple.com>
+
+ * target-def.h (TARGET_VECT_SUPPORT_MISALIGNED_LOADS,
+ TARGET_VECT_PERMUTE_MISALIGNED_LOADS, TARGET_VECT_BUILD_BUILTIN_LVSL,
+ TARGET_VECT_BUILD_BUILTIN_LVSR, TARGET_VECT_BUILD_BUILTIN_VPERM,
+ TARGET_VECT_SUPPORT_VMUL_UCH_P, TARGET_VECT_BUILD_VMUL_UCH,
+ TARGET_VECT_SUPPORT_VECTOR_INIT_P, TARGET_VECT_BUILD_VECTOR_INIT): Remove
+ redundant macros.
+
+2005-03-06 Devang Patel <dpatel@apple.com>
+
+ Radar 4025991
+ * tree-vectorizer.c (vect_is_simple_cond): Now second parameter is
+ loop_vec_info instead of loop *.
+ (vectorizable_select): Supply loop_vec_info to vect_is_simple_use.
+ (vect_build_dist_vector): Use loop nest's depth.
+
+2005-03-06 Devang Patel <dpatel@apple.com>
+
+ * c-opts.c (c_common_handle_option): Remove QA_DISABLE_WERROR.
+
+2005-03-06 Devang Patel <dpatel@apple.com>
+
+ * tree-ssa-operands.h (add_vdef): Remove.
+ * tree.h (get_array_base): Remove.
+ (swap_tree_comparison): Remove redundant decl.
+
+2005-03-06 Devang Patel <dpatel@apple.com>
+
+ * varray.h (VARRAY_DG_INIT, VARRAY_DG): Remove.
+
+2005-03-04 Dale Johannesen <dalej@apple.com>
+
+ Radar 4025985 (partial)
+ * config/rs6000/rs6000.c: Restore 64-bit ABI from mainline.
+ * config/rs6000/rs6000.h: Ditto.
+
+2005-03-03 Dale Johannesen <dalej@apple.com>
+
+ Radar 3897244
+ * config/i386/darwin.h: Define REGISTER_TARGET_PRAGMAS
+ and ROUND_TYPE_ALIGN.
+ * config/i386/i386.c (x86_field_alignment): Support Mac68K alignment.
+
+2005-03-02 Devang Patel <dpatel@apple.com>
+
+ Undo Radar 4023104
+ * config/darwin-driver.c (dash_capital_m_seen): Remove.
+ (main) : Do not handle -M options.
+
+2005-02-28 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4015382
+ * config/darwin.c (machopic_select_section): Do not place
+ non-weak '::operator new' and '::operator delete' definitions
+ in the coalesced section.
+
+2005-02-27 Dale Johannesen <dalej@apple.com>
+
+ Radar 4015911
+ * config/i386/i386.c (ix86_binds_local_p): New.
+ (TARGET_BINDS_LOCAL_P): Use it.
+
+2005-02-26 Dale Johanensen <dalej@apple.com>
+
+ Radar 3988125
+ PR 19360 (from mainline)
+ * tree-ssa-dom.c (tree_ssa_dominator_optimize): Clear SSA_NAME_VALUE
+ at the end of the main DOM loop rather than just before DOM exits.
+
+2005-02-25 Devang Patel <dpatel@apple.com>
+
+ Radar 4023104
+ * config/darwin-driver.c (dash_capital_m_seen): New.
+ (main) : Handle -M options.
+
+2005-02-24 Dale Johannesen <dalej@apple.com>
+
+ * doc/extend.texi (nested function description): Improvement
+ from mainline.
+
+2005-02-23 Dale Johannesen <dalej@apple.com>
+
+ Radar 4011924
+ PR 19241 (patch from mainline)
+ * tree-inline.c (copy_body_r): Don't recurse when
+ remapping variables.
+
+2005-02-23 Devang Patel <dpatel@apple.com>
+
+ Radar 4021019
+ * config/rs6000/darwin.h (CC1_SPEC): Ignore -march=pentium4 and
+ -mcpu=pentium4.
+ * config/i386/darwin.h (CC1_SPEC): Ignore -mno-fused-madd.
+
+2005-02-23 Devang Patel <dpatel@apple.com>
+
+ Radar 3841402 3841397 3841275
+ * config/darwin-driver.c (add_arch_options): Do not supply
+ -march=i386. Interpret -arch pentIIm3 appropriately.
+
+2005-02-22 Devang Patel <dpatel@apple.com>
+
+ Radar 3844827
+ Backport from Mainline.
+
+ 2005-01-18 Andi Kleen <ak@muc.de>
+
+ * c-typeck.c: (convert_for_assignment): Check warn_pointer_sign.
+ * c.opt (-Wpointer-sign): Add.
+ * doc/invoke.texi: (-Wpointer-sign): Add.
+
+2005-02-21 Dale Johannesen <dalej@apple.com>
+
+ Radar 4015820 (missing piece)
+ * objcp/objcp-lang.c: Use objc_gimplify_expr.
+
+2005-02-21 Dale Johannesen <dalej@apple.com>
+
+ Radar 4015820
+ * objc/objc-act.c (objc_gimplify_expr): New.
+ * objc/objc-lang.c (LANG_HOOKS_GIMPLIFY_EXPR): Use it.
+ * objc/objc-act.h: Declare it. Include tree-gimple.h.
+ * objc/Make-lang.in: Add required tree-gimple.h's.
+ * objcp/Make-lang.in: Ditto.
+
+2005-02-21 Stan Shebs <shebs@apple.com>
+
+ * config/darwin-c.c (darwin_pragma_options): Warn about uses
+ of mac68k alignment pragma when 64-bit.
+
+2005-02-21 Devang Patel <dpatel@apple.com>
+
+ Radar 3964387
+ * config/rs6000/darwin.h (CC1_SPEC): Ignore -msse and -msse2.
+
+2005-02-19 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4014879
+ * config/rs6000/rs6000.md (call_nonlocal_sysv,
+ sibcall_symbolic): Add handling of ABSCALL annotations.
+
+2005-02-17 Devang Patel <dpatel@apple.com>
+
+ Radar 4008460
+ * tree-vectorizer.c (vect_analyze_data_ref_dependence): Check for NULL
+ distance vector.
+
+2005-02-17 Devang Patel <dpatel@apple.com>
+
+ Undo Radar 3964387 fix.
+
+2005-02-17 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3971074
+
+ * c-common.c (cw_asm_stmt): Generate .file and .line
+ directives. Remove cw_asm_lineno declaration.
+ * c-common.h: Add argument to cw_asm_stmt declaration, remove
+ cw_asm_lineno declaration.
+ * c-parse.in: Accurately pass line no information to
+ cw_asm_stmt routine.
+
+2005-02-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3635843, 3922342
+ * c-common.h (objc_generate_write_barrier): New prototype.
+ * c-typeck.c (lvalue_or_else): Do not emit warning if
+ '-Wno-non-lvalue-assign' has been specified.
+ (build_modify_expr): Call objc_generate_write_barrier() if
+ '-fobjc-gc' has been specified.
+ * c.opt (-Wassign-intercept, -Wnon-lvalue-assign,
+ -fobjc-direct-dispatch, -fobjc-gc): New options.
+ * calls.c (emit_call_1): For functions with 'hard_coded_address'
+ attribute, annotate the RTL call instruction with the address
+ to use.
+ * reg-notes.def (ABSCALL): New RTL annotation.
+ * stub-objc.c (objc_generate_write_barrier): New stub.
+ * config/darwin-protos.h (darwin_handle_objc_gc_attribute):
+ New prototype.
+ * config/darwin.c (darwin_handle_objc_gc_attribute): New function.
+ * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add
+ '-Wno-non-lvalue-assign' whenever '-fobjc-gc' is seen.
+ (SUBTARGET_OS_CPP_BUILTINS): Define '__strong' and '__OBJC_GC__'
+ macros as needed.
+ (SUBTARGET_ATTRIBUTE_TABLE): Add 'objc_gc' attribute.
+ * config/rs6000/rs6000.md (call_value_nonlocal_sysv,
+ sibcall_value_symbolic): Add handling of ABSCALL annotations.
+
+2005-02-16 Dale Johannesen <dalej@apple.com>
+
+ Radar 4006687
+ PR 17767 et al (fix from mainline)
+ * cse.c (fold_rtx) [RTX_COMPARE, RTX_COMM_COMPARE]: Don't attempt
+ any simplifications of vector mode comparison operators.
+ * simplify-rtx.c (simplify_relational_operation): Fix variable name.
+
+2005-02-15 Dale Johannesen <dalej@apple.com>
+
+ Radar 3991611
+ Radar 3990578
+ PRs 19084 and 19348 (fix from mainline)
+ * recog.c (peephole2_optimize): Do global life update if some peephole
+ decides it doesn't need at least one of its inputs and that change
+ influences liveness at the start of the basic block.
+ * basic-block.h (EXECUTE_IF_AND_COMPL_IN_REG_SET): Needs 2 REGSET
+ arguments instead of 1.
+
+2005-02-15 Dale Johannesen <dalej@apple.com>
+
+ Radar 3876378
+ Radar 3838108
+ PR 18109 (fix from mainline)
+ * config/i386/i386.md (movhi_1): Remove previous attempt at a fix.
+ (movqi_1): Ditto. Don't use 4-byte load when unsafe.
+
+2004-02-16 Devang Patel <dpatel@apple.com>
+
+ Radar 3964387
+ * build_gcc: Build darwin-driver-rs6000.c and darwin-driver-i386.c
+ * config/darwin-driver-rs6000.c: New file
+ * config/darwin-driver-i386.c: New file
+ * config/darwin-driver.h: New file
+ * config/darwin-driver.c (darwin-driver.h): Include.
+ (ppc_specific_args, ppc_specific_args_size, ppc_specific_arg_count,
+ x86_specific_args, x86_specific_args_size, x86_specific_arg_count,
+ is_ppc_specific_option, is_x86_specific_option): New.
+ (remove_arch_options): New parameter.
+ (add_arch_options): Insert arch specific options.
+ (main): Interpret arch specific options.
+
+2005-02-16 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3970655
+
+ * c-common.c (prepend_char_identifier): Modified old
+ get_atsign_identifier to handle any character.
+ * c-common.h (prepend_char_identifier): New function declaration.
+ Removed get_atsign_identifier declaration.
+ * c-lex.c (c_lex_with_flags): Add '.' to those tokens which
+ can start a CW asm statement.
+ * c-parse.in (cw_identifier): New CW identifier syntax.
+
+2005-02-15 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3970646
+ * c-common.c (cw_asm_identifier): New routine.
+ (cw_asm_stmt): call cw_asm_identifier on asm operator.
+ * cp/parser.c (cp_parser_cw_asm_relative_branch): New routine.
+ (cp_parser_cw_asm_postfix_expression): Call
+ cp_parser_cw_asm_relative_branch to parse relative branch
+ operand.
+
+2005-02-14 Devang Patel <dpatel@apple.com>
+
+ Radar 4002184
+ * config/rs6000/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE): Remove
+ -ffix-and-continue.
+
+2005-02-14 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3971053
+ * cp/parser.c (cp_parser_unary_expression): Defer 'sizeof' in asm
+ block to cp_parser_cw_asm_postfix_expression.
+ (cp_parser_cw_asm_postfix_expression): Process sizeof here.
+
+ Radar 3971060
+ c-common.c (cw_asm_expr_val): New routine.
+ (print_cw_asm_operand): Call cw_asm_expr_val to evaluate complex
+ numeric expressions used in asm block.
+
+ Radar 3971070
+ gcc/c-parse.in (cw_asm_unary_expr): Error on undeclared type used
+ in sizeof.
+ c-typeck.c (parser_build_binary_op): Check for use of undefined
+ in asm block.
+ cp/typeck.c (build_x_binary_op): Ditto
+
+2005-02-11 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3962013 (Part 2)
+ * doc/invoke.texi: Document '-Wstrict-selector-match'.
+
+2005-02-11 Devang Patel <dpatel@apple.com>
+
+ Radar 3996800
+ * gcc.c (cpp_uniq_options): Emit '-mconstant-cfstrings' option,
+ if needed.
+
+2005-02-09 Dale Johannesen <dalej@apple.com>
+
+ Radar 3985162
+ Radar 3990505
+ * cselib.c (cselib_process_insn): Clear out regs where
+ HARD_REGNO_CALL_PART_CLOBBERED is true at a call.
+ * reload.c (find_equiv_reg): Ditto.
+
+2005-02-06 Dale Johannesen <dalej@apple.com>
+
+ Radar 3988061
+ * langhooks-def.h: add lhd_vtable_p, LANG_HOOKS_VTABLE_P
+ langhooks.c (lhd_vtable_p): New.
+ langhooks.h (struct lang_hooks): Add vtable_p.
+ config/rs6000/rs6000.c (rs6000_binds_local_p): Treat kext
+ vtables as non-local-binding.
+ cp/cp-objcp-common.c (cp_vtable_p): New.
+ cp/cp-objcp-common.h: Use it for LANG_HOOKS_VTABLE_P.
+ cp/cp-tree.h: Declare it.
+
+2005-02-06 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3984134 (again)
+ * config/darwin-driver.c (do_compile): Update argc_count for
+ target-specific options.
+ (add_arch_options): Improve debug output.
+
+2005-02-02 Mike Stump <mrs@apple.com>
+
+ Radar 3981486
+ * objcp/lang-specs.h ("@objc++-cpp-output"): Add support for 3.3
+ language name for distributed builds.
+
+2005-02-02 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3984134
+ * config/darwin-driver.c (initialize): Allow for extra NULL in
+ new_argv. Update comment for lipo_argv.
+ (do_lipo): Add NULL at end. Check for NULL at end when printing.
+ (do_compile): Add NULL at end of current_argv.
+ (main): Add NULL at end of new_argv.
+
+2005-02-01 Devang Patel <dpatel@apple.com>
+
+ Radar 3983593
+ * c-pch.c (pch_matching[]): Add -faltivec.
+ * c.opt (faltivec): Use flag_altivec as variable.
+ * toplev.c (flag_disable_opts_for_faltivec): New.
+ * flags.h (flag_disable_opts_for_faltivec): Same.
+
+2005-01-31 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3978168
+ * c-typeck.c (lvalue_or_else): Allow certain non-lvalues
+ as arguments to '&', and print appropriate warning.
+
+2004-01-31 Devang Patel <dpatel@apple.com>
+
+ Radar 3978580
+ * varasm.c (const_hash_1): Check constant cfstring.
+ (compare_constant): Same.
+ * config/darwin-protos.h (darwin_constant_cfstring_p): New.
+ * config/darwin.c (darwin_constant_cfstring_p): New.
+
+2005-01-31 Roger Sayle <roger@eyesopen.com>
+ Dale Johannesen <dalej@apple.com>
+
+ Radar 3974393
+ * fold-const.c (fold_binary_op_with_conditional_arg):
+ Make types match original operands, before STRIP_NOPS.
+ (From mainline.)
+
+2005-01-30 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3962013
+ * c.opt (Wstrict-selector-match): New option.
+
+2005-01-28 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3979484
+
+ * cp/typeck2.c (digest_init): Convert AltiVec-style
+ vector constant to its internal tree representation.
+
+2005-01-28 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3967653
+ * config/rs6000/rs6000.c (rs6000_handle_altivec_attribute):
+ Diagnose 'long long' and 64bit 'long' vector declarations.
+
+2005-01-26 Dale Johannesen <dalej@apple.com>
+
+ Back out preceding change, which is wrong.
+
+2005-01-26 Dale Johannesen <dalej@apple.com>
+
+ Radar 3974393
+ PR 19650
+ * fold-const.c (fold_binary_op_with_conditional_arg):
+ Make constant 0 or 1 be of correct type.
+
+2005-01-27 Mike Stump <mrs@apple.com>
+
+ Radar 3978098
+ * config/darwin.h (SUBTARGET_OS_CPP_BUILTINS): Move setting
+ pascal_string for cpp from here...
+ * config/darwin.h (SUBSUBTARGET_OVERRIDE_OPTIONS): ..to here.
+ * c-cppbuiltin.c: Remove includes for pascal strings.
+ * config/rs6000/rs6000.c (parse_in): Add.
+ * config/i386/i386.c (parse_in): Add.
+
+2005-01-26 Stuart Hastings <stuart@apple.com>
+
+ Radar 3967989
+ * gcc/gimplify.c (shortcut_cond_expr): Re-compute side-effects.
+ * gcc/testsuite/gcc.c-torture/execute/20050125-1.c: New.
+
+2005-01-26 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3970884
+ * tree.c (reconstruct_complex_type): Reconstruct
+ REFERENCE_TYPEs correctly, instead of turning them
+ into POINTER_TYPEs.
+ * config/rs6000/rs6000.c (rs6000_handle_altivec_attribute):
+ Propagate all qualifiers from element type onto vector type.
+
+2005-01-25 Dale Johannesen <dalej@apple.com>
+
+ Radar 3941199
+ * config/rs6000/darwin-tramp.asm (__trampoline_setup):
+ Make work for 64 bit.
+
+2005-01-25 Dale Johannesen <dalej@apple.com>
+
+ Radar 3944688
+ PR 19147
+ * config/rs6000/rs6000.md (andsi3_internal7, andsi3_internal8): Delete.
+
+2005-01-25 Dale Johannesen <dalej@apple.com>
+
+ Radar 3970057
+ * config/rs6000/rs6000.c (rs6000_return_in_memory):
+ Implement Darwin 64-bit convention correctly.
+ (rs6000_darwin64_record_arg_flush_pending):
+ Compute correct reg for int field following doubles.
+
+2005-01-24 Stuart Hastings <stuart@apple.com>
+
+ Radar 3939078
+ * gcc/cgraphunit.c (cgraph_build_static_cdtor) Don't set DECL_IGNORED_P.
+
+2005-01-24 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3961973 (Part 2)
+ * c-typeck.c (lvalue_or_else): Acccept NON_LVALUE_EXPRs
+ as cast expressions.
+
+2005-01-23 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3961973
+ * c-common.c (flag_lvalue_cast_assign): Remove.
+ * c-common.h (flag_lvalue_cast_assign): Remove.
+ * c-opts.c (c_common_handle_option): Remove
+ '-flvalue-cast-assign' handling.
+ * c-typeck.c (lvalue_or_else): Change first parameter from
+ 'tree' to 'tree *'; handle conditional lvalues in addition
+ to lvalue casts; when rewriting expressions, create a new
+ tree instead of clobbering an existing one.
+ (build_unary_op, build_modify_expr, build_asm_expr):
+ Adjust calls to lvalue_or_else().
+ * c.opt: Rename -flvalue-cast-assign to -fnon-lvalue-assign
+ and add Var(...) and Init(...) annotation to create a flag.
+ * doc/invoke.texi: Likewise; add description of lvalue
+ conditional expressions and how they are transformed.
+
+2005-01-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3951887
+ * gimplify.c (gimplify_expr): Adjust the type of
+ INDIRECT_REFs after their argument is gimplified.
+
+2005-01-19 Robert Bowdidge <bowdidge@apple.com>
+
+ * config/darwin.h (SUBSUBTARGET_OVERRIDE_OPTIONS) Turn off
+ -fweak whenever we're building kexts.
+ * Makefile.in: Add -fno-non-call-exceptions to flags passed when
+ building files for libcc_kext.a
+ * mklibgcc: Move -fexception and -fnon-call-exceptions to start of
+ command line so multilib machinery can override
+
+2005-01-20 Dale Johannesen <dalej@apple.com>
+
+ Radar 3966230
+ * config/rs6000/darwin.md (movsf_low_di): Make work.
+
+2005-01-19 Dale Johannesen <dalej@apple.com>
+
+ Radar 3961638
+ * config/rs6000/darwin.md (movdf_low_di): Make work.
+
+2005-01-19 Mike Stump <mrs@apple.com>
+
+ Radar 3962625
+ * c-incpath.c (hmap_construct_pathname): Warn when headermaps find
+ files with mismatched case.
+
+2005-01-13 Dale Johannesen <dalej@apple.com>
+
+ Radars 3942172 3897795 3944716 3941494
+ * config/rs6000/rs6000.h (CUMULATIVE_ARGS): New fields
+ intoffset, use_stack, named.
+ * config/rs6000/rs6000.c (rs6000_darwin64_function_arg): Remove.
+ rs6000_darwin64_record_arg_advance_flush_pending_int_fields: New.
+ rs6000_darwin64_record_arg_advance_recurs: New.
+ rs6000_darwin64_record_arg_flush_pending_int_fields: New.
+ rs6000_darwin64_record_arg_recurs: New.
+ rs6000_darwin64_record_arg: New.
+ rs6000_return_in_memory: Remove AGGREGATE_TYPE_P check.
+ function_arg_boundary: Handle 128-bit aligned structs.
+ function_arg_advance: Rewrite darwin-64 struct handling.
+ function_arg: Call rs6000_darwin64_record_arg.
+ function_arg_partial_nregs: Handle darwin-64 structs.
+ rs6000_darwin64_function_value: Remove.
+ rs6000_function_value: Call rs6000_darwin64_record_arg.
+
+2005-01-04 Anders Bertelrud <anders@apple.com>
+
+ Radar 3871393
+ * gcc/c-incpath.c: Merged in headermap code from GCC 3.3 source
+ base, modifying it somewhat to work in GCC 4.0.
+ (hmap_hash_string): Copied from GCC 3.3.
+ (hmap_compare_strings): Copied from GCC 3.3.
+ (hmap_load_header_map): Copied from GCC 3.3.
+ (hmap_construct_pathname): Copied from GCC 3.3 and modified
+ to have calling convensions for cpp_dir's 'construct' field.
+ (remove_duplicates): If a search path refers to a file rather than
+ a directory, we check if it's a headermap file immediately before
+ we would have reported an error. If it is, call hmap_load_header_map
+ and set up the 'construct' field of the cpp_dir. Otherwise, report
+ the error as usual.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3951689
+ * c-common.h (objc_finish_try_stmt, objc_build_synchronized):
+ Return 'tree' instead of 'void'.
+ * stub-objc.c (objc_build_throw_stmt, objc_begin_try_stmt,
+ objc_finish_try_stmt, objc_begin_catch_clause,
+ objc_finish_catch_clause, objc_build_finally_clause,
+ objc_build_synchronized: New stubs.
+
+2005-01-15 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.c (macosx_version_min_required): Make static.
+
+2005-01-14 Dale Johannesen <dalej@apple.com>
+
+ Radar 3953308
+ * tree-ssa-dce.c: Remove all vestiges of LNO branch.
+ * tree-flow.h (tree_ssa_dce_no_cfg_changes): Remove declaration.
+
+2005-01-13 Stuart Hastings <stuart@apple.com>
+
+ Radar 3236762
+ * gcc/config/i386/darwin.h (SUBTARGET_EXTRA_SPECS): Revert Mach-O arch back to i386,
+ regardless of -force_cpusubtype_ALL.
+
+2005-01-11 Stuart Hastings <stuart@apple.com>
+
+ Radar 3943021
+ * gcc/config/rs6000/rs6000.md (maxsf3, minsf3, split, maxdf3, mindf3, split):
+ disable when -flag-trapping-math.
+ * gcc/config/rs6000/rs6000.c (rs6000_emit_minmax): Don't abort
+ when #pragma fenv (-ftrapping-math) causes failure.
+
+2005-01-11 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3903960
+ * fold-const.c (fold_widened_comparison) Replace it with the
+ one from FSF mainline.
+ (fold_sign_changed_comparison): Ditto.
+ (fold): Remove APPLE LOCAL lno marker.
+
+2005-01-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3943452
+ * config/rs6000/rs6000.c (altivec_convert_args): Clear any oveflows
+ caused by integer literal conversions.
+
+2005-01-09 Mike Stump <mrs@apple.com>
+
+ Radar 3926955
+ * c-opts.c (c_common_handle_option): Remove wrong -faltivec code.
+ * c.opt (faltivec): Remove wrong set 0.
+ config/rs6000/rs6000.c (rs6000_altivec_switch): Move -maltivec back
+ into TARGET_SWITCHES.
+ (rs6000_override_options): Likewise.
+ * config/rs6000/rs6000.h (TARGET_SWITCHES): Likewise.
+ (TARGET_OPTIONS): Likewise.
+ (rs6000_altivec_switch): Likewise.
+
+2005-01-10 Stuart Hastings <stuart@apple.com>
+
+ Radar 3236762
+ * gcc/config/i386/darwin.h (SUBTARGET_EXTRA_SPECS): Revert Mach-O arch back to i386.
+
+2005-01-09 Dale Johannesen <dalej@apple.com>
+
+ Radar 3941146
+ Following patches from mainline:
+ 2004-10-27 Daniel Berlin <dberlin@dberlin.org>
+
+ Fix PR tree-optimization/17133
+
+ * tree-cfg.c (rewrite_to_new_ssa_names_bb): Also rewrite must
+ def kill operand.
+
+ * tree-flow-inline.h: V_MUST_DEF_OP became V_MUST_DEF_RESULT.
+ (get_v_must_def_result_ptr): Modify for new structure of
+ v_must_defs array.
+ (get_v_must_def_kill_ptr): New.
+ (op_iter_next_use): Add support for the kill that occurs in V_MUST_DEFs.
+ (op_iter_next_tree): Ditto. Also V_MAY_DEF_OP became V_MAY_DEF_RESULT.
+ (op_iter_next_def): V_MAY_DEF_OP became V_MAY_DEF_RESULT.
+ (op_iter_init): Initialize new mustu members.
+ (op_iter_next_mustdef): New function.
+ (op_iter_init_mustdef): Ditto.
+
+ * tree-flow.h (rewrite_def_def_chains): New function.
+
+ * tree-into-ssa.c (mark_def_sites): Handle mustdefkill operands.
+ (ssa_mark_def_sites): Ditto.
+ (rewrite_stmt): Ditto.
+ (ssa_rewrite_stmt): Ditto.
+ (rewrite_blocks): Factor out from rewrite_into_ssa.
+ (mark_def_block_sites): Ditto.
+ (rewrite_def_def_chains): New function, just rewrites def-def
+ chains without phi node insertion.
+
+ * tree-pass.h (TODO_fix_def_def_chains): New todo flag.
+
+ * tree-optimize.c (execute_todo): Handle TODO_fix_def_def_chains.
+
+ * tree-pretty-print.c (dump_vops): Print out MUST_DEF's so that
+ they include the rhs now.
+
+ * tree-ssa-ccp.c (visit_assignment): V_MUST_DEF_OP became
+ V_MUST_DEF_RESULT.
+
+ * tree-ssa-dce.c (mark_operand_necessary): Add phionly argument.
+ Update callers.
+ (mark_really_necessary_kill_operand_phis): New function.
+ (perform_tree_ssa_dce): Call it.
+ (pass_dce): Add TODO_fix_def_def_chains.
+ (pass_cd_dce): Ditto.
+
+ * tree-ssa-loop-im.c (determine_max_movement): Look at kills as
+ well.
+ (rewrite_mem_refs): Ditto.
+
+ * tree-ssa-loop-manip.c (find_uses_to_rename_stmt): Look at kills
+ as well.
+
+ * tree-ssa-operands.c (allocate_v_may_def_optype):
+ v_may_def_operand_type_t became v_def_use_operand_type_t.
+ (allocate_v_must_def_optype) Ditto.
+ (finalize_ssa_v_must_defs): Update for new operand type, as well
+ as setting the use portion as well.
+ (copy_virtual_operands): Copy the kill operand as well.
+ (create_ssa_artficial_load_stmt): V_MUST_DEF_OP became
+ V_MUST_DEF_RESULT.
+
+ * tree-ssa-operands.h (v_may_def_operand_type): Renamed to
+ v_def_use_operand_type.
+ (v_must_def_optype_d): Use v_def_use_operand_type.
+ (V_MUST_DEF_OP_*): Renamed to V_MUST_DEF_RESULT_*
+ (V_MUST_DEF_KILL_*): New macros.
+ (struct ssa_operand_iterator_d): Add num_v_mustu and v_mustu_i
+ members.
+ Rename existing must_i and num_v_must members to mustd_i and
+ num_v_mustd.
+ (SSA_OP_VMUSTDEFKILL): New flag.
+ (SSA_OP_VIRTUAL_KILLS): New flag.
+ (SSA_OP_ALL_OPERANDS): Add in SSA_OP_ALL_KILLS.
+ (SSA_OP_ALL_KILLS): New flag.
+ (FOR_EACH_SSA_MUSTDEF_OPERAND): New macro.
+
+ * tree-ssa.c (verify_ssa): Verify virtual kills as well.
+
+ * tree-vectorizer.c (vect_create_data_ref_ptr): V_MUST_DEF_OP
+ became V_MUST_DEF_RESULT.
+ (rename_variables_in_bb): Rename kill pointer as well.
+
+ * tree-dfa.c (compute_immediate_uses_for_stmt): Add kills into the
+ immediate uses.
+
+ 2004-10-28 Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-into-ssa.c (rewrite_virtual_phi_arguments): New function.
+ (rewrite_blocks): Modify argument, and use it to decide which
+ function to call.
+ (rewrite_def_def_chains): Call rewrite_blocks with true here.
+ (rewrite_into_ssa): and call it with false here.
+
+ 2004-11-16 Daniel Berlin <dberlin@dberlin.org>
+
+ Fix PR tree-optimization/18519
+
+ * tree-optimize (execute_todo): Add case for TODO_cleanup_cfg.
+ * tree-pass.h: Add TODO_cleanup_cfg.
+ * tree-ssa-ccp.c (pass_ccp): Use TODO_cleanup_cfg.
+ (ccp_finalize): Remove call to cleanup_cfg.
+ * tree-ssa-dce.c (pass_dce): Use TODO_cleanup_cfg and TODO_dump_func.
+ (pass_cd_dce): Ditto.
+ (perform_tree_ssa_dce): Remove call to cleanup_cfg,
+ dump_function_to_file.
+ * tree-ssa-loop-ch.c (copy_loop_headers): Remove call
+ to cleanup_cfg.
+ (pass_ch): Add TODO_cleanup_cfg.
+ * tree-ssa-loop.c (tree_ssa_loop_done): Remove call to
+ cleanup_cfg.
+ (pass_loop_done): Add TODO_cleanup_cfg.
+ * tree-ssa-phiopt.c (pass_phiopt): Ditto.
+ (tree_ssa_phiopt): Remove call to cleanup_cfg.
+
+2005-01-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3913725
+ * c-common.c (flag_lvalue_cast_assign): New global variable.
+ * c-common.h (flag_lvalue_cast_assign): Forward declare.
+ * c-opts.c (c_common_handle_option): Handle
+ '-f[no-]lvalue-cast-assign'.
+ * c-typeck.c (lvalue_or_else): If expression is not an lvalue,
+ check if it is a cast of an lvalue; if so, and if the cast
+ involves POD types with identical size and aligment,
+ rewrite '(type)expr' into '*(type *)&expr' and allow the
+ result as an lvalue.
+ * c.opt (flvalue-cast-assign): New flag.
+ * invoke.texi: Document '-f[no-]lvalue-cast assign' flag.
+
+2005-01-07 Devang Patel <dpatel@apple.com>
+
+ Radar 3943502
+ * stub-objc.c (objc_get_class_ivars): New.
+
+2005-01-06 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3926755
+ * c-decl.c (builtin_function): Do not require AltiVec
+ builtins to be explicitly declared.
+ * config/rs6000/rs6000.c (altivec_cov_rt_1h): New function.
+ (pim_flags): Add pim_rt_1h enumeration constant; renumber
+ all pim_rt_... constants.
+ (rs6000_fold_builtin): Select overload candidate before
+ determining return type; call altivec_cov_rt_1h() during
+ latter.
+ (altivec_init_builtins): Create builtins corresponding
+ to "specific operations" listed in AltiVec PIM; fix
+ entry for "vec_re" to return a 'vector float'; fix
+ entries for "vec_pack" to compute return vector type
+ as having twice as many elements as the first argument.
+ * config/rs6000/rs6000.h (rs6000_builtins): Add enumeration
+ constants corresponding to AltiVec PIM "specific operations".
+
+2005-01-06 Stan Shebs <shebs@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Don't skip
+ saving r31 if we must do a full stack frame.
+ (rs6000_emit_epilogue): Similarly for restoring r31.
+
+2005-01-06 Andrew Pinski <pinskia@physics.uc.edu>
+ Stuart Hastings <stuart@apple.com>
+
+ Radar 3830232
+ * gcc/testsuite/gcc.apple/notailcall-1.c: New testcase.
+
+2005-01-06 Stuart Hastings <stuart@apple.com>
+
+ Radar 3941684
+ * gcc/c-common.c (print_cw_asm_operand): Casts for long long format.
+ * gcc/gcc.c (process_command): Malloc overflowing static char array.
+ * gcc/config/i386/dariwn.h (ASM_SPEC): Revert to i386.
+ * gcc/config/i386/i386.h (STACK_BOUNDARY): Must be of indeterminate signedness.
+
+2005-01-06 Mike Stump <mrs@apple.com>
+
+ Radar 3929334
+ * c-pch.c (c_common_pch_pragma): Add indirection for pch files for distcc.
+
+2005-01-04 Devang Patel <dpatel@apple.com>
+
+ Radar 3886137 Part 2.
+ * cppdefault.c (INCLUDE_DEFAULTS): Enable isysroot override by default
+ for all include paths.
+
+2005-01-03 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3936917
+ * config/rs6000/altivec.md (altivec_vandc): Correct RTL
+ pattern and use its canonical form.
+
+2005-01-03 Stuart Hastings <stuart@apple.com>
+
+ Radar 3830232, Bugzilla 17526
+ * tree-gimple.c (is_gimple_mem_rhs): Force a temp for every
+ register-candidate to prevent bad tailcalls.
+
+2004-12-23 Dale Johannesen <dalej@apple.com>
+
+ * config/darwin-c.c: Include options.h.
+ (darwin_pragma_fenv): New.
+ * config/darwin-protos.h: Declare it.
+ * config/darwin.h (DARWIN_REGISTER_TARGET_PRAGMAS): Register it.
+ * config/t-darwin: Add new dependency.
+ * config/rs6000/rs6000.c (optimization_options):
+ Default trapping-math off.
+ * config/i386/i386.c (optimization_options): Ditto.
+ * fixincludes/inclhack.def: Add #pragma GCC fenv to <fenv.h>.
+ * fixincludes/fixincl.x: Regenerate.
+ * testsuite/gcc.apple/apple-altivec-9.c: Add -ftrapping-math.
+ * testsuite/gcc.apple/darwin-fsel-3.c: New.
+
+2004-12-23 Dale Johannesen <dalej@apple.com>
+
+ Radar 3926600
+ Following patches brought in from mainline
+ * tree.c (iterative_hash_expr): Canonicalize builtins.
+ PR tree-opt/16951
+ * tree-inline.c (setup_one_parameter): Don't directly map a
+ parameter to the address of another variable of the same
+ function.
+
+2004-12-22 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3765572
+ * expr.c (emit_push_insn): Remove unnecessary apple
+ local stuff which previously handled partial
+ arguments in mixed mode.
+
+2004-12-20 Dale Johannesen <dalej@apple.com>
+
+ Radar 3926484
+ * objc/objc-act.c (objc_get_callee_fndecl): New.
+ * objc/objc-act.h: Declare it.
+ * objc/objc-lang.c: Use it.
+ * objcp/objcp-lang.c: Ditto.
+
+2004-12-20 Matt Austern <austern@apple.com>
+
+ Radar 3845716
+ PR c++/19044
+ * c-common.c (set_builtin_user_assembler_name): New.
+ * c-common.h (set_builtin_user_assembler_name): Declare.
+ * c-decl.c (finish_decl): Use set_builtin_user_assembler_name
+
+2004-12-20 Dale Johannesen <dalej@apple.com>
+
+ Radar 3926488
+ * tree-ssa-loop-ivopts.c (contains_abnormal_ssa_name_p): Don't
+ reference operand 1 of ADDR_EXPRs.
+
+2004-12-20 Devang Patel <dpatel@apple.com>
+
+ Backport vectorizatin patches from Mainline.
+ Radar 3907012 3917979 3917991 3917994 3917999
+
+ PR tree-optimization/18009
+ 2004-11-03 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.h (enum dr_alignment_support): New type.
+ (MAX_NUMBER_OF_UNALIGNED_DATA_REFS): Removed.
+ (LOOP_UNALIGNED_DR): replaced with LOOP_VINFO_UNALIGNED_DR and holds a
+ single data_reference (instead of a varray of references).
+ * tree-vectorizer.c (new_loop_vec_info): Likewise.
+ (vect_gen_niters_for_prolog_loop): Likewise.
+ (vect_update_inits_of_drs): Likewise.
+
+ (vect_update_inits_of_drs): Setting of DR_MISALIGNMENT moved to
+ vect_enhance_data_refs_alignment.
+ (vect_do_peeling_for_alignment): Likewise.
+ (vect_enhance_data_refs_alignment): Decide if and by how much to peel;
+ this functionality used to be in vect_analyze_data_refs_alignment.
+ Also update DR_MISALIGNMENT due to peeling; this functionality used to
+ be in vect_update_inits_of_drs and vect_do_peeling_for_alignment).
+ (vect_analyze_data_refs_alignment): Decision on whether and by how much
+ to peel moved to vect_enhance_data_refs_alignment. Call
+ vect_supportable_dr_alignment.
+
+ (vect_compute_data_ref_alignment): Set STMT_VINFO_VECTYPE.
+ (vect_compute_data_refs_alignment): Return bool. Consider return value
+ of vect_compute_data_ref_alignment and return true/false accordingly.
+ (vect_enhance_data_refs_alignment): Consider return value of
+ vect_compute_data_refs_alignment and return true/false accordingly.
+
+ (vect_supportable_dr_alignment): New function.
+ (vectorizable_store): Call vect_supportable_dr_alignment.
+ (vectorizable_load): Call vect_supportable_dr_alignment. Alignment
+ support checks moved from here to vect_supportable_dr_alignment.
+
+ (vect_transform_loop): Avoid 80 columns overflow.
+
+ 2004-11-11 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (update_phi_nodes_for_guard): Call reverse_phis.
+ (vect_update_ivs_after_vectorizer): Update function documentation.
+ Avoid quadratic behavior and direct write to PHI_ARG_DEF.
+
+ 2004-11-14 Dorit Naishlos <dorit@il.ibm.com>
+ Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/18425
+ * tree-vectorize.c (vect_build_loop_niters): Do not insert
+ NULL into the instruction stream. Initialize new_bb to NULL.
+ (vect_update_ivs_after_vectorizer): Likewise.
+ (vect_gen_niters_for_prolog_loop): Likewise.
+
+ PR tree-opt/18400
+ * tree-vectorizer.c (make_loop_iterate_ntimes): Set loop->nb_iterations.
+ (vect_transform_loop_bound): Set loop->nb_iterations.
+
+ 2004-11-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ PR tree-opt/18400
+ * gcc.dg/vect/pr18400.c: New test.
+
+ 2004-11-14 Dorit Naishlos <dorit@il.ibm.com>
+ Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/18425
+ * gcc.dg/vect/pr18425.c: New test.
+
+ 2004-11-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/vect/vect-78.c: Now vectorized on powerpc*.
+
+ 2004-11-19 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (slpeel_tree_peel_loop_to_edge): New name for
+ function previously called tree_duplicate_loop_to_edge.
+ (slpeel_tree_duplicate_loop_to_edge_cfg): New name for function
+ previously called tree_duplicate_loop_to_edge_cfg.
+ (slpeel_update_phis_for_duplicate_loop): Prefix 'slpeel' added to
+ function name.
+ (slpeel_update_phi_nodes_for_guard): Likewise.
+ (slpeel_make_loop_iterate_ntimes): Likewise.
+ (slpeel_add_loop_guard): Likewise.
+ (allocate_new_names, free_new_names): Function declaration moved to top
+ of file.
+ (rename_use_op, rename_def_op): Likewise.
+ (rename_variables_in_bb, rename_variables_in_loop): Likewise.
+ (vect_generate_tmps_on_preheader): Function declaration moved.
+ (vect_transform_for_unknown_loop_bound): Added missing function
+ declaration.
+
+ 2004-11-19 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (slpeel_can_duplicate_loop_p): New name for function
+ previously called verify_loop_for_duplication. All conditions compacted
+ into one compound condition. Removed debug dumps.
+ (vect_analyze_loop_with_symbolic_num_of_iters): Removed. Some of the
+ functionality moved to vect_can_advance_ivs_p, and some to
+ vect_analyze_loop_form.
+ (vect_can_advance_ivs_p): New function. Contains functionality that was
+ taken out of vect_analyze_loop_with_symbolic_num_of_iters.
+ (slpeel_tree_peel_loop_to_edge): Call slpeel_can_duplicate_loop_p.
+ (vect_analyze_operations): Call vect_can_advance_ivs_p and
+ slpeel_can_duplicate_loop_p.
+ (vect_get_loop_niters): Added documentation.
+ (vect_analyze_loop_form): Check the loop entry always - not only in case
+ of unknown loop bound. Create preheader and exit bb if necessary. Apply
+ a check that used to take place in
+ vect_analyze_loop_with_symbolic_num_of_iters.
+ (vectorize_loops): Call verify_loop_closed_ssa under ENABLE_CHECKING.
+ Remove redundant call to rewrite_into_loop_closed_ssa.
+ (vect_compute_data_refs_alignment): Removed obsolete comment.
+
+
+ 2004-11-19 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Last two
+ arguments removed.
+ (slpeel_tree_peel_loop_to_edge): Call slpeel_make_loop_iterate_ntimes
+ without last two arguments. Update single_exit of loops.
+ (vect_update_niters_after_peeling): Removed. Its functionality was
+ moved to vect_do_peeling_for_alignment.
+ (vect_do_peeling_for_loop_bound): New name for function previously
+ called vect_transform_for_unknown_loop_bound.
+ (vect_transform_loop_bound): Call slpeel_make_loop_iterate_ntimes
+ instead of code that duplicates the same functionality.
+ (vect_do_peeling_for_alignment): Functionality of
+ vect_update_niters_after_peeling moved here.
+ (vect_transform_loop): Unify call to vect_do_peeling_for_loop_bound -
+ previously named vect_transform_for_unknown_loop_bound - for both known
+ and unknown loop bound cases.
+
+ 2004-11-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * tree-vectorizer.c (slpeel_verify_cfg_after_peeling): Define only
+ if checking is enabled.
+
+ 2004-11-22 Dorit Naishlos <dorit@il.ibm.com>
+
+ PR tree-opt/18544
+ * tree-vectorizer.c (vect_analyze_data_refs): Fail if memtag not found.
+
+ 2004-11-22 Dorit Naishlos <dorit@il.ibm.com>
+
+ PR tree-opt/18536
+ * tree-vectorizer.c (make_loop_iterate_ntimes): Use type of niters when
+ creating iv instead of integer_type.
+ (vect_build_loop_niters): Remove redundant code.
+ (vect_transform_loop_bound): Removed (duplicates functionality of
+ make_loop_iterate_ntimes.
+ (vect_gen_niters_for_prolog_loop): Add documentation. Call
+ lang_hooks.types.type_for_size to create a type of the required size.
+ Use that type instead of integer_type. Remove redundant code.
+ (vect_update_niters_after_peeling): Use type of niters instead of
+ integer_type.
+ (vect_transform_loop): Unify handling of known and unknown loop bound
+ cases. Call make_loop_iterate_ntimes instead of
+ vect_transform_loop_bound.
+
+ 2004-11-23 Dorit Naishlos <dorit@il.ibm.com>
+
+ PR tree-opt/18403
+ PR tree-opt/18505
+ * tree-vectorizer.c (vect_create_data_ref_ptr): Use
+ lang_hooks.types.type_for_size instead of integer_type_node for the
+ type of ptr_update.
+
+ 2004-11-23 Dorit Naishlos <dorit@il.ibm.com>
+ * tree-vectorizer.c (vect_analyze_operations): Don't vectorize if
+ the vectorization factor is greater than the iteration count.
+ (vect_gen_niters_for_prolog_loop): No need to calculate min if the
+ iteration count is known.
+
+ (vect_build_symbol_bound): Removed. Its functionality moved to
+ vect_generate_tmps_on_preheader.
+ (vect_generate_tmps_on_preheader): Moved content of
+ vect_build_symbol_bound here instead of calling it. Changed some
+ variables names.
+
+ (vect_build_loop_niters): We don't expect a new_bb to be generated -
+ use gcc_assert.
+ (vect_gen_niters_for_prolog_loop): Likewise.
+ (vect_gen_niters_for_prolog_loo): Likewise.
+
+ (slpeel_make_loop_iterate_ntimes): Use buildN instead of build.
+ (slpeel_add_loop_guard): Likewise.
+ (slpeel_tree_peel_loop_to_edge): Likewise.
+ (vect_do_peeling_for_alignment): Likewise.
+
+ (vect_get_first_index): Missing space.
+
+ 2004-11-30 Dorit Naishlos <dorit@il.ibm.com>
+ PR tree-opt/18173
+
+ * tree-vectorizer.c (vect_can_force_dr_alignment_p): Return false for
+ decls that are assembled before vectorization takes place.
+ (vect_compute_data_ref_alignment): Set DECL_USER_ALIGN to 1.
+
+ 2004-11-30 Dorit Naishlos <dorit@il.ibm.com>
+ * tree-vectorizer.c (vect_gen_niters_for_prolog_loop): Use
+ tree_low_cst instead of TREE_INT_CST_LOW.
+
+ 2004-11-30 Ira Rosen <irar@il.ibm.com>
+
+ PR tree-opt/18607
+ * tree-vectorizer.c (vect_analyze_data_refs): Use temporary
+ variable for data_reference when looking for memtag.
+
+ 2004-12-02 Dorit Naishlos <dorit@il.ibm.com>
+
+ PR tree-opt/18716
+ * tree-vectorizer.c (slpeel_make_loop_iterate_ntimes): Properly set
+ then and else labels.
+
+2004-12-17 Mike Stump <mrs@apple.com>
+
+ Radar 3549855
+ * c-lex.c (c_lex_with_flags): Always do BOL processing for CW
+ asms.
+
+2004-12-17 Dale Johannesen <dalej@apple.com>
+
+ Radar 3851659
+ * c-decl.c (disagnose_mismatched_decls): Fix from mainline.
+
+2004-12-17 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3914905
+ * c-typeck.c (digest_init): Handle case of vector literal
+ initializer initializing a const variable.
+ * convert.c (build_compound_literal_vector): New routine to generate a
+ COMPOUND_LITERAL_EXPR expression for a vector constant.
+ (convert_to_vector); call build_compound_literal_vector.
+
+2004-12-16 Stuart Hastings <stuart@apple.com>
+
+ Radar 3910248, 3915171
+ * gcc/config/rs6000/rs6000.c (output_call): correctly skip
+ non-line-number notes.
+
+2004-12-16 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3921172
+ * dbxout.c (dbxout_finish): Switch to .text section before
+ emitting final SO STABS record.
+
+2004-12-15 Dale Johannesen <dalej@apple.com>
+
+ Radar 3619824
+ * config/rs6000/rs6000.c (optimization_options): Clear
+ flag_errno_math.
+ * doc/invoke.texi: Document that -fno-math-errno is the default.
+
+2004-12-15 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3918376
+ * config/rs6000/rs6000.c (altivec_ovl_resolve): When matching
+ 4-element vectors, allow V4SF in addition to V4SI modes.
+ (rs6000_fold_builtin): If invalid arguments are provided, use
+ the return type for the first overload candidate, if available.
+
+2004-12-15 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3913672
+ * config/rs6000/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE): For
+ '-faltivec', pass in '-pim-altivec' instead of '-maltivec
+ -maltivec-pim'.
+ * config/rs6000/rs6000.c (rs6000_altivec_switch): New.
+ (rs6000_override_options): Handle '-m(no)altivec' explicitly
+ (rather than via TARGET_SWITCHES); for '-maltivec' and
+ '-mcpu=xxx' (where xxx supports AltiVec), clear the
+ flag_disable_opts_for_faltivec flag, move handling of
+ '-m(no-)pim-altivec' (formerly '-m(no-)altivec-pim')
+ before handling of -maltivec and -mcpu, and have it
+ set MASK_ALTIVEC and flag_disable_opts_for_faltivec.
+ * config/rs6000/rs6000.h (TARGET_SWITCHES): Move
+ '-m(no-)altivec' to TARGET_OPTIONS.
+ (TARGET_OPTIONS): Rename '-m(no-)altivec-pim' to
+ '-m(no-)pim-altivec'; add in '-m(no-)altivec'.
+ (rs6000_altivec_switch): New forward declaration.
+ * doc/invoke.texi: Rename '-m(no-)altivec-pim' to
+ '-m(no-)pim-altivec'; move description of disabled
+ optimizations from '-faltivec' to '-mpim-altivec'.
+
+2004-12-14 Stuart Hastings <stuart@apple.com>
+
+ Radar 3910248
+ * gcc/config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): ignore
+ -mlongcall when -m64 in use.
+
+2004-12-14 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3889727
+ brought in fix for PR target/18641 from FSF
+ below.
+
+2004-12-11 David Edelsohn <edelsohn@gnu.org>
+ Ulrich Weigand <uweigand@de.ibm.com>
+
+ PR target/18641
+ * config/rs6000/darwin.h (PREFERRED_RELOAD_CLASS): Reload all
+ constants into all register classes intersecting with FLOAT_REGS
+ via memory.
+ * config/rs6000/rs6000.h (PREFERRED_RELOAD_CLASS): Same.
+ * config/rs6000/rs6000.md (movdi_internal32): Ignore FPRs when
+ choosing register preferences.
+ (movdi_internal64): Same.
+
+2004-12-13 Mike Stump <mrs@apple.com>
+
+ Radar 3865314
+ * c-common.c (convert_and_check): Add support for -Wshorten-64-to-32.
+ * c.opt (Wshorten-64-to-32): Likewise.
+ * doc/invoke.texi (Warning Options): Likewise.
+ * Makefile.in (c-common.o): Added dependancy for options.h.
+
+2004-12-10 Devang Patel <dpatel@apple.com>
+
+ Radar 3572046 (related)
+ * tree-ssa-forwprop.c (cast_conversion_assignment_p): New.
+ (replace_use_in_cond_expr): New.
+ (all_uses_are_replacable): New.
+ (eliminate_unnecessary_casts): New.
+ (tree_ssa_forward_propagate_single_use_var): Eliminate unnecessary
+ casts.
+
+2004-12-10 Devang Patel <dpatel@apple.com>
+
+ Radar 3572046 (last patch)
+ * config/rs6000/rs6000.c (rs6000_emit_vector_select): Adjust
+ vector select insn parameters.
+
+
+2004-12-10 Devang Patel <dpatel@apple.com>
+
+ Radar 3893659
+ * gcc.c (main): Do not break out of loop when error is reported while
+ processing one source file.
+
+2004-12-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3640156, 3877958
+ * config/rs6000/altivec.h: Skip contents of file
+ #ifdef __APPLE_ALTIVEC__, and issue a warning.
+ * config/rs6000/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE): Do not
+ 'include altivec.h' upon seeing '-faltivec'; instead, specify
+ '-maltivec-pim'.
+ * config/rs6000/rs6000-c.c: Include options.h.
+ (rs6000_cpu_cpp_builtins): Define __APPLE_ALTIVEC__ and 'vec_step'
+ macro only if '-maltivec-pim' has been specified.
+ * config/rs6000/rs6000-protos.h (rs6000_fold_builtin): New prototype.
+ * config/rs6000/rs6000.c (altivec_cov_rt_12, altivec_cov_rt_2p,
+ altivec_cov_rt_1d, altivec_ovl_resolve, altivec_convert_args,
+ rs6000_fold_builtin): New functions.
+ (rs6000_altivec_inline_etc, rs6000_altivec_pim,
+ rs6000_altivec_pim_switch): New variables.
+ (rs6000_override_options): Handle '-m(no-)altivec-pim'.
+ (vector_builtin_fns): Decorate with GTY(()) voodoo; do not reserve
+ extra space for AltiVec PIM built-ins (since they won't be stored
+ there.)
+ (TARGET_FOLD_BUILTIN): Point at rs6000_fold_builtin().
+ (enum pim_flags, struct altivec_pim_info): New data types.
+ (altivec_pim_table): New global variable.
+ (def_pim_builtin): New macro.
+ (altivec_init_builtins): If '-maltivec-pim' was specified, define
+ AltiVec PIM operations and predicates as built-ins.
+ (rs6000_handle_altivec_attribute): Add handling for 'element__'
+ argument, which returns the element type of the vector type passed in.
+ * config/rs6000/rs6000.h (enum rs6000_builtins): Append a new range,
+ ALTIVEC_PIM__FIRST... ALTIVEC_PIM__LAST, representing built-in codes
+ for AltiVec PIM operations and predicates.
+ (TARGET_OPTIONS): Add '-m(no-)altivec-pim' option.
+ (rs6000_altivec_inline_etc, rs6000_altivec_pim,
+ rs6000_altivec_pim_switch): Forward-declare.
+ * config/rs6000/t-rs6000 (rs6000-c.o): Depend on options.h.
+ * doc/invoke.texi: Update '-faltivec' description; add description
+ for '-maltivec-pim'.
+
+2004-12-08 Mike Stump <mrs@apple.com>
+
+ Radar 3679243
+ * varasm.c (assemble_variable): Don't use .zerofill for weak
+ symbols as it isn't supported in the assembler. Also, key off
+ !DECL_COMMON directly instead of flag_no_common so that C++ works.
+
+2004-12-08 Devang Patel <dpatel@apple.com>
+
+ Radar 3903799
+ * config/darwin.h (ASM_SPEC): Supply -force_cpusubtype_ALL.
+
+2004-12-07 Dale Johannesen <dalej@apple.com>
+
+ Radar 3888787
+ * doc/invoke.texi (-msoft-float): Rewrite to reflect reality.
+
+2004-12-07 Mike Stump <mrs@apple.com>
+
+ Radar 3603833, 3896176, 3518821.
+ * c-common.c (cw_asm_operands_arg): New.
+ (print_cw_asm_operand): Add support for figuring out if the
+ argument must be a register or a memory reference.
+ (cw_asm_get_register_var): Likewise.
+ (cw_op_constraint): Likewise.
+ (cw_op_comp): Likewise.
+ (cw_constraint_for): Likewise.
+ (cw_process_arg): Likewise.
+ (cw_asm_stmt): Likewise.
+ (print_cw_asm_operand): Likewise.
+ (cw_asm_get_register_var): Likewise.
+ (cw_memory_clobber): Add support for figuring out if the
+ instruction needs a memory clobber.
+ (cw_asm_stmt): Likewise.
+ (print_cw_asm_operand): Add support for static duration variables.
+
+ (cw_get_identifier): New.
+ (cw_ha16, cw_hi16, cw_lo16): New.
+ (get_cw_asm_label): Add support for ha16(x), hi16(x) and lo16(x).
+ * c-common.h (cw_get_identifier): New.
+ * c-parse.in (cw_identifier): Add support for '+', '-' and '.' in
+ C CW opcodes to allow for a less tightly coupled lexer.
+ (single_cw_asm_stmt): Likewise.
+ (cw_asm_operand): Add support for ha16(x)(r).
+
+ * doc/extend.texi (Asm Blocks and Functions): Document memory
+ clobbers and instructions that take a memory operand.
+
+2004-12-06 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3893215
+ Following FSF mainline patch fixes it.
+
+2004-11-11 Zdenek Dvorak <dvorakz@suse.cz>
+
+ PR tree-optimization/17742
+ * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Handle
+ MINUS_EXPR correctly.
+
+2004-12-03 Dale Johannesen <dalej@apple.com>
+
+ Radar 3905019
+ * opts.c (common_handle_option): Fix from mainline.
+
+2004-12-03 Stuart Hastings <stuart@apple.com>
+
+ Radar 3855246
+ * gcc/config/rs6000/rs6000.c (init_cumulative_args): Remove APPLE LOCAL.
+ * gcc/config/rs6000/rs6000.h (target_flags): Remove APPLE LOCAL.
+ (TARGET_OPTIONS): Add -mlong-branch as a synonym for -mlongcall.
+
+2004-12-03 Caroline Tice <ctice@apple.com>
+ Andrew Pinski <pinskia@physics.uc.edu>
+
+ Radar 3469752 (Adding loops-to-memset optimization)
+ * Makefile.in (OBJS-common): Add tree-ssa-loo-memset.o to list
+ (tree-ssa-loop-memset.o): Add rule for making this.
+ * bitmap.h (bitmap_empty_p): New macro.
+ * common.opt (ftree-loop-memset): Add new flag for optimization.
+ * tree-flow.h (tree_ssa_memset): Add function declaration.
+ * tree-optimize.c (init_tree_optimization_passes): Add loops-to-memset
+ pass.
+ * tree-pass.h (pass_memset): Add extern declaration for loops-to-memset
+ pass.
+ * tree-ssa-loop.c (tree_ssa_loop_memset, gate_tree_ssa_loop_memset): New
+ functions.
+ (pass_memset): Define new pass.
+ * tree-ssa-loop-memset.c: New file.
+ * tree-vectorizer.c (vect_is_simple_iv_evolution): Remove static
+ forward declaration; make the function globally visible.
+ (vect_get_loop_niters): Likewise.
+ (vect_analyze_pointer_ref_access): Likewise.
+ * tree-vectorizer.h (vect_is_simple_iv_evolution): Add external function
+ declaration.
+ (vect_get_loop_niters): Likewise.
+ (vect_analyze_pointer_ref_access): Likewise.
+
+2004-12-02 Devang Patel <dpatel@apple.com>
+
+ Radar 3855723 and 3886718
+
+ Backport from Mainline
+ 2004-12-02 Devang Patel <dpatel@apple.com>
+ * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -gfull and -gused.
+ * config/rs6000/darwin.h (CC1_SPEC): Do not handle -gfull and -gused.
+ * config/i386/darwin.h (CC1_SPEC): Same.
+
+2004-12-02 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3893215 - part 1
+ * tree-scalar-evolution.c (follow_ssa_edge_in_condition_phi):
+ Added missing check for unknown evolution_of_loop.
+ (from FSF mainline).
+
+2004-11-30 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3893125
+ * loop.c (loop_giv_reduce_benefit): Remove APPLE LOCAL
+ patch which caused regression in galaxy(VMX) of skidmarks.
+
+2004-11-24 Devang Patel <dpatel@apple.com>
+
+ * gcc.h: APPLE LOCAL marker cleanup.
+
+2004-11-24 Devang Patel <dpatel@apple.com>
+
+ Radar 3876218
+ * gcc.c (process_command): Supply -v to linker.
+
+2004-11-23 Stan Shebs <shebs@apple.com>
+
+ * config.gcc (powerpc-*-darwin*): Remove bringup conditional.
+ * mklibgcc.in: Don't try to make dylibs from static/kext
+ libgcc.
+ * config/t-slibgcc-darwin: Don't use SHLIB_MULTILIB.
+
+2004-11-23 Devang Patel <dpatel@apple.com>
+
+ Radar 3886137
+ * gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add isysroot.
+ * config/darwin-c.c (darwin_register_frameworks): Use sysroot.
+
+2004-11-22 Devang Patel <dpatel@apple.com>
+
+ Radar 3846092
+ * doc/invoke.text: Remove outdated docs for -fscalar-evolutions and
+ -fall-data-deps. Document not disabling of -fstrict-aliasing, when
+ auto vectorization is used, in Apple GCC compiler.
+ * opts.c (decode_options): Disable -fstrict-aliasing only if -ftree-vectorize
+ is not used.
+
+2004-11-22 Dale Johannesen <dalej@apple.com>
+
+ * config/darwin.h (JUMP_TABLES_IN_TEXT_SECTION): Conditionalize
+ properly and comment.
+
+2004-11-21 Dale Johannesen <dalej@apple.com>
+
+ * config/darwin.h (JUMP_TABLES_IN_TEXT_SECTION): Define.
+ (TARGET_TERMINATE_DW2_EH_FRAME_INFO): Remove dup definition.
+
+2004-11-18 Dale Johannese <dalej@apple.com>
+
+ * lambda-code.c: cosmetic changes to match mainline.
+
+2004-11-17 Stuart Hastings <stuart@apple.com>
+
+ Radar 3837835
+ * cgraph.c: add "#include <function.h>".
+ (dump_cgraph_node) Add uses_vector bit to dump.
+ * cgraphunit.c:(altivec_infection, fndecl_uses_vector_p) New.
+ (record_call_1) Set uses_vector.
+ (cgraph_create_edges) Set uses_vector.
+ (cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
+ cgraph_decide_inlining_incrementally) Check for altivec_infection.
+ * gcc/testsuite/lib/scantree.exp (diff-tree-dumps):
+ Expand globbing of 't??' dumpfile names to include 'ipa'.
+
+2004-11-16 Devang Patel <dpatel@apple.com>
+
+ Merge stuff from autovect-branch.
+
+ 2004-11-12 Devang Patel <dpatel@apple.com>
+
+ * optabs.c (vector_compare_rtx): Use COMPARISON_CLASS_P.
+
+ 2004-11-12 Devang Patel <dpatel@apple.com>
+
+ Backport from Mainline.
+
+ 2004-11-12 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-data-ref.c (analyze_subscript_affine_affine): Correctly
+ compute the first overlapping iterations.
+
+ 2004-11-12 Devang Patel <dpatel@apple.com>
+
+ * tree-data-ref.c (compute_subscript_distance): Make externally visible.
+ (build_class_dist_vector): Same.
+ * tree-data-ref.h (compute_subscript_distance): New external decl.
+ (build_class_dist_vector): Same.
+ * tree-vectorizer.c (loops_num): New variable.
+ (vect_build_dist_vector): New function.
+ (vect_analyze_data_ref_dependence): Use distance vector to determine
+ dependence.
+ (vect_analyze_data_ref_dependences): Remove local variable loop.
+ (vect_analyze_loop): Analyze operations before data dependences
+ (vectorize_loops): Remove local variable loops_num.
+
+ 2004-11-12 Devang Patel <dpatel@apple.com>
+
+ * tree-vectorizer.c (vectorizable_select): New function.
+ (vect_is_simple_cond): New function.
+ (vect_analyze_operations): Handle conditional expr.
+ * tree-vectorizer.h (stmt_vec_info_type): New member, select_vec_info_type.
+
+2004-11-16 Dale Johannesen <dalej@apple.com>
+
+ * tree-ssa.c (flush_pending_stmts): New.
+
+2004-11-16 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_override_options):
+ Put -ftree-loop-linear into -fast.
+
+2004-11-16 Dale Johannesen <dalej@apple.com>
+
+ * lambda-code.c: Make identical to mainline as of
+ Nov 11, plus Dan Berlin's patch for swim.
+ * tree-loop-linear.c: Make identical to mainline.
+ * tree-data-ref.c: Make identical to mainline as
+ of Nov 11.
+ * tree-optimize.c (init_tree_optimization_passes):
+ Make order of passes same as mainline.
+ * tree-ssa-loop-ivopts.c (try_add_cand_for): Roll in
+ Zdenek's patch for important candidates.
+
+2004-11-16 Dale Johannesen <dalej@apple.com>
+
+ * fold-const.c (try_move_mult_to_index): New.
+ (fold): Use it (2 places).
+
+2004-11-16 Dale Johannesen <dalej@apple.com>
+
+ * tree.c (build_low_bits_mask): New.
+ tree.h: Declare it.
+ tree-ssa-loop-niter.c (number_of_iterations_cond): Use it.
+
+2004-11-16 Devang Patel <dpatel@apple.com>
+
+ Related to Radar 3837835.
+ * tree-cfg.c (ivu_gate, fndecl_uses_vector_p, identify_vector_use,
+ pass_identify_vector_use): Remove.
+ * tree-optimzie.c (init_tree_optimization_passes): Remove pass_identify_vector_use.
+ * tree-pass.h (pass_identify_vector_use): Remove extern decl.
+
+2004-11-16 Caroline Tice <ctice@apple.com>
+
+ * varasm.c (assemble_start_function): Don't print out section label
+ when aligning cold section.
+
+2004-11-16 Dale Johannesen <dalej@apple.com>
+
+ * dbxout.c (dbxout_source_file): Restore local patch
+ for hot/cold partitioning.
+
+2004-11-16 Dale Johannesen <dalej@apple.com>
+
+ * calls.c (expand_call): Fix ICE building crafty.
+
+2004-11-15 Dale Johannesen <dalej@apple.com>
+
+ * profile.c (compute_branch_probabilities): Roll in fix from mainline.
+
+2004-11-15 Dale Johannesen <dalej@apple.com>
+
+ * tree-flow.h (stmt_bsi): Remove.
+ (basic_block bsi_insert_on_edge_immediate): Remove duplicate decl.
+ (tree_block_label): Remove name in prototype.
+ (add_referenced_tmp_var): Ditto.
+ (TDFA_USE_OPS): Parenthesize.
+ (TDFA_USE_VOPS): Parenthesize.
+ (flush_pending_stmts): New.
+ (tree_duplicate_loop_to_exit): Remove.
+ (update_lv_condition): Ditto.
+ (estimate_loop_size): Ditto.
+ (insert_edge_copies): Remove name in prototype.
+ (expr_invariant_in_loop_p): Ditto.
+
+2004-11-15 Dale Johannesen <dalej@apple.com>
+
+ * c-decl.c (find_tree_with_code_1): Remove.
+ (find_tree_with_code): Ditto.
+ (find_pointer): Ditto.
+ (struct should_transpose_for_loops_t): Ditto.
+ (should_transpose_for_loops_1): Ditto.
+ (should_transpose_for_loops): Ditto.
+ (tree_contains_1): Ditto.
+ (tree_contains): Ditto.
+ (perform_loop_transpose): Ditto.
+ (loop_transpose): Ditto.
+ (finish_function): Don't call it.
+ * common.opt (-floop-transpose): Remove.
+ * flags.h (flag_loop_transpose): Remove.
+ * opts.c (OPT_floop_transpose): Remove.
+ * toplev.c (flag_loop_transpose): Remove.
+ * config/rs6000/rs6000.c (rs6000_override_options): Don't set it.
+ * doc/invoke.texi (-fast): Remove reference.
+ * testsuite/gcc.apple/loop-transpose-1.c: Remove.
+
+2004-11-15 Matt Austern <austern@apple.com>
+
+ Radar 3878983
+ * ginclude/tgmath.h (fdim) Use __TGMATH_REAL_2 macro.
+ (hypot) Likewise.
+ (remainder) Likewise.
+ (nexttoward) Use proper number of arguments for TGMATH_REAL_1_2.
+
+2004-11-11 Dale Johannesen <dalej@apple.com>
+
+ Radar 3875337
+ * tree-cfg.c (cleanup_control_expr_graph): Remove redundant
+ local patch from LNO.
+ (thread_jumps_from_bb): Remove wrong local patch from LNO;
+ make identical to mainline.
+ (thread_jumps): Make identical to mainline.
+
+2004-11-11 Stuart Hastings <stuart@apple.com>
+
+ * i386.md (*movqi_1): Short-term fix for 3838108.
+
+2004-11-11 Stuart Hastings <stuart@apple.com>
+
+ * tree.c (build_vector): Proper initialization for 'list'
+
+2004-11-10 Fariborz Jahanian <fjahanian@apple.com>
+
+ * c-common.c (vector_constructor_from_expr): Remove replication
+ of missing initializer.
+ * tree.c (build_vector): Replicate missing initializer.
+ * cp/typeck.c (build_c_cast): Move building of vector constant
+ past checking for processing of template declaration.
+
+2004-11-08 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.c: Improve local markers.
+ (process_command): Set __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
+ rather than MAC_OS_X_VERSION_MIN_REQUIRED.
+
+2004-11-08 Devang Patel <dpatel@apple.com>
+
+ Radar 3846514
+ * tree-if-conv.c (clean_predicate_lists): Use loop header and latch
+ directly.
+
+2004-11-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3853429
+ * varasm.c (output_addressed_constants): For CONST_DECLs,
+ output the initializer if present.
+ * config/darwin.c (machopic_select_section): Ensure that
+ constant Objective-C strings and constant CFStrings get emitted
+ into correct sections.
+
+2004-11-05 Devang Patel <dpatel@apple.com>
+
+ Radar 3853509.
+ * cp/parser.c (cp_parser_objc_method_prototype_list): Handle #pragma.
+ (cp_parser_objc_class_interface): Get protocol qualified type.
+
+2004-11-05 Stuart Hastings <stuart@apple.com>
+
+ Radar 3848818
+ * gcc/cfgcleanup.c(merge_memattrs): copied from FSF mainline.
+
+2004-11-04 Dale Johannesen <dalej@apple.com>
+
+ * config/darwin.h (EXTRA_SECTION_FUNCTIONS):
+ Fix text_unlikely_section.
+
+2004-11-04 Dale Johannesen <dalej@apple.com>
+
+ Radar 3759876
+ * config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Enable
+ indirect sibcalls.
+ * config/rs6000/rs6000.md (*sibcall_symbolic): Make them work.
+ (*sibcall_value_symbolic): Ditto.
+
+2004-11-04 Dale Johannesen <dalej@apple.com>
+
+ * opts.c (decode_options): Use mainline-style loop opts.
+
+2004-11-04 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.md (*save_fpregs_with_label_si):
+ Use any_parallel_operand to remove a warning.
+ * config/rs6000/darwin.md (*save_fpregs_with_label_di): Ditto.
+ (*save_vregs_di): Ditto.
+ (*restore_vregs_di): Ditto.
+ (*save_vregs_with_label_di): Ditto.
+
+2004-11-04 Devang Patel <dpatel@apple.com>
+
+ Partial 3837835 fix.
+ * function.h (struct function): New member, uses_vector.
+ * tree-cfg.c (ivu_gate, fndecl_uses_vector_p, identify_vector_use,
+ pass_identify_vector_use): New.
+ * tree-optimzie.c (init_tree_optimization_passes): Add pass_identify_vector_use.
+ * tree-pass.h (pass_identify_vector_use): New extern decl.
+
+2004-11-04 Devang Patel <dpatel@apple.com>
+
+ Back out 3837840 fix.
+ * c-opts.c (c_common_handle_option): Update APPLE LOCAL marker.
+ * flags.h (flag_inline_trees): Remove extern decl.
+ * toplev.c (process_optiosn): Do not disable inlining with -faltivec.
+
+2004-11-03 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3863563 (fix from mainline)
+ * c-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Remove.
+ (c_types_compatible_p): Move function definition...
+ * c-objc-common.c (c_types_compatible_p): ...here.
+ * c-objc-common.h (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from
+ c-lang.c.
+
+2004-11-02 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3857727
+ * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Remove
+ setting of targetm.cast_expr_as_vector_init.
+ * config/rs6000/rs6000.c (rs6000_override_options): Set
+ targetm.cast_expr_as_vector_init.
+
+2004-11-02 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3846637
+ * config/rs6000/rs6000.md: Remove condition for
+ HONOR_SIGNED_ZEROS from fnmsub generation.
+
+2004-11-01 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 2810013 (fix from mainline)
+ * c-common.h (objc_lookup_ivar): Add second parameter to
+ prototype.
+ * c-typeck.c (build_external_ref): After looking up symbol,
+ pass it to objc_lookup_ivar() to decide whether it or the
+ ivar should be used, rather than deciding the issue locally.
+ * stub-objc.c (objc_lookup_ivar): Add an OTHER parameter,
+ which is simply returned in the non-ObjC case.
+
+2004-10-29 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3848842
+ * cp/call.c (build_over_call): Don't change type of
+ the function pointer built by call to build_vfn_ref_using_vtable.
+ * testsuite/g++.dg/kext6.C: New test
+
+2004-10-27 Geoffrey Keating <geoffk@apple.com>
+
+ * c-common.c (handle_weak_import_attribute): Delete.
+ (c_common_attribute_table): Remove 'weak_import'.
+ * c-decl.c (start_function): Remove local change for weak_import.
+ * dbxout.c (dbxout_source_file): Remove local change for
+ hot/cold partitioning, sync with FSF GCC.
+ * dmp-tree.c (print_decl): Remove local change for weak_import.
+ * idebug.c: Remove local change for weak_import.
+ * rtl.h (struct rtx_def): Remove local change for weak_import.
+ (SYMBOL_REF_WEAK_IMPORT): Delete.
+ * tree.h (DECL_WEAK_IMPORT): Delete.
+ (IDENTIFIER_WEAK_IMPORT): Delete.
+ (struct tree_decl): Delete weak_import_flag.
+ (enum attribute_flags): Delete ATTR_FLAG_FUNCTION_DEF.
+ * varasm.c (merge_weak): Remove local change for weak_import.
+ * config/darwin.c (machopic_output_indirection): Remove local change
+ for weak_import.
+ (darwin_set_section_for_var_p): Do nothing if symbol is weak.
+ * config/rs6000/rs6000.c (find_weak_imports): Delete.
+ (rs6000_assemble_integer): Remove local change for weak_import.
+ (local_label_unique_number): Delete.
+ (macho_branch_islands): Remove local change for weak_import.
+
+2004-10-26 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3840704
+ * c-opts.c (c_common_handle_option): Rename flag_altivec to
+ flag_disable_opts_for_faltivec.
+ * c.opt (faltivec): Likewise.
+ * toplev.c (process_options): Likewise, and update comment.
+ * config/rs6000/rs6000.c (expand_block_clear): Handle
+ flag_disable_opts_for_faltivec.
+ (expand_block_move): Likewise.
+
+2004-10-26 Devang Patel <dpatel@apple.com>
+
+ Radar 3233789
+ * dbxout.c (dbxout_init): Remove APPLE LOCAL patch that suppresses
+ SO stab address.
+
+2004-10-26 Devang Patel <dpatel@apple.com>
+
+ Radar 3760592
+
+ Backport from mainline.
+ 2004-10-21 Dndrew Pinksi <pinskia@physics.uc.edu>
+ * c-opts.c (push_command_line_include): Use the current file
+ name instead of the main one.
+
+2004-10-26 Matt Austern <austern@apple.com>
+
+ * ginclude/tgmath.h (fabs): Fix typo (complex abs is cabs, not cfabs)
+
+2004-10-22 Fariborz Jahanian <fjahanian@apple.com>
+
+ * config/rs6000/darwin.md: Remove vecstore/vecload patterns
+ specific to 64-bit Darwin.
+
+2004-10-21 Andrew Pinski <pinskia@physics.uc.edu>
+ Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3845826 (includes PR objc/17923)
+ * tree.c (staticp): A CONST_DECL has static storage if either
+ TREE_STATIC or DECL_EXTERNAL is set.
+ * config/darwin.c (darwin_build_constant_cfstring): Build a global
+ CONST_DECL to hold each constructed CFString.
+ * c-decl.c (pushdecl_top_level): Accept CONST_DECLs which can
+ have null names.
+
+2004-10-21 Fariborz Jahanian <fjahanian@apple.com>
+
+ * c-common.c (vector_constructor_from_expr): In building vector expressions,
+ fold no_expr of nanf into a cst_real expression tree.
+
+2004-10-21 Fariborz Jahanian <fjahanian@apple.com>
+
+ * function.c (assign_parms): Iterate over all non-vector args first,
+ then over vector args.
+
+2004-10-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3540965
+ * c-common.c (flag_objc_call_cxx_cdtors): New variable.
+ * c-common.h (flag_objc_call_cxx_cdtors): New forward declaration.
+ * c-opts.c (c_common_handle_option): Process '-fobjc-call-cxx-cdtors'
+ option.
+ * c.opt (fobjc-call-cxx-cdtors): New option.
+ * doc/invoke.texi (fobjc-call-cxx-cdtors): Document.
+
+2004-10-19 Devang Patel <dpatel@apple.com>
+
+ Radar 3837840
+ * c-opts.c (c_common_handle_option): Update APPLE LOCAL marker.
+ * c.opt (faltivec): Same.
+ * toplev.c (process_options): Same.
+ * config/rs6000/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE):
+ Same.
+
+
+2004-10-19 Devang Patel <dpatel@apple.com>
+
+ Radar 3837840
+ * c-opts.c (c_common_handle_option): Handle OPT_faltivec.
+ * c.opt (faltivec): New option.
+ * toplev.c (process_options): Disable inlining when -faltivec
+ is used.
+ * config/rs6000/darwin.h (SUBTARGET_OPTION_TRANSLATE_TABLE):
+ Supply -faltivec to cc1* also.
+
+2004-10-19 Fariborz Jahanian <fjahanian@apple.com>
+
+ * c-common.c (cw_asm_stmt): Set correct constraint for
+ vector arguments.
+
+2004-10-18 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3832999 (fix from mainline)
+ * c-parse.in (reservedwords): Add OBJC_TYPE_QUAL as alternative.
+
+2004-10-18 Devang Patel <dpatel@apple.com>
+
+ Radar 3753408
+ * Makefile.in (GTFILES): Remove APPLE LOCAL comments.
+ * target-def.h (TARGET_VECTOR_COMPARE_P, TARGET_VECTOR_COMPARE_FOR_P,
+ TARGET_VECTOR_COMPARE_STMT, TARGET_VECTOR_SELECT_P,
+ TARGET_VECTOR_SELECT_FOR_P, TARGET_VECTOR_SELECT_STMT): Remove #defines.
+ (TARGET_VECT): Remove vector select and compare members.
+ * target.h (struct gcc_target): Remove vector select and
+ compare members.
+ * tree-dfa.c (dump_immediate_uses_for): Do not print block number.
+ * tree-gimple.c (is_gimple_stmt): Handle COND_EXPR properly.
+ * tree-ssa-operands.c (add_vdef): Remove.
+ (build_ssa_operands): Remove local patch to handle COND_EXPR inside
+ MODIFY_EXPR case.
+ (get_expr_operands): Same.
+ * tree.c (get_array_base): Remove.
+ * config/rs6000/rs6000.c (rs6000_vector_compare_p,
+ rs6000_vector_compare_for_p, rs6000_vector_compare_stmt,
+ rs6000_vector_select_p, rs6000_vector_select_for_p,
+ rs6000_vector_select_stmt, get_vector_compare_for,
+ get_vector_select_for): Remove.
+ (TARGET_VECTOR_COMPARE_P, TARGET_VECTOR_COMPARE_FOR_P,
+ TARGET_VECTOR_COMPARE_STMT, TARGET_VECTOR_SELECT_FOR_P,
+ TARGET_VECTOR_SELECT_STMT): Remove #defines.
+
+2004-10-16 Dale Johannesen <dalej@apple.com>
+
+ * c-common.c (c_common_get_alias_set): Use GGC for type_hash_table.
+
+2004-10-15 Dale Johannesen <dalej@apple.com>
+
+ * objcp/objcp-lang.c (tree_code_type): Fix merge omission.
+
+2004-10-15 Mike Stump FIXME
+
+ merge
+
+2004-10-15 Stuart Hastings <stuart@apple.com>
+
+ * gcc/simplify-rtx.c(simplify_relational_operation): copied from FSF mainline.
+
+2004-10-15 Stuart Hastings <stuart@apple.com>
+
+ * gcc/c-common.c(print_cw_asm_operand): proper casting.
+ * gcc/expr.c(expand_expr_addr_expr): delete problematic assertions.
+
+2004-10-14 Robert Bowdidge <bowdidge@apple.com>
+
+ * config/darwin-driver.c: Remove off-by-one error in QA_OVERIDE...
+ machinery.
+
+2004-10-15 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3719208
+ * stor-layout.c (update_alignment_for_field): Don't use
+ first-field alignment adjustment for union.
+
+2004-10-13 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3677258
+ * c-decl.c (struct lang_identifier): Move definition to c-tree.h.
+ * c-tree.h (struct lang_identifier): Moved here from c-decl.c;
+ add 'interface_value' field.
+ (C_SIZEOF_STRUCT_LANG_IDENTIFIER): Update to reflect increased size.
+
+2004-10-11 Caroline Tice <ctice@apple.com>
+
+ * passes.c (rest_of_compilation): Move hot/cold partitioning to
+ occur after scheduling (and SMS), but still before register
+ allocation.
+
+2004-10-10 Dale Johannesen <dalej@apple.com>
+
+ * alias.c (write_dependence_p): Refs to same FE object interfere.
+
+2004-09-29 Stan Shebs <shebs@apple.com>
+
+ * config/darwin.h (REAL_LIBGCC_SPEC): Add non-shared libgcc case for
+ use during 64-bit bringup.
+
+2004-09-27 Robert Bowdidge <bowdidge@apple.com>
+
+ * opts.c: Remove QA_OVERRIDE_GCC3_OPTIONS machinery.
+ * config/darwin-driver.c: Reimplement QA_OVERRIDE_GCC3_OPTIONS in
+ driver-driver.
+
+2004-09-27 Dale Johannesen <dalej@apple.com>
+
+ * tree-ssa-copyrename.c (copy_rename_partition_coalesce):
+ Roll in fix from mainline.
+
+2004-09-26 Caroline Tice <ctice@apple.com>
+ Dale Johannesen <dalej@apple.com>
+
+ * value-prof.c (insn_prefetch_values_to_profile):
+ Don't instrument clobbers.
+
+2004-09-26 Dale Johannesen <dalej@apple.com>
+
+ * gcc.c (default_compilers): Handle -fast, -fastcp same as -fast.
+ (process_command): Make -fastf, -fastcp imply -combine.
+ * tree-ssa-loop-ivopts.c (find_interesting_uses_stmt): Roll in
+ fix from mainline.
+ * print-rtl.c (print_rtx): Print REG_NOTES right (from mainline).
+
+2004-09-24 Dale Johannesen <dalej@apple.com>
+
+ Radar 3811274
+ PR 17625
+ * loop-doloop.c (doloop-modify): roll in fix from FSF.
+
+2004-09-23 Stan Shebs <shebs@apple.com>
+
+ * Makefile.in: Use --print-multi-lib to collect
+ compiled-in multilibs.
+ * config.gcc: Add in a Darwin 8.x makefile fragment.
+ * fixinc.in: Bandaid for a missing __ppc64__ in limits.h
+ * config/rs6000/t-darwin8: New file, adds -m64 multilib.
+
+2004-09-23 Devang Patel <dpatel@apple.com>
+
+ Radar 3765210.
+ * gcc.c (main): Handle -E when combine_flag is set.
+
+2004-09-22 Stan Shebs <shebs@apple.com>
+
+ * config/darwin.h (STARTFILE_SPEC): Don't link in crt2.o if -m64.
+
+2003-09-21 Matt Austern <austern@apple.com>
+
+ Radar 3807942, backported from FSF mainline
+ * config/darwin.c (darwin_make_decl_one_only)
+ Allow coalesced symbol to appear in static archive's table of contents
+
+2004-09-17 Devang Patel <dpatel@apple.com>
+
+ * gcc.c: Use .gch extension instead of .pch.
+
+2004-09-13 Dale Johannesen <dalej@apple.com>
+
+ Radar 3793575
+ * c-decl.c (start_decl): Fix from mainline (PR 17408).
+
+2004-09-13 Andrew Pinski <apinski@apple.com>
+
+ Part of radar 3753405 and all of 3767339
+ * Makefile.in (c-parse.y): Remove ifcwasm as it is no longer used.
+ * objc/Makefile.in (objc/objc-parse.y): Likewise.
+ * c-parse.in: Remove all of @@ifcwasm. Remove all of the MERGE FIXME
+ comments as they are fixed.
+ (cw_asm_expr_no_commas, cw_asm_unary_expr, cw_asm_primary,
+ cw_asm_operand): Change type to be exprtype.
+ (cw_asm_compstmt_nostart): Remove type.
+ (single_cw_asm_stmt): For cw_asm_operand use .value for the third
+ argument of cw_asm_entry.
+ (cw_asm_compstmt_start): Remove increment of compstmt_count.
+ Call c_begin_compound_stmt always and pass true.
+ (cw_asm_compstmt_nostart): Just set cw_asm_block to zero.
+ (cw_asm_compstmt): Call c_end_compound_stmt.
+ (cw_nonnull_asm_operands): use .value for the exprtype.
+ (cw_asm_operand): Set .value to cw_asm_build_register_offset
+ and .original_code to ERROR_MARK.
+ (stmt_nocomp): For cw_asm_compstmt and cw_asm_stmt, call
+ c_finish_expr_stmt.
+ (cw_asm_expr_no_commas): Remove extraneous curly braces.
+ Update return exprtype instead of just a tree.
+ (cw_asm_unary_expr): Likewise.
+ (cw_asm_primary): Likewise.
+ * c-typeck.c (cw_asm_c_build_component_ref): Change build2 to build3 and
+ add NULL as the last argument for COMPONENT_REF.
+
+2004-09-10 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/power4.md: Increase store latency (mainline).
+
+2004-09-08 Stan Shebs <shebs@apple.com>
+
+ * config/rs6000/darwin-worldsave.asm: Remove, no longer used.
+
+2004-09-07 Caroline Tice <ctice@apple.com>
+
+ * cfgrtl.c (rtl_verify_flow_info_1): Add new edge flag,
+ EDGE_CROSSING, to flags test case.
+
+2004-08-31 Devang Patel <dpatel@apple.com>
+
+ * config/darwin-driver.c (get_arch_name): Replace abort() with
+ fatal("message").
+ (get_driver_name): Same.
+
+2004-08-30 Fariborz Jahanian <fjahanian@apple.com>
+
+ * c-common.c (vector_constructor_from_expr): Adapt to new representation
+ of comma-expression in c.
+
+2004-08-29 Andrew Pinski <apinski@apple.com>
+
+ * loop-doloop.c (add_test): Take the mainline change.
+ * loop-invariant.c (find_exits, find_invariants_bb): Take the
+ mainline change, use CALL_P.
+ * tree-alias-common.c (HAVE_BANSHEE): Take the mainline change.
+ * tree-into-ssa.c (compute_global_livein): Take the mainline
+ reformatting.
+ * tree-pretty-print.c: Remove include for tree-chrec.h as it is
+ there later on.
+ * tree-ssa-loop-ivopts.c (zero_p): Make static.
+ * tree-ssa-loop-niter.c (zero_p): Add back, take the mainline change.
+ (number_of_iterations_exit): Take the mainline change for getting
+ a boolean false.
+ (MAX_ITERATIONS_TO_TRACK): Take the mainline change as it is now
+ configurable.
+ (struct nb_iter_bound): Take the mainline comment changes.
+ * tree-ssa-loop-prefetch.c (zero_p): Add to minimize changes
+ from the mainline.
+ * tree-ssa-loop.c (gate_loop): Take the mainline changes as we
+ want the gate so we can turn them on and off easier.
+ * tree.h (struct tree_phi_node, rewritten): Take the mainline change
+ as there are no other integer fields in this struct.
+ (build_vector_type): Remove duplicated prototype.
+ (zero_p): Remove prototype.
+
+ * timevar.c (ppc_intrinsic_time): Correct definition and
+ make static. Cast __mftbu to unsigned.
+
+2004-08-28 Andrew Pinski <apinski@apple.com>
+
+ * config.in: Regenerate.
+
+2004-08-23 Richard Henderson <rth@redhat.com>
+ Andrew Pinski <apinski@apple.com>
+
+ * gimplify.c (gimplify_array_ref_to_plus): Delete.
+ (gimplify_addr_expr): Do not call gimplify_array_ref_to_plus
+ for ARRAY_REF.
+
+ * config/rs6000/rs6000.c (altivec_expand_builtin): Go passed
+ ARRAY_REF also to get to the STRING_CST.
+
+2004-08-24 Stan Shebs <shebs@apple.com>
+
+ * Makefile.in (libgcc.mk): Add ppc64 and ppc64_static libraries.
+ (libgcc.a): Move libraries so they will be found in testing.
+ * config/darwin.h (REAL_LIBGCC_SPEC): Add -m64 cases.
+ * config/darwin7.h (LIB_SPEC): Add -m64 -static case.
+
+ * calls.c (emit_call_1): Use Pmode instead of SImode in Apple local
+ indirect call code.
+ (expand_call): Likewise.
+
+2004-08-23 Stan Shebs <shebs@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_emit_prologue): Add 64-bit
+ cases to optimizations for FP save and picbase setup.
+ (rs6000_emit_epilogue): Adjust the LR save offset to be correct
+ for 64-bit frames.
+
+2004-08-22 Stan Shebs <shebs@apple.com>
+
+ * config/darwin-driver.c (arch_config): Add ppc64.
+ (add_arch_options): Similarly.
+
+2004-08-22 Andrew Pinski <apinski@apple.com>
+
+ PR c/15262
+ * c-typeck.c (build_unary_op): Use &a.b if the foldded lowered
+ expression is not constant.
+ (c_finish_return): Do not go through INDIRECT_REF when looking
+ for the inner expression of an ADDR_EXPR for warning about.
+
+ PR tree-opt/17138
+ * tree-ssa-loop-ivopts.c (peel_address): Handle REALPART_EXPR
+ and IMAGPART_EXPR.
+
+2004-08-20 Stan Shebs <shebs@apple.com>
+
+ * config/rs6000/darwin.h (DARWIN_ARCH_LD_SPEC): Pass -arch ppc64
+ to linker if -m64.
+ (DARWIN_ARCH_ASM_SPEC): Similarly.
+
+2004-08-20 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_rtx_costs): Fix from mainline.
+
+2004-08-19 Dale Johannesen <dalej@apple.com>
+
+ * c-decl.c (implicitly_declare): Reduce error to warning when
+ disable_typechecking_for_spec_flag is on.
+
+2004-08-18 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3753413
+ * config/darwin.c (darwin_build_constant_cfstring): Strip NOP_EXPRs
+ and dereference string literal argument; mark the ADDR_EXPR of
+ each constant CFString TREE_CONSTANT to squash initializer warnings.
+
+2004-08-18 Devang Patel <dpatel@apple.com>
+
+ * config/darwin-driver.c (verbose_flag): New.
+ (do_lipo): Interpret -v.
+ (main): Set verbose_flag.
+
+2004-08-18 Dale Johannesen <dalej@apple.com>
+
+ * tree-cfg.c (tree_block_ends_with_call_p): Fix comments.
+ (tree_block_ends_with_condjump_p): Ditto.
+
+2004-08-18 Matthew Sachs <msachs@apple.com>
+
+ * Merge from mainline.
+
+2004-08-17 Devang Patel <dpatel@apple.com>
+
+ * config/darwin-driver.c (main): Do not handle -x separately.
+
+2004-08-16 Robert Bowdidge <bowdidge@apple.com>
+
+ * Add -mdynamic-no-pic to Darwin-specific options
+
+2004-08-16 Caroline Tice <ctice@apple.com>
+
+ Add hot/cold partitioning update that was accepted in FSF Mainline.
+ * varasm.c (text_section): Remove alignment statement.
+ (assemble_start_function): Remove APPLE LOCAL markers from code
+ added to FSF mainline; Add code to properly align cold section at
+ start of function.
+
+2004-08-16 Devang Patel <dpatel@apple.com>
+
+ Merge from mainlne.
+ 2004-08-16 Devang Patel <dpatel@apple.com>
+
+ * c-common.c (handle_used_attribute): Set DECL_PRESERVE_P.
+ * print-tree.c (print_node): Print DECL_PRESERVE_P.
+ * target-def.h (TARGET_ASM_MARK_DECL_PRESERVED): New #define.
+ (TARGET_ASM_OUT): New member, TARGET_ASM_MARK_DECL_PRESERVED
+ * target.h (struct gcc_target): New member, mark_decl_preserved.
+ * hooks.c (hook_void_charptr): Rename to ...
+ (hook_void_constcharptr): ... new name.
+ * hooks.h (hook_void_charptr): Rename to ..
+ (hook_void_constcharptr): ... new name.
+ * tree.h (DECL_PRESERVE_P): New #define.
+ (struct tree_decl): New member, preserve_flag.
+ * varasm.c (assemble_start_function): Mark decl preserved.
+ (assemble_variable): Same.
+ * darwin.c (darwin_mark_decl_preserved): New function.
+ * darwin.h (TARGET_ASM_MARK_DECL_preserved): New #define.
+ * darwin-protos.h (darwin_mark_decl_preserved): New decl.
+ * doc/tm.texi (TARGET_ASM_MARK_DECL_PRESERVED): Document.
+
+2004-08-13 Matt Austern <austern@apple.com>
+
+ Radar 2872232
+ * ginclude/tgmath.h: New file.
+ * Makefile.in: Add tgmath.h to list of installed headers.
+
+2004-08-13 Devang Patel <dpatel@apple.com>
+
+ Radar 3729261. Reviewed by Dale.
+ * dbxout.c (get_lang_number): New.
+ (dbxout_init): Include lang number in N_SO stab.
+ * dbxout.h (N_SO_AS, N_SO_C, N_SO_ANSI_C, N_SO_CC, N_SO_FORTRAN,
+ N_SO_PASCAL, N_SO_FORTRAN90, N_SO_OBJC, N_SO_OBJCPLUS): New #define.
+
+2004-08-13 Devang Patel <dpatel@apple.com>
+
+ Merge from mainline. Radar 3739309.
+ 2004-08-11 Devang Patel <dpatel@apple.com>
+
+ * dbxout.c (dbxout_begin_prologue): New function.
+ (dbx_debug_hooks): Use new begin prologue hook.
+ (dbxout_function_end): Emit N_ENSYM.
+ * stab.def (N_BNSYM, N_ENSYM): Define and document these two new stabs.
+
+2004-08-13 Devang Patel <dpatel@apple.com>
+
+ Merge from mainline. Radar 3739302.
+ 2004-08-10 Devang Patel <dpatel@apple.com>
+
+ * config/darwin.h (TARGET_OPTION_TRANSLATE_TABLE): Add -dead_strip
+ and -no_dead_strip_inits_and_terms.
+ (LINK_SPEC): Same.
+ * doc/invoke.text (Darwin Options): Document -dead_strip and
+ -no_dead_strip_inits_and_terms.
+
+2004-08-12 Stan Shebs <shebs@apple.com>
+
+ Basic support for 64-bit Darwin.
+ * config/darwin.c (macho_indirect_data_reference): Add DImode case.
+ (machopic_legitimize_pic_address): Similarly, plus use Pmode
+ instead of SImode.
+ * config/rs6000/darwin.h (PTRDIFF_TYPE): Be "long int" if 64-bit.
+ (TARGET_OS_CPP_BUILTINS): Add 64-bit preprocessor macro.
+ (SUBTARGET_SWITCHES): Add -m32 and -m64 flags.
+ (SUBTARGET_OVERRIDE_OPTIONS): Require 64-bit processor if -m64.
+ (PROCESSOR_DEFAULT64): Define.
+ * config/rs6000/darwin.md: New file, patterns specific to 64-bit
+ Darwin.
+ * config/rs6000/rs6000.md: Include darwin.md.
+ (builtin_setjmp_receiver): Add DImode case.
+ * config/rs6000/rs6000.c (TARGET_ASM_UNALIGNED_DI_OP): Define for
+ Darwin.
+ (TARGET_ASM_ALIGNED_DI_OP): Ditto.
+ (rs6000_emit_move): Add DImode case to Darwin bits.
+ (machopic_output_stub): Use .quad if 64-bit.
+ * invoke.texi: Document -m32 and -m64.
+
+2004-08-12 Dale Johannesen <dalej@apple.com>
+
+ * c-decl.c (diagnose_mismatched_decls): Improve
+ -fdisable-typechecking-for-spec.
+
+2004-08-12 Dale Johannesen <dalej@apple.com>
+
+ * gcc.c (default_compilers): Handle -fast same as -combine.
+ (process_command): Make -fast imply -combine.
+ * tree-scalar-evolution.c (number_of_iterations_in_loop):
+ Don't compute iteration count for multiple-exit loops.
+ * config/rs6000/rs6000.c (rs6000_rtx_costs): Replace from mainline.
+
+2004-08-10 Devang Patel <dpatel@apple.com>
+
+ Remove Symbol Separation.
+ Radar 3555440. Reviewed by Mike Stump.
+ * c-common.c (cb_restore_write_symbols, cb_clear_write_symbols,
+ cb_start_symbol_repository, cb_end_symbol_repository,
+ cb_is_builtin_identifier). Remove.
+ (debug.h): Do not include.
+ * c-common.h (dbg_dir): Remove.
+ (dbg_ss_init, c_common_write_context, cb_clear_write_sybols,
+ cb_restor_write_symbols, cb_start_symbol_repository, c_valid_cinfo,
+ cb_end_symbol_repository, cb_is_builtin_identifier): Remove extern
+ decls.
+ * c-lex.c (init_c_lex): Do not set up symbol separation call backs.
+ (c_common_write_context): Remove.
+ * c-objc-common.c (c_objc_common_finish_file): Do not write context.
+ * c-opts.c (dbg_dir): Remove.
+ (c_common_handle_option): Remove symbol separation option handling.
+ (c_common_parse_file): Do not initialize symbol repository.
+ * c.opt (Winvalid-sr, fsave-repository=): Remove.
+ * dbxout.c (dbxout_restore_write_symbols, dbxout_clear_write_symbols,
+ dbxout_start_symbol_repository, dbxout_end_symbol_repository) Remove.
+ (dbx_debug_h): Remove symbol separation hoooks.
+ (xcoff_debug): Same.
+ * debug.c (do_nothing_): Remove symbol separation hooks.
+ * debug.h (gcc_debug_hooks): Same.
+ * dwarf2out.c (dwarf2_debug): Same.
+ * flags.h (orig_write_symbols, flag_grepository): Same.
+ * gcc.c (pch): Remove fsave-repository support.
+ (cc1_options): Same.
+ (asm_options): Same.
+ (default_compilers): Same.
+ (option_map): Same.
+ (dbg_ss): Remove.
+ (static_specs): Remove dbg_ss.
+ * opts.c (orig_write_symbols, flag_grepository): Remove.
+ (set_debug_level): Remove symbol separation support.
+ * doc/invoke.texi: Remove symbol separation documentation.
+
+2004-08-09 Geoffrey Keating <geoffk@apple.com>
+
+ * ginclude/stdarg.h: Remove APPLE LOCAL change.
+ * ginclude/varargs.h: Likewise.
+
+2004-08-08 Dale Johannesen <dalej@apple.com>
+
+ * c-common.c (c_common_get_alias_set): Fixes from mainline.
+ * toplev.c: Ditto.
+ * tree.h: Ditto.
+ * coverage.c (tree_coverage_counter_ref): Ditto.
+ * tree-cfg.c (tree_block_ends_will_call_p): Ditto.
+ (tree_block_ends_with_condjump_p): Ditto.
+
+2004-08-08 Andrew Pinski <apinski@apple.com>
+
+ * c-objc-common.c (c_objc_common_init): Remove APPLE LOCAL for setting -gused
+ by default as it is handled in CC1_SPECs now.
+ * opts.c (set_debug_level): Remove the handling of -gused and -gfull as they
+ are already handled in CC1_SPECs.
+ * config/rs6000/darwin.h (CC1_SPEC): Change the APPLE LOCAL tag to be what is
+ really local now.
+
+2004-08-06 Dale Johannesen <dalej@apple.com>
+
+ * c-typeck.c (tagged_types_tu_compatible_p): Fix from mainline.
+
+2004-08-06 Andrew Pinski <apinski@apple.com>
+
+ * config/darwin.h: Fix misplaced #endif which came in via the merge.
+
+2004-08-04 Fariborz Jahanian <fjahanian@apple.com>
+
+ c-common.c (vector_constructor_from_expr): Treat all constant
+ vector expression tree as a constant tree.
+
+2004-08-03 Stan Shebs <shebs@apple.com>
+
+ Support for CodeWarrior-style assembly language blocks and
+ functions. Radar 3368707.
+
+ * c.opt (-fasm-blocks): New option.
+ * c-common.h (enum cw_asm_states): New enum, state values.
+ * c-tree.h: Declare some functions.
+ * c-common.c (flag_cw_asm_blocks): New flag.
+ (cw_asm_states, cw_asm_in_decl, cw_asm_block, cw_asm_at_bol,
+ cw_asm_in_operands, cw_asm_labelno, cw_asm_buffer,
+ cw_asm_operands, cw_asm_labels, cw_asm_labels_uniq): New globals.
+ (cw_asm_default_function_conversion, cw_asm_stmt,
+ cw_asm_field_offset, cw_asm_field_offset, print_cw_asm_operand,
+ cw_asm_get_register_var, cw_asm_reg_name, cw_asm_label,
+ get_atsign_identifier, clear_cw_asm_labels, get_cw_asm_label,
+ cw_asm_build_register_offset, cw_asm_entry): New functions.
+ c-decl.c: (grokdeclarator): Recognize asm keyword, set flag
+ on function decl if seen.
+ (start_function): Change asm state to expect local decls.
+ (lookup_struct_or_union_tag): New function.
+ c-lex.c (cw_asm_saved_token, c_lex_depth): New globals.
+ (c_lex_with_flags): Add state machine to return BOL and EOL
+ tokens at appropriate moments, return CPP_ATSIGN as its own
+ token if in asm block.
+ c-opts.c (c_common_handle_option): Recognize -fasm-blocks.
+ c-parse.in: Add rules for parsing CW asm blocks.
+ (CW_ASM_KEYWORD, CW_ASM_BOL, CW_ASM_EOL): New tokens.
+ (cw_asm_expr_no_commas, cw_asm_unary_expr, cw_asm_primary,
+ cw_asm_operands, cw_nonnull_asm_operands, cw_asm_operand, cw_asm_stmt,
+ single_cw_asm_stmt, cw_asm_compstmt, cw_asm_compstmt_start,
+ cw_asm_compstmt_nostart): New nonterminals.
+ (lineno_decl): Flag no longer in decls part.
+ (scspec): Add CW_ASM_KEYWORD.
+ (stmt): Add cw_asm_compstmt and cw_asm_stmt alternatives.
+ (yylexname): Detect asm functions and return CW_ASM_KEYWORD.
+ (_yylex): Return '@' as token if CW asm, return BOL/EOL.
+ c-typeck.c (build_external_ref): Handle asm register names
+ and labels specially.
+ (cw_asm_typename_or_reserved, cw_asm_c_build_component_ref):
+ New functions.
+
+ * function.h (struct function): New fields cw_asm_function,
+ cw_asm_noreturn, cw_asm_frame_size.
+ * tree.h (DECL_CW_ASM_FUNCTION, DECL_CW_ASM_NORETURN,
+ DECL_CW_ASM_FRAME_SIZE): New macros.
+ (struct tree_decl): New fields cw_asm_function_flag,
+ cw_asm_noreturn_flag, cw_asm_frame_size.
+ * config/darwin.h (CW_ASM_SPECIAL_LABEL): Define.
+ * config/darwin-protos.h (darwin_cw_asm_special_label): Declare.
+ * config/darwin.c (darwin_cw_asm_special_label): New function.
+ * rs6000/rs6000-protos.h (rs6000_cw_asm_register_name): Declare.
+ * rs6000/rs6000.c (rs6000_cw_asm_register_name): New function.
+ * rs6000/rs6000.h (CW_ASM_REGISTER_NAME): Define.
+ * scan-decls.c (flag_cw_asm_blocks, etc): Dummy definitions.
+
+ * doc/extend.texi, doc/invoke.texi: Document.
+
+2004-08-01 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_split_multireg_move): Just abort
+ if trying to *store* to a non-offsettable address.
+ * config/rs6000/rs6000.md (movtf_internal): Don't move GPRs to
+ a nonoffsettable address.
+ (movdi_internal32): Don't move GPRs to a nonoffsettable address.
+ Clean up.
+ (movti_string): Don't move GPRs to a nonoffsettable address.
+ (movti_ppc64): Don't move GPRs to a nonoffsettable address. Clean up.
+
+2004-08-01 Devang Patel <dpatel@apple.com>
+
+ Re-implement -fwritable-strings support.
+ Radar : 3699482
+
+ * c-common.c (fix_string_type): Check flag_writable_strings.
+ (fix_string_type): Likewise.
+ * c-opts.c (set_std_c89): Initialize flag_writable_strings.
+ (set_std_c99): Likewise.
+ * common.opt (fwritable-strings): Add.
+ * flags.h: Add the external declaration of
+ flag_writable_strings.
+ * opts.c (common_handle_option) <OPT_fwritable_strings>:
+ Add.
+ * toplev.c (flag_writable_strings): Add.
+ (f_options): Add an entry for writable-strings.
+ * varasm.c (const_hash_1) <STRING_CST>: Check
+ flag_writable_strings.
+ (compare_constant) <STRING_CST>: Likewise.
+ (build_constant_desc): Likewise.
+ * config/darwin.c (machopic_select_section): Likewise.
+ * doc/invoke.texi (-fwritable-strings): Add.
+ (-fno-const-strings): Document -fwritable-strings.
+ * doc/trouble.texi: Document -fwritable-strings.
+
+2004-08-01 Geoffrey Keating <geoffk@apple.com>
+
+ * c-common.c (warn_long_double): Remove.
+ (warn_about_long_double): Remove.
+ * c-common.h (warn_long_double): Remove.
+ (warn_about_long_double): Remove.
+ * c-decl.c (grokdeclarator): Don't call warn_long_double.
+ * c-opts.c (c_common_handle_option): Remove case for OPT_Wlong_double.
+ * doc/invoke.texi: Don't document -Wlong-double.
+
+2004-07-30 Geoffrey Keating <geoffk@apple.com>
+ Fariborz Jahanian <fjahanian@apple.com>
+
+ * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Permit
+ non-offsettable addresses even for DImode.
+ (rs6000_split_multireg_move): Cope with non-offsettable addresses
+ being moved into multiple GPRs.
+
+ * config/rs6000/rs6000.c (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Default
+ to 64.
+ (rs6000_override_options): Use RS6000_DEFAULT_LONG_DOUBLE_SIZE.
+ * config/rs6000/darwin.h (RS6000_DEFAULT_LONG_DOUBLE_SIZE): Define
+ to 128.
+ * config/rs6000/darwin-ldouble.c (isless): New macro.
+ (inf): New macro.
+ (nonfinite): New macro.
+ (FPKINF): Delete.
+ (_xlqadd): Completely rewrite.
+ (_xlqmul): Correct overflow handling.
+ (_xlqdiv): Correct overflow handling.
+ * config/rs6000/darwin-ldouble-format: New file.
+
+2004-07-30 Matt Austern <austern@apple.com>
+
+ * config/darwin-c.c (darwin_pragma_call_on_load): Deprecate.
+ (darwin_pragma_call_on_unload): Likewise.
+
+2004-07-15 Devang Patel <dpatel@apple.com>
+
+ * tree-if-conv.c: Add brief description at the beginning.
+ (is_appropriate_for_if_conv): Rename to ..
+ (if_convertable_loop_p): ... new name.
+ (bb_with_exit_edge): Rename to ..
+ (bb_with_exit_edge_p): ... new name.
+ (make_cond_modify_expr): Update comment before function body.
+ (replace_phi_with_cond_modify_expr): Same.
+ (tree_if_convert_stmt): Same. Use new fn name, bb_with_exit_edge_p.
+ (if_convertable_loop_p): New function name. Remove some dead code.
+ (collapse_blocks): Update comment before function body. Format code.
+ Use bb_with_exit_edge_p.
+ (tree_if_conversion): Move this function body at the end of file.
+ (handle_siblint_pattern): Update comment before function body.
+ (fold_sibling_stmts): Same. Update dump info.
+
+2004-07-14 Devang Patel <dpatel@apple.com>
+
+ * target.h (gcc_target): Additional parameter for
+ support_vector_compare_for_p.
+ * tree-if-conv.c (handle_sibling_pattern): New.
+ (fold_sibling_stmts): New.
+ (make_cond_modify_expr): Dump debugging info.
+ (tree_if_convert_stmt): Same.
+ (is_appropriate_for_if_conv): Remove filters that eliminated
+ loops becase of memory tags and difficult dominance relation.
+ (collapse_blocks): Handle memory tags.
+ (tree_if_conversion): Optimize sibling statements.
+ * tree-vectorizer.c (vect_init_vector): Additional parameter.
+ (vect_get_vec_def_for_operand): Supply vectype to vect_init_vector().
+ (vect_init_vecotr): Use input parameter vectype.
+ (vect_transform_compare): Fix type in dump info.
+ (vect_transform_select): Handle ARRAY_REF as scalar dest. Handle
+ NOP_EXPR as an operand.
+ (vect_is_supportable_compare): Use operand's type to decide
+ second vector type for support_vector_compare_for_p().
+ (vect_is_supportable_select): Fix typo. Allow SSA_NAME as 2nd
+ operand.
+ (exist_non_indexing_operands_for_use_p): Handle conditional modify
+ expr.
+ config/rs6000/rs6000.c (rs6000_vector_compare_for_p): New parameter.
+ (get_vector_compare_for): New parameter. Use it to find appropriate
+ builtin.
+
+2004-06-26 Fariborz Jahanian <fjahanian@apple.com>
+
+ * gcc.c: Don't use -fpredictive-compilation when
+ -fpreprocessed appears on command line.
+
+2004-07-01 Devang Patel <dpatel@apple.com>
+
+ * tree-if-conv.c (mark_vdefs_vuses_for_rename): New function.
+ (make_ifcvt_temp_variable): Mark vdefs and vuses for renaming.
+
+2004-07-01 Devang Patel <dpatel@apple.com>
+
+ Radar 3236762
+ * config/darwin-driver.c (do_lipo): Do not supply -arch <arch_name>
+ to lipo.
+
+2004-06-29 Andrew Pinski <apinski@apple.com>
+
+ * c-decl.c (perform_loop_transpose): Save chain of right_before_inner_loop
+ and set to NULL. Restore the chain before rejecting the loop.
+
+2004-06-29 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_create_data_ref) INDIRECT_REF check moved to
+ analysis. Redundant checks removed.
+ (vect_analyze_data_refs): Make sure we have a mem_tag.
+ (vect_transform_loop): Make sure that we have a preheader bb.
+ (vect_init_vector): Insert on preheader edge instead of using bsi.
+ (vect_finish_stmt_generation_in_preheader): Now that a preheader bb is
+ created before vectorizing stmts, we do not expect a new bb to be
+ created (thereofore, abort instead of add_bb_to_loop).
+ * config/rs6000/rs6000.c (rs6000_build_vmul_uch): Likewise.
+ (rs6000_build_vector_init): Likewise. Also replace mark_call_clobbered
+ with direct setting of DECL_NEEDS_TO_LIVE_IN_MEMORY_INTERNAL.
+
+2004-06-28 Devang Patel <dpatel@apple.com>
+
+ * Makefile.in (tree-ssa-loop-manip.o): Depend on tree-scalar-evolution.h
+ * tree-if-conv.c (collapse_blocks): Use release_phi_node instead of
+ remove_phie_node.
+ * tree-ssaname.c (make_ssa_name): Re-enable free_ssanames.
+ (release_ssa_name): Same.
+ * tree-scalar-evolution.c (scev_reset): Check current_loops and
+ scalar_evolution_info.
+ * tree-ssa-loop-manip.c (tree-scalar-evolution.h): Include.
+ (tree_duplicate_loop_to_header_edge): Call scev_reset().
+
+2004-06-28 Devang Patel <dpatel@apple.com>
+
+ * tree-if-conv.c (make_ifcvt_temp_variable): Fix formatting.
+
+2004-06-28 Devang Patel <dpatel@apple.com>
+
+ * tree-if-conv.c (make_ifcvt_temp_variable): Add new parameter for
+ original stmt. Update new statement's vuse approritatly based on
+ original stmt.
+ (make_cond_modify_expr): Supply current statement as additional
+ parameter to make_ifcvt_temp_variable call.
+ (tree_if_convert_stmt): Same.
+ (replace_phi_with_cond_modify_expr): Update vuse and vdefs.
+ (is_appropriate_for_if_conv): Lift, first phi node needs to be constant
+ node, restriction.
+ * tree-ssa-operands.c (add_vdef): New function.
+ * tree-ssa-operands.h (add_vdef): Same.
+
+2004-06-25 Mike Stump <mrs@apple.com>
+
+ * objcp/Make-lang.in (objcp/objcp-parse.y): Update to use
+ move-if-change from top directory.
+
+2004-06-25 Stuart Hastings <stuart@apple.com>
+
+ Radar 3680191
+ * gcc/tree-nested.c: Cast STACK_BOUNDARY for portability.
+ * gcc/config/i386/i386.c (output_pic_addr_const): Stubify optimized symbols.
+ * gcc/target-def.h: (TARGET_BECT_BUILD_VECTOR_INIT) Initialize correctly.
+
+2004-06-25 Dale Johannesen <dalej@apple.com>
+
+ * objc/Make-lang.in: use $(srcdir)/../move-if-change.
+
+2004-06-25 Dale Johannesen <dalej@apple.com>
+
+ * Makefile.in: replace $(SHELL) ${srcdir}/mkinstalldirs
+ with $(mkinstalldirs) throughout.
+
+2004-06-25 Stuart Hastings <stuart@apple.com
+
+ Radar 3690727
+ * gcc/config/rs6000/rs6000.md: Add missing APPLE LOCAL markers.
+ * gcc/config/t-darwin.h: Ditto.
+ * gcc/ChangeLog.apple-ppc: Minor formatting cleanup.
+
+2004-06-24 Dale Johannesen <dalej@apple.com>
+
+ Radar #: 3696823, 3673318, 3672998
+ Roll in changes from mainline:
+ * config/rs6000/rs6000.c (legitimate_offset_address_p): Make
+ global, rename rs6000_legitimate_offset_address_p.
+ (rs6000_legitimate_address_p): Adjust calls to it.
+ (lmw_operation): Ditto.
+ (stmw_operation): Ditto.
+ * config/rs6000/rs6000-protos.h: Declare it.
+ * config/rs6000/rs6000.md (*movdf_hardfloat32): Use it
+ instead of offsettable_memref_p.
+ * config/rs6000/rs6000.c (rs6000_legitimate_address): Disallow
+ [reg+reg] mode for TFmode memory accesses.
+ (rs6000_eliminate_indexed_memrefs): New.
+ (rs6000_emit_move): Call preceding for TImode and TFmode.
+
+2004-06-24 Andrew Pinski <apinski@apple.com>
+
+ Radar #: 3699721
+ * config/darwin.c (machopic_indirect_data_reference): Copy
+ the SYMBOL_REF_DECL from the original RTX for the new
+ non-lazy pointer RTX.
+
+2004-06-24 Ayal Zaks <zaks@il.ibm.com>
+
+ * target-def.h (TARGET_VECT_BUILD_BUILTIN_LVSR): New macro.
+ * target.h (build_builtin_lvsr): New function.
+ * tree-vectorizer.c (vect_create_index_for_array_ref): Add option
+ to only calculate init_val without creating the iv.
+ (vect_create_data_ref): Deal with unknown alignment; allow creating
+ data refs for initial access only.
+ (vect_transform_store): Call vect_create_data_ref accordingly.
+ (vect_finish_stmt_generation_in_preheader): New function.
+ (vect_finish_stmt_generation): Need to optionally bump bsi again.
+ (vect_transform_load): Replace call to lvsl by a call to lvsr(16-a)
+ in preheader. Move load of msq out to preheader. Removed TREE_INVARIANT.
+ (vect_analyze_data_refs_alignment): Allow unknown aligned loads.
+ * rs6000.c (rs6000_build_builtin_lvsr): New function.
+ (rs6000_support_misaligned_vloads, rs6000_permute_misaligned_vloads):
+ Check if TARGET_ALTIVEC.
+ (get_vector_init_fns_for_type): Initialize lve_fn, splt_fn vars.
+
+2004-06-22 Andrew Pinski <apinski@apple.com>
+
+ Radar #: 3661615, 3623788
+ * c-decl.c (perform_loop_transpose): Do not
+ change TREE_CHAIN (right_before_inner_loop)
+ until after we know we are going to do the
+ transformation.
+
+ * c-decl.c (perform_loop_transpose): Fix formatting and cleanup.
+
+2004-06-22 Andrew Pinski <apinski@apple.com>
+
+ Radar #: 3701874
+ * c-decl.c (push_file_scope): Return early if we already
+ have a file scope.
+
+2004-06-22 Devang Patel <dpatel@apple.com>
+
+ PR 16105
+ * tree-vectorizer.c (vect_analyze_operations): Type of MODIFY_EXPR is
+ not reliable. Use LHS's type.
+
+2004-06-21 Dorit Naishlos <DORIT@il.ibm.com>
+
+ * tree.def (MULT_UCH_EXPR): New tree code.
+ * tree-vectorizer.h (stmt_vec_info): New fields part_of_pattern,
+ related_stmt, v.vect_target_hook_for_pattern, and v.vectorized_stmt.
+ (STMT_VINFO_IN_PATTERN_P): New macro.
+ (STMT_VINFO_VEC_HOOK): New macro.
+ (STMT_VINFO_RELATED_STMT): New macro.
+ * tree-vectorizer.c (vect_pattern_recog): New function.
+ (vect_recog_mul_uch_to_uch): New function.
+ (vect_recog_mul_uch_to_uch1): New function.
+ (new_stmt_vec_info): Initialize new fields in stmt_vec_info.
+ (vect_transform_op): Call target hook recorded in STMT_VINFO_VEC_HOOK.
+ (vect_is_supportable_op): Use new field STMT_VINFO_VEC_HOOK to record
+ target support for the "mul_uch" pattern.
+ (vect_mark_relevant): Don't mark stmts involved in a pattern as
+ relevant.
+ (vect_mark_stmts_to_be_vectorized): Likewise.
+ (vect_create_data_ref): Fix alias-sets bug.
+ (vect_get_vec_def_for_operand): Call new hook support_vector_init_p.
+ * target.h (support_vmul_uch_p): New entry for target hook.
+ (build_vmul_uch): New entry for target hook.
+ (support_vector_init_p): New entry for target hook.
+ (build_vector_init): New entry for target hook.
+ * target-def.h (TARGET_VECT_SUPPORT_VMUL_UCH_P): New target hook.
+ (TARGET_VECT_BUILD_VMUL_UCH): New target hook.
+ (TARGET_VECT_SUPPORT_VECTOR_INIT_P): New target hook.
+ (TARGET_VECT_BUILD_VECTOR_INIT): New target hook.
+ * config/rs6000/rs6000.c (rs6000_support_vmul_uch_p): New function.
+ (rs6000_build_vmul_uch) New function.
+ (rs6000_support_vector_init_p) New function.
+ (get_vector_init_fns_for_type) New function.
+ (rs6000_build_vector_init) New function.
+
+
+2004-06-17 Jon Ziegler <jonz@apple.com>
+
+ Radar 3691917
+ * Revert version string in gcc/version.c to as of apple-gcc-1762.
+
+2004-06-16 Jon Ziegler <jonz@apple.com>
+ Radar 3619941
+ * Revert to apple-gcc-1762 plus Dorit/Devang's 2004-06-15 patch.
+ Radar 3691917
+ * Update version string in gcc/version.c
+
+2004-06-16 Dale Johannesen <dalej@apple.com>
+ Radar 3661015/PR 15993
+ * tree-ssa-dom.c (thread_across_edge): fix from FSF.
+
+2004-06-15 Dorit Naishlos <DORIT@il.ibm.com>
+
+ Radar 3619941
+ * tree-data-ref.c (init_data_ref): New function.
+ * tree-data-ref.h (init_data_ref): New function.
+ * tree-vectorizer.c (vect_get_array_first_index): Return index instead
+ of success status, and support pointers.
+ (vect_create_index_for_array_ref): Remove ARRAY_REF restriction, and
+ change call to vect_get_array_first_index.
+ (vect_create_data_ref): Handle INDIRECT_REFs.
+ (vect_is_supportable_store): Handle INDIRECT_REFs.
+ (vect_is_supportable_load): Handle INDIRECT_REFs.
+ (vect_analyze_data_ref_dependence): Handle INDIRECT_REFs.
+ (vect_analyze_data_ref_dependences): Remove usage of variable 'ok'.
+ (get_array_base): Removed (not used anymore).
+ (vect_force_dr_alignment_p): Use DR_BASE_NAME instead of
+ get_array_base.
+ (vect_align_data_ref): Likewise.
+ (vect_transform_store): Remove ARRAY_REF restriction.
+ (vect_transform_load): Remove ARRAY_REF restriction.
+ (vect_compute_data_ref_alignment): Support pointers.
+ (vect_analyze_data_refs): Support pointers.
+ (vect_debug_stats): New Function.
+ (vect_debug_details): New Function.
+ (vect_transform_loop): Use vect_debug_stats and vec_debug_details.
+ (vect_analyze_loop): Use vect_debug_details.
+ (vect_analyze_scalar_cycles): Use vect_debug_stats.
+ (vect_analyze_data_ref_dependence): Likewse.
+ (vect_analyze_data_refs_alignment): Likewise.
+ (vect_analyze_data_ref_accesses): Likewise.
+ (vect_analyze_data_refs): Likewise.
+ (vect_analyze_loop_form): Likewise.
+ (vect_gen_if_guard): Formatting fixes (avoid 80 column overflow).
+ (vect_update_initial_conditions_of_duplicatd_loop): Likewise.
+ (vect_transform_loop): Likewise.
+ (vect_analyze_loop_form): Likewise.
+
+2004-06-14 Caroline Tice <ctice@apple.com>
+
+ Radar 3690727 (partial)
+ * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove.
+ * passes.c (rest_of_compilation): Add missing APPLE LOCAL.
+ * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove definition.
+ (SECTION_FORMAT_STRING): Likewise.
+ * config/rs6000/sysv4.h (NORMAL_TEXT_SECTION_NAME): Likewise.
+ (SECTION_FORMAT_STRING): Likewise.
+ * doc/tm.texi (NORMAL_TEXT_SECTION_STRING): Remove documentation.
+ (SECTION_FORMAT_STRING): Likewise.
+
+2004-06-14 Dale Johannesen <dalej@apple.com>
+
+ Radar 3661661
+ * tree-ssa.c (tree_ssa_useless_type_conversion_1): fix from FSF.
+
+2004-06-14 Dale Johannesen <dalej@apple.com>
+
+ Radar 3690727 (partial)
+ * gimplify.c (copy_if_shared_r): Add missing APPLE LOCAL.
+ * config/rs6000/t-darwin: Ditto.
+
+2004-06-14 Fariborz Jahanian <fjahanian@apple.com>
+
+ * version.c: Remove word tree-ssa from version string.
+
+2004-06-12 Devang Patel <dpatel@apple.com>
+
+ * Makefile.in (OBJS-common): Add tree-if-conv.o.
+ (tree-if-conv.o): New rule.
+ * target-def.h (TARGET_VECTOR_COMPARE_P, TARGET_VECTOR_COMPARE_FOR_P,
+ TARGET_VECTOR_COMPARE_STMT, TARGET_VECTOR_SELECT_P,
+ TARGET_VECTOR_SELECT_FOR_P, TARGET_VECTOR_SELECT_STMT): New.
+ (TARGET_INITIALIZER): New members.
+ * target.h (tree.h): Include.
+ (struct gcc_target.vect): New members - support_vector_compare_p,
+ support_vector_compare_for_p, vector_compare_stmt, support_vector_select_p,
+ support_vector_select_for_p, vector_select_stmt.
+ * tree-dfa.c (dump_immediate_uses_for): Print block index.
+ * tree-flow.h (enum move_pos): Move from ...
+ * tree-ssa-loop-im.c (enum move_pos): here.
+ * tree-if-conv.c: New file.
+ * tree-simple.c (is_gimple_stmt): Make COND_EXPR valid gimple.
+ * tree-ssa-dce.c (mark_control_dependent_edges_necessary): Check t.
+ * tree-ssa-live.c (debug_var_map): New function.
+ * tree-ssa-live.h (debug_var_map): New function declaration.
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variable): Add
+ flow_loop_scan() call.
+ * tree-ssa-operands (get_stmt_operands): Handle MODIFY_EXPR when COND_EXPR
+ is RHS.
+ (get_expr_operands): Same.
+ * tree-ssanames.c (make_ssa_name): Do not use free_ssanames.
+ (release_ssa_name): Same.
+ * tree-vectorizer.c (vect_transform_select): New function.
+ (vect_transform_compare): New function
+ (vect_is_supportable_operation): New function.
+ (vect_is_supportable_compare): New function.
+ (vect_is_supportable_select): New function.
+ (get_array_base): Move into tree.c.
+ (vect_loop_version): New function.
+ (second_loop_vers_available): New variable.
+ (default_vector_compare_p): New function.
+ (default_vector_compare_for_p): New function.
+ (default_vector_comapre_stmt): New function.
+ (default_vector_select_p): New function.
+ (default_vector_select_for_p): New function.
+ (default_vector_select_stmt): New function.
+ (vect_transform_stmt): Handle select_vec_info_type and
+ compare_vec_info_type.
+ (vect_is_supportable_op): Use vect_is_supportable_operation.
+ (vect_analyze_operations): Check select and compare support.
+ (vect_analyze_data_refs_alignment): Print data reference in dump file.
+ (vect_analyze_loop_form): Use if-conversion and update loop->num_nodes
+ check.
+ (vectorize_loops): Use vect_loop_version. Handle second loop version.
+ * tree-vectorizer.h (struct _stmt_vec_info): New members -
+ select_vec_info_type and compare_vec_info_type.
+ (default_vector_compare_p): New function decl.
+ (default_vector_compare_for_p): New function decl.
+ (default_vector_comapre_stmt): New function decl.
+ (default_vector_select_p): New function decl.
+ (default_vector_select_for_p): New function decl.
+ (default_vector_select_stmt): New function decl.
+ * tree.c (get_array_base): Move from tree-vectorizer to here.
+ * tree.h (get_array_base): New function decl.
+ * config/rs6000 (vector_builtin_fns): New.
+ (rs6000_vector_compare_p): New function.
+ (rs6000_vector_compare_for_p): New function.
+ (rs6000_vector_compare_stmt): New function.
+ (rs6000_vector_select_p): New function.
+ (rs6000_vector_select_for_p): New function.
+ (rs6000_vector_select_stmt): New function.
+ (TARGET_VECTOR_COMPARE_P, TARGET_VECTOR_COMPARE_FOR_P,
+ TARGET_VECTOR_COMPARE_STMT, TARGET_VECTOR_SELECT_P,
+ TARGET_VECTOR_SELECT_FOR_P, TARGET_VECTOR_SELECT_STMT): Define.
+ (def_builtin): Record builtin fn node in vector_builtin_fns.
+ * rs6000.h (enum rs6000_builtins): New entry - RS6000_BUILTIN_MAX.
+
+2004-06-12 Devang Patel <dpatel@apple.com>
+
+ Radar 3681611
+ * gcc.c (do_spec_1): Disable local IMA patch that creats new temp. file for
+ each source file.
+
+2004-06-12 Dorit Naishlos <DORIT@il.ibm.com>
+ Olga Golovanevsky <OLGA@il.ibm.com>
+ Ayal Zaks <ZAKS@il.ibm.com>
+
+ * tree-vectorize.c (vect_build_symbl_bound, vect_gen_if_guard): New.
+ (vect_create_index_for_array_ref): Use integer_zer_node as init.
+ (vect_update_initial_conditions_of_duplicated_loop): Update phis of epilog
+ loop header and new loop exit destination.
+ (vect_transform_loop): Remove code that now belongs to
+ vect_generate_tmps_on_preheader () function. Use
+ vect_gen_if_guard function twice.
+
+2004-06-11 Dale Johannesen <dalej.@apple.com>
+
+ * tree-ssa-loop-niter.c (number-of_iterations_cond): Apply Zdenek's
+ patch from 5/28 lno-branch.
+
+2004-06-10 Dale Johannesen <dalej@apple.com>
+ * tree-scalar-evolution.c (scev_finalize): Remove wild load.
+
+2004-06-10 Fariborz Jahanian <fjahanian@apple.com>
+
+ * version.c: Change version date to 20040529 (date of
+ last merge).
+
+2004-06-09 Dale Johannesen <dalej@apple.com>
+
+ * df.c (df_def_record_1): Handle DImode parallel.
+
+2004-06-09 Fariborz Jahanian <fjahanian@apple.com>
+
+ * gengtype.c (get_output_file_with_visibility): Removed dead code.
+ * gimplify.c (copy_if_shared_r): brought in patch to PR15884 done
+ by RTH to fix perlbmk crash.
+
+2004-06-08 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/t-darwin: Remove duplicate fpsave.
+
+2004-06-08 Andrew Pinski <pinskia@physics.uc.edu>
+
+ approved Dale Johannesen <dalej@apple.com>
+ Radar 3683113, PR 15881.
+ * fold.const.c (fold_convert): Handle ptr-to-member.
+ * tree-scalar-evolution.c (count_ev_in_wider_type): Use
+ fold_convert not convert.
+ (compute_overall_effect_of_inner_loop): Ditto.
+ (chrec_is_positive): Ditto.
+ (add_to_evolution_1): Ditto.
+ (add_to_evolution): Ditto.
+ (first_iteration_non_satisfying_1): Ditto.
+ (follow_ssa_edge_in_rhs): Ditto.
+ (interpret_rhs_modify_expr): Ditto.
+ (number_of_iterations_in_loop): Ditto.
+
+2004-06-08 Robert Bowdidge <bowdidge@apple.com>
+
+ * config/darwin.c (machopic_indirect_call_target): Added patch from
+ PR/15720 (function marked inline which is called directly isn't
+ emitted).
+
+2004-06-08 Fariborz Jahanian <fjahanian@apple.com>
+
+ * varasm.c (assemble_variable): Resotored zerofill size optimization.
+ * config/rs6000/rs6000.c (rs6000_override_options): Place
+ rs6000_init_hard_regno_mode_ok after setting of -fast flags.
+
+2004-06-08 Caroline Tice <ctice@apple.com>
+
+ * common.opt (fcreate-profile): Add new command line option.
+ (fuse-profile): Likewise.
+ * gcc.c (LINK_COMMAND_SPEC): Add fcreate-profile to list of flags
+ that causes "-lgcov" to be included in link command.
+ * opts.c (commmon_handle_option): Add cases for fcreate-profile and
+ fuse-profile; make them fall into the cases for fprofile-generate
+ and fprofile-use, respectively.
+ * config/darwin.h (LINK_COMMABND_SPEC): Add fcreate-profile to list
+ of flags that causes "-lgcov" to be included in link command.
+ * doc/invoke.texi (fcreate-profile, fuse-profile): Add documentation
+ for the new command line options. Indicates they are obsolete and
+ should not be used.
+
+2004-06-07 Fariborz Jahanian <fjahanian@apple.com>
+
+ * gcc.c: Removed setting of -combine option with -fast.
+
+2004-06-07 Fariborz Jahanian <fjahanian@apple.com>
+
+ * decl.c (maybe_commonize_var): Removed APPLE LOCAL coalescing stuff.
+ * method.c (use_thunk): ditto.
+ * rtti.c (tinfo_base_init): ditto.
+ * common.opt: ditto.
+
+2004-06-07 Dale Johannesen <dalej@apple.com>
+
+ * cse.c (cse_insn): Make sure there's a ZERO_EXTEND before looking
+ under it. (176.gcc spec regression)
+
+2004-06-07 Ayal Zaks <zaks@il.ibm.com>
+
+ Radar 3619935 - Part 1
+ * target-def.h (TARGET_VECT, TARGET_VECT_BUILD_BUILTIN_LVSL,
+ TARGET_VECT_SUPPORT_MISALIGNED_LOADS,
+ TARGET_VECT_PERMUTE_MISALIGNED_LOADS,
+ TARGET_VECT_BUILD_BUILTIN_VPERM): New macros for
+ TARGET_INITIALIZER.
+ * target.h (struct vect): New substruct of gcc_target.
+ * tree-vectorizer.c (vect_create_index_for_array_ref): Return also the
+ initial value of the iv.
+ (vect_create_data_ref): Return also the created pointer; don't call
+ vect_align_data_ref.
+ (vect_finish_stmt_generation): New.
+ (vect_transform_load): Handle misaligned loads too.
+ (vect_analyze_data_refs_alignment): Allow loads to be misaligned.
+ * config/rs6000/rs6000.c (TARGET_VECT_BUILD_BUILTIN_LVSL,
+ TARGET_VECT_SUPPORT_MISALIGNED_LOADS,
+ TARGET_VECT_PERMUTE_MISALIGNED_LOADS,
+ TARGET_VECT_BUILD_BUILTIN_VPERM): Redefine.
+ (rs6000_support_misaligned_vloads, rs6000_permute_misaligned_vloads,
+ rs6000_build_builtin_lvsl, rs6000_build_builtin_vperm): New.
+
+2004-06-07 Olga Golovanevsky <OLGA@il.ibm.com>
+
+ * tree-vectorizer.c (vect_update_initial_conditions_of_duplicated_loop):
+ Handle general form of "init" and "step" of access function.
+ * tree-ssa-loop-manip.c (tree_duplicate_loop_to_exit_cfg):
+ The exit from loop is taken from bb previous to latch instead
+ of latch itself.
+
+2004-06-07 Devang Patel <dpatel@apple.com>
+
+ Radar 3673334
+ * config/darwin-driver.c (add_arch): New.
+ (strip_path_and_suffix): Use strcpy.
+ (main): Use add_arch().
+
+2004-06-07 Devang Patel <dpatel@apple.com>
+
+ Radar 3668208 and 3668213
+ * config/rs6000/darwin.h (CC1_SPEC): Handle -gused and -gfull.
+ * config/i386/darwin.h (CC1_SPEC): Same.
+
+2004-06-07 Caroline Tice <ctice@apple.com>
+
+ * doc/invoke.texi (-fast): Add documentation for "-fast" option.
+
+2004-05-29 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_override_options): Enable
+ hot/cold partitioning with -fast -profile-use.
+
+2004-05-28 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3665286
+ * cpplex.c (_cpp_peek_token): Fix bug in computing context size;
+ increment/decrement 'keep_tokens' state instead of saving/restoring it.
+ * cpplib.h (cpp_callbacks): Change 'expand_macro_p' hook to
+ 'macro_to_expand', returning a cpp_hashnode pointer.
+ * cppmacro.c (cpp_get_token): Call 'macro_to_expand' hook instead of
+ 'expand_macro_p'.
+ (warn_of_redefinition): Do not warn if redefining a conditional macro.
+ * config/rs6000/rs6000-c.c (altivec_categorize_keyword): New function.
+ (rs6000_expand_macro_p): Renamed to 'rs6000_macro_to_expand'; rewritten
+ to call altivec_categorize_keyword() and return one of the three
+ canonical macros ('__vector', '__pixel' and '__bool') as needed.
+ (rs6000_cpu_cpp_builtins): Mark all AltiVec keyword variants as
+ conditional macros, some expanding to themselves (e.g., '#define
+ bool bool') by default.
+ * config/rs6000/rs6000-protos.h (rs6000_expand_macro_p): Renamed to
+ 'rs6000_macro_to_expand'.
+
+2004-05-28 Fariborz Jahanian <fjahanian@apple.com>
+
+ * explow.c (copy_to_mode_reg): For PARALLEL patterns, copy
+ to reg via a temprary.
+
+2004-05-27 Dale Johannesen <dalej@apple.com>
+
+ * loop-invariant.c (check_maybe_invariant): Disallow CALL hoists.
+ * varasm.c (assemble_start_function): Construct unlikely_section_label
+ unconditionally.
+
+2004-05-26 Caroline Tice <ctice@apple.com>
+
+ * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
+ Initialize variable 'has_hot_blocks'.
+ (fix_up_fall_thru_edges): Initialize variable'cond_jump'.
+ * cfgcleanup.c (try_forward_edges): Add code/tests to make sure the
+ optimization is not attempted across section boundaries.
+ * cfglayout.c (fixup_reorder_chain): Correct comments.
+ * cfgrtl.c (try_redirect_by_replacing_jump): Fix test to make sure
+ optimization is not attempted across section boundaries.
+ * final.c (final_scan_instruction): Replace calls to text_section with
+ calls to function_section.
+ * predict.c (probably_never_executed_bb_p): Change criterion to be
+ basic block count equals zero.
+ * varasm.c (unlikely_text_section_name): New global variable.
+ (text_section): Remove call to assemble_align.
+ (unlikely_text_section): Modify to build & use unlikely_text_section_name
+ rather than directly using UNLIKELY_EXECUTED_TEXT_SECTION NAME; remove
+ call to assemble_align; move code to free/initialize
+ unlikely_section_label to assemble_start_function.
+ (in_unlikely_text_section): Modify to use unlikely_text_section_name.
+ (named_section): Add code to initialize unlikely_text_section_name if
+ appropriate.
+ (function_section): Reorder clauses in if statement to make sure
+ functions containing only cold blocks end up in the correct section.
+ (assemble_start_function): Add code to correctly initialize/free
+ unlikely_text_section_name. Also make sure the cold label is printed
+ out at the start of cold functions.
+ (default_section_type_flags_1): Modify to use unlikely_text_section_name.
+ * config/rs6000/darwin.h (HAS_LONG_UNCOND_BRANCH): Add darwin-specific
+ definition, based on the TARGET_LONG_BRANCH (-mlongcall) flag.
+
+2004-05-25 Dale Johannesen <dalej@apple.com>
+
+ * tree-ssa-loop-niter.c: Add. New in lno branch. Oops.
+
+2004-05-25 Mike Stump <mrs@apple.com>
+
+ Radar 3665096
+ * config/i386/darwin.h (TARGET_SUBTARGET_DEFAULT): Change default
+ for long double type size to be 128.
+
+2004-05-25 Dale Johannesen <dalej@apple.com>
+
+ Merge from LNO branch as of 05-18.
+ --The following files are identical to lno branch:
+ df.c: Merge.
+ lambda-code.c: Merge.
+ loop-iv.c: Merge.
+ tree-chrec.c: Merge.
+ tree-chrec.h: Merge.
+ tree-data-ref.c: Merge.
+ tree-data-ref.h: Merge.
+ tree-elim-check.c: Merge.
+ tree-fold-const.h: Merge.
+ tree-scalar-evolution.c: Merge.
+ tree-scalar-evolution.h: Merge.
+ tree-ssa-loop-ivcanon.c: Merge.
+ tree-ssa-loop-ivopts.c: Merge.
+ tree-vectorizer.c: Merge.
+ --These files were merged selectively, see lno branch ChangeLog.lno.
+ Makefile.in: Add tree-ssa-loop-niter.
+ cfgloop.c: Merge changes from Devang's 05-13 patch.
+ cfgloop.h: Ditto, also Zdenek's 04-30 patch.
+ expr.c: Merge changes from Zdenek's 05-13 patch.
+ tree-cfg.c: Ditto.
+ tree-flow.h: Ditto. Also from Zdenek's 04-30 patch.
+ loop-invariant.c: Merge. Add DF_EQUIV_NOTES.
+ rtl.h: Merge change from Zdenek's 05-09 patch.
+ stor-layout.c: Ditto.
+ tree.c: Merge change from Sebastian's 04-27 patch.
+ tree.h: Ditto. Also Zdenek's 05-13 patch. Add TYPE_UNSIGNED.
+ varasm.c: Merge change from Zdenek's 04-30 patch.
+ config/rs6000/rs6000.c: Ditto.
+ -- Other stuff:
+ fold-const.c: Remove unused variable.
+ config/rs6000/rs6000-c.c: Make #define of bool work.
+ config/rs6000/t-rs6000: Make #define of bool work. Remove
+ -Wno-error requirements.
+
+2004-05-25 Mike Stump <mrs@apple.com>
+
+ Radar 3667005
+ * config/darwin.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Move long
+ double size default from here...
+ * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): to here.
+
+2004-05-24 Devang Patel <dpatel@apple.com>
+
+ Radar 3665390
+ * config/darwin-driver.h (main): While reinserting output filename
+ do not forget -o.
+
+2004-05-24 Mike Stump <mrs@apple.com>
+
+ Radar 3589079
+ * config/darwin.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Change default
+ for long double type size to be 128.
+ * c-common.c: Change default for -Wwarn-long-double to off.
+ (warn_about_long_double): Change wording to account for new long
+ double size.
+ * doc/invoke.texi (-Wlong-double): Likewise.
+
+2004-05-22 Devang Patel <dpatel@apple.com>
+
+ Radar 3644687
+ * config/darwin-driver.c (main): Reinsert output filename
+ only if user supplied one.
+
+2004-05-22 Dale Johannesen <dalej@apple.com>
+
+ * simplify-rtx.c (simplify_unary_operation): Don't create NOT(SYM)
+ or (MINUS(CON SYM)).
+ * config/rs6000/rs6000.h (machine_function): Make substitute_pic_base_reg
+ unsigned.
+ * config/rs6000/rs6000.md: Compare it to INVALID_REGNUM not -1.
+ * config/rs6000/rs6000.c (throughout): Ditto.
+
+2004-05-21 Ziemowit Laski <zlaski@apple.com>
+
+ * opts.c (common_handle_option): Do not const-qualify a char buffer
+ that has sprintf() and free() called on it.
+
+2004-05-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3621323
+ * c-lex.c: Do not include target.h.
+ (C_LEX_BUFCAPACITY, C_LEX_OFFS_BOUND, c_lex_buf_beg, c_lex_buf_end,
+ c_lex_buf, c_lex_peek, c_lex_prepend): Remove.
+ (get_nonpadding_token): Get rid of int argument; adjust call sites
+ accordingly.
+ * cpplex.c (_cpp_peek_token): New function.
+ (_cpp_temp_token): Account for existence of lookaheads when allocating
+ token.
+ * cpplib.h (cpp_callbacks): Add new 'expand_macro_p' hook.
+ (NODE_CONDITIONAL): New flag for macro nodes.
+ (_cpp_peek_token, _cpp_backup_tokens_direct): New prototypes.
+ * cppmacro.c (cpp_get_token): For macros marked NODE_CONDITIONAL,
+ call the 'expand_macro_p' predicate to see if they should be
+ expanded.
+ (_cpp_backup_tokens_direct): New function, broken off from
+ _cpp_backup_tokens().
+ (_cpp_backup_tokens): Call _cpp_backup_tokens_direct().
+ * config/rs6000/rs6000-c.c (rs6000_expand_macro_p): Add cpp_reader
+ parameter; call _cpp_peek_token() instead of c_lex_peek().
+ (rs6000_cpu_cpp_builtins): Attach rs6000_expand_macro_p() to a
+ cpplib callback instead of a target hook.
+ * config/rs6000/rs6000-protos.h (rs6000_expand_macro_p): Add cpp_reader
+ parameter to prototype.
+ * hooks.c (hook_bool_constcpp_tokenp_false): Remove.
+ * hooks.h (hook_bool_constcpp_tokenp_false): Remove prototype.
+ * target-def.h (TARGET_EXPAND_MACRO_P): Remove.
+ * target.h (gcc_target): Remove 'expand_macro_p' target hook.
+
+2004-05-20 Devang Patel <dpatel@apple.com>
+
+ * config/darwin-driver.c (main): Prepand "-Wl," before
+ -final_output to make it linker option.
+
+2004-05-20 Fariborz Jahanian <fjahanian.apple.com>
+
+ * c-opts.c (c_common_post_options): Remove old declaration and
+ use of stdin_filename. Add new call to set_stdin_option.
+ * common.opt: Add fpredictive-compilation=n option.
+ * cppfiles.c (STAT_SIZE_RELIABLE macro): Change definition.
+ (pch_open_file): No pch stuff with stdin file.
+ (find_file_in_dir): When opening the main file, revert
+ to opening stdin instead, in predictive compilation mode.
+ (read_file_guts): Support for reading from stdin for predictive
+ compilation sizes are added. (read_file): Don't close stdin.
+ (read_from_stdin): New routine.
+ * cpphash.h: New field declaration 'is_main_file' added.
+ * cppinit.c (cpp_read_main_file): Set is_main_file to true,
+ and then to false in predictive compilation mode.
+ * cpplex.c (_cpp_get_fresh_line): Read more from stdin when
+ in predictive compilation mode.
+ * cpplib.c (set_stdin_option): New definition.
+ * cpplib.h: Declaration updates.
+ * flags.h: Declaration of predictive_compilation.
+ * opts.c (common_handle_option): Processing -fprdictive-compilation=n
+ options.
+ * toplev.c: Definition of predictive_compilation added.
+
+2004-05-14 Dale Johannesen <dalej@apple.com>
+
+ * Makefile.in: Remove local -Wno-error dependencies.
+
+2004-05-13 Caroline Tice <ctice@apple.com>
+
+ * c-common.c (builtin_function_disabled_p): Remove "static" from
+ function declaration and definition.
+ * c-common.h (builtin_function_disabled_p): Add extern function
+ definition.
+ * c-decl.c (merge_translation_unit_decls): Add code to test
+ function decls to see if they are builtin and the builtin is
+ supposed to be disabled before attempting to merge the decls.
+
+2004-05-12 Devang Patel <dpatel@apple.com>
+
+ * opts.c (common_handle_option): Handle OPT_arch.
+
+2004-05-12 Devang Patel <dpatel@apple.com>
+
+ * config/darwin.h (darwin_builtins): Move to ...
+ * config/darwin.c (darwin_builtins); here.
+
+2004-05-12 Dale Johannesen <dalej@apple.com>
+
+ Radar 3509006
+
+ * config/rs6000/rs6000.c (rs6000_override_options):
+ Don't enable string insns with -Os.
+ * doc/invoke.texi: Document this behavior.
+ * testsuite/gcc.apple/string-insns.c: New.
+
+2004-05-12 Dale Johannesen <dalej@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_stack_info): Restore an
+ optimization lost in merge.
+
+2004-05-11 Ziemowit Laski <zlaski@apple.com>
+
+ * gcc.c (process_command): Do not define __CONSTANT_CFSTRINGS__,
+ since config/darwin.h already does this.
+ (do_spec_1): Emit "-mconstant-cfstrings" instead of
+ "-fconstant-cfstrings".
+
+2004-05-11 Devang Patel <dpatel@apple.com>
+
+ * gcc.c (optiom_map): Remove -precomp-trustfile support.
+ * c-opts.c (c_common_handle_option): Remove -precomp-trustfile and
+ -header-mapfile support.
+ * common.opt: Same.
+ * c.opt: Remove -header-mapfile support.
+
+2004-05-11 Caroline Tice <ctice@apple.com>
+
+ * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): Add this note back
+ in; it seems to have vanished during a merge.
+
+2004-05-10 Ziemowit Laski <zlaski@apple.com>
+
+ * config/rs6000/altivec.h: Bring over from mainline.
+ * config/rs6000/rs6000-c.c (rs6000_cpu_cpp_builtins): Define
+ __APPLE_ALTIVEC__ to indicate Apple syntax support.
+
+2004-05-10 Dale Johannesen <dalej@apple.com>
+ * config/darwin.c: ANSIfy syntax (eliminate warnings).
+ config/darwin-c.c: Ditto.
+ rs6000.c: Small cosmetic change in local code.
+
+2004-05-06 Caroline Tice <ctice@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_override_options): Modify to
+ not turn on hot/cold partitioning in the presence of exception
+ handling.
+
+2004-05-06 Dale Johannesen <dalej@apple.com>
+
+ * Merge from lno branch as of 04-24. Files changed:
+ lambda-code.c
+ lambda.h
+ tree-chrec.c
+ tree-chrec.h
+ tree-data-ref.c
+ tree-elim-check.c
+ tree-flow.h
+ tree-loop-linear.c
+ tree-scalar-evolution.c
+ tree-ssa-loop-im.c
+ tree-ssa-loop-ivopts.c
+ tree-ssa-loop-manip.c
+ tree-ssa-loop.c
+ tree-vectorizer.c
+ tree-vectorizer.h
+
+2004-05-04 Caroline Tice <ctice@apple.com>
+
+ * config/rs6000/darwin.h (FP_SAVE_INLINE): Modify this to
+ always be 1 ("on") if the optimization level is -O3 or
+ higher.
+
+2004-04-30 Dale Johannesen <dalej@apple.com>
+
+ * cse.c (cse_insn): Don't add REG_EQUAL note for
+ (CONST (MINUS (LABEL_REF) (0))).
+
+2004-04-30 Caroline Tice <ctice@apple.com>
+
+ * varasm.c (unlikely_section_label): New global variable.
+ (unlikely_text_section): Change variable name from
+ 'unlikely_section_name' to 'unlikely_section_label', make it a global
+ variable, and move the code to generate its value to
+ assemble_start_function.
+ (assemble_start_function): Add code to generate *correct* value for
+ 'unlikely_section_label'. Now makes use of value from 'fnname'
+ parameter.
+
+2004-04-29 Devang Patel <dpatel@apple.com>
+
+ gcc/loop-iv.c : Merge from lno-branch as of 2004:04:19 00:00.
+ gcc/tree-pass.h : Merge from lno-branch as of 2004:04:19 00:00.
+ gcc/tree-ssa-alias.c : Merge from lno-branch as of 2004:04:19 00:00.
+ gcc/tree-ssa-phiopt.c : Merge from lno-branch as of 2004:04:19 00:00.
+
+2004-04-29 Devang Patel <dpatel@apple.com>
+
+ Merge lno-branch as of 2004:04:18 00:00 into
+ apple-ppc-branch.
+
+
+2004-04-28 Fariborz Jahanian <fjahanian@apple.com>
+
+ * function.c (assign_parms): Add 2nd iteration over vector args
+ if needed.
+ * calls.c (initialize_argument_information): Add new argument,
+ add 2nd iteration over vector arguments if needed.
+ * target-def.h (default_skip_vec_args, TARGET_SKIP_VEC_ARGS): New.
+ * target.h (skip_vec_args): Added to calls structure.
+ * targhooks.c (default_skip_vec_args): Default
+ definition.
+ * targhooks.h (default_skip_vec_args): Declaration.
+ * config/rs6000/rs6000.c (skip_vec_args): New definition.
+
+2004-04-28 Stuart Hastings <stuart@apple.com>
+
+ * config/rs6000/rs6000.c (macho_branch_islands): Fix sprintf arguments.
+ * config/rs6000/rs6000.md (output_call): Fix arguments.
+
+2004-04-27 Devang Patel <dpatel@apple.com>
+
+ * config/darwin.h (LINK_COMMAND_SPEC): Use darwin_arch_ld_spec.
+ * config/rs6000/darwin.h (DARWIN_ARCH_ASM_SPEC): New.
+ (DARWIN_ARCH_SPEC): Rename as...
+ (DARWIN_ARCH_LD_SPEC): New name.
+ * config/i386/darwin.h (DARWIN_ARCH_ASM_SPEC): New.
+ (DARWIN_ARCH_SPEC): Rename as...
+ (DARWIN_ARCH_LD_SPEC): New name.
+
+2004-04-26 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * configure.ac: Add test for -Wno-long-double.
+ * Makefile.in (STRICT2_WARN): Add -Wno-long-double.
+ (alloc-pool.o-warn): Delete.
+ (ggc-page.o-warn): Delete.
+ * configure: Regenerate.
+
+2004-04-23 Dale Johannesen <dalej@apple.com>
+
+ Radars 3480058, 3178986
+
+ * c-decl.c (merge_decls): Preserve duplicate_decl bit.
+ (merge_translation_unit_decls): Rewritten so -fno-common works.
+ * opts.c (decode_options): Turn on flag_no_common with -fast or -fastcp.
+ * tree.h (struct tree_decl): Add duplicate_decl bit and DECL_DUPLICATE_DECL.
+ * varasm.c (assemble_variable): Use it.
+ * config/rs6000/rs6000.c (rs6000_override_options): Remove
+ reorder-blocks-and-partition from -fast*. Enable align-natural with -fastcp.
+ * ../libstdc++-v3/include/std/std_fstream.h (basic_ifstream): Make
+ _M_filebuf 8-byte aligned.
+ (basic_ofstream): Ditto.
+
+2004-04-22 Devang Patel <dpatel@apple.com>
+
+ Radar 3401402 and 3511029
+
+ Remove FAT Build support from gcc.c
+
+ * gcc.c (struct arch_config_out): Remove.
+ (struct arch_out): Remove.
+ (num_arches, curent_arch, final_output): Remove.
+ (set_new_arch): Remove.
+ (%T support): Remove.
+ (%f support): Remove.
+ (%F support): Remove.
+ ('@' support in specs): Remove.
+ (ofile_merge_spec): Remove.
+ (exec_merge_spec): Remove.
+ (build_search_list): Remove fat builds readibility change.
+ (SWITCH_IGNORE_RESTORE): Remove.
+ (-arch support): Remove.
+ * config/darwin.h (LINK_COMMAND_SPEC): Remove -arch*. Add %(darwin_arch_spec).
+ * confiig/i386/darwin.h (ASM_SPEC): Add %(darwin_arch_spec).
+ (DARWIN_ARCH_SPEC): New.
+ * confiig/rs6000/darwin.h (ASM_SPEC): Add %(darwin_arch_spec).
+ (DARWIN_ARCH_SPEC): New.
+ * config/rs6000/rs6000.h (SUBTARGET_EXTRA_SPECS): Surround it with #ifndef.
+ * config/darwin-driver.c: New file.
+
+2004-04-20 Geoffrey Keating <geoffk@apple.com>
+
+ * c-cppbuiltin.c (define__GNUC__): Better precision and more
+ error checking for code defining __APPLE_CC__.
+ * testsuite/gcc.apple/applecc.c: New.
+
+2004-04-15 Devang Patel <dpatel@apple.com>
+
+ * config/i386.h: Add static tree nodes for vector types to
+ accomodate tree.h changes due to local Altivec patch.
+
+2004-04-15 Caroline Tice <ctice@apple.com>
+
+ Fix various problems related to hot/cold partitioning (but not all of
+ them yet).
+ * bb-reorder.c (tm_p.h): Add new include statement.
+ (HAVE_return): Define HAVE_return appropriately if not already defined.
+ (find_rarely_executed_basic_blocks_and_crossing_edges): Modify to
+ only mark crossing edges if architecture supports named sections.
+ (fix_crossing_conditional_branches): Add test for HAVE_return before
+ calling gen_return.
+ (fix_crossing_unconditional_branches): Change VOIDmode to Pmode in call
+ to gen_rtl_LABEL_REF.
+ (fix_edges_for_rarely_executed_code): Only "fix" branches and add
+ REG_CROSSING_JUMP notes if the architecture supports named sections.
+ (reorder_basic_blocks): Change (* targetm.cannot_modify_jumps_p ())
+ into (targetm.cannot_modify_jumps_p ()). Modify to only add
+ NOTE_INSN_UNLIKELY_EXECUTED_CODE notes if the architecture supports
+ named sections.
+ * cfglayout.c (fixup_reorder_chain): Modify code that adds
+ NOTE_INSN_UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes, to only
+ do so if architecture supports named sections.
+ * cfgrtl.c (target.h): Add new include statement.
+ (force_nonfallthru_and_redirect): Modify code that adds
+ NOTE_INSN_UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes, to only
+ do so if architecture supports named sections.
+ (commit_one_edge_insertion): Likewise.
+ * dbxout.c (dbxout_source_file): Fix bug, when writing out source
+ location debug information, to not change to the wrong section.
+ * defaults.h (NORMAL_TEXT_SECTION_NAME): Remove this definition.
+ (SECTION_FORMAT_STRING): Remove this definition.
+ * final.c (final_scan_insn): Remove unnecessary in_unlikely_text_section
+ test from if statement. Modify code that switches sections to not
+ do so if architecture does not support named sections. Cleaned up
+ if statement.
+ * ifcvt.c (if_convert): Modified test that disables optimization when
+ partitioning, to not disable it if the architecture does not support
+ named sections.
+ * passes.c (rest_of_compilation): Removed flag_exceptions test from
+ code that calls partitioning, as this is already taken care of
+ in decode_options.
+ * predict.c (choose_function_section): Modify to NOT choose hot or
+ cold sections for the function decl if we are doing partitioning
+ optimization (want to leave it up to the hot/cold partitioning
+ optimization, which is more fine-grained).
+ * varasm.c (text_section): Restore code that outputs assembly for
+ the text section to its original code.
+ (unlikely_text_section): Modify to always use named_section for
+ writing out section directive, remove unnecessary ifdef, and
+ use ASM_OUTPUT_LABEL for labelling the start of the
+ cold section.
+ (in_unlikely_text_section): Modify to deal correctly with being in
+ a named section.
+ (function_section): Restore code for generating section directives
+ to its original order.
+ * config/darwin.c (darwin_asm_named_section): Restore code that
+ generates section directive to its original state.
+ * config/i386/darwin.h (ASM_OUTPUT_ALIGN): Add in_unlikely_text_section ()
+ to an if test that tests for in_text_section ().
+ * config/rs6000/darwin.h (NORMAL_TEXT_SECTION_NAME): Remove definition.
+ (SECTION_FORMAT_STRING): Remove definition.
+
+2004-04-10 Paolo Bonzini <bonzini@gnu.org>
+ Richard Henderson <rth@redhat.com>
+
+ PR target/14899
+
+ * c-common.c (vector_types_compatible_p): New function.
+ * c-typeck.c (comptypes): Recurse on vector types,
+ treat a non-opaque type as equivalent to an opaque type.
+ (convert_for_assignment): Use vector_types_compatible_p.
+ (digest_init): Use vector_types_compatible_p to check
+ validness of constant vector initializers; otherwise treat
+ them as scalars
+ * tree.c (make_or_reuse_type): New.
+ (build_common_tree_nodes): Use it.
+ * cp/call.c (standard_conversion): Likewise.
+ * cp/typeck.c (comptypes): Recurse on vector types, do not
+ treat a non-opaque type as equivalent to an opaque type.
+ (convert_for_assignment): Use vector_types_compatible_p.
+
+2004-04-13 Fariborz Jahanian <fjahanian@apple.com>
+
+ * combine.c (combine_instructions):
+ Try insn with each REG_EQUAL note it links back to.
+ (unmentioned_reg_p_1, unmentioned_reg_p): New functions.
+ Brought from tree-ssa branch.
+
+2004-04-09 Dale Johannesen <dalej@apple.com>
+
+ Roll in gcc-1552 enhancement for separate stack temps.
+ Turn on -fstrict-aliasing with -fast.
+ * function.c (assign_stack_local_with_alias): New function.
+ * rtl.h (assign_stack_local_with_alias): Declare it.
+ * config/rs6000/rs6000.c (rs6000_override_options): Turn on strict
+ aliasing with -fast.
+ * config/rs6000/rs6000.md (floatsidf2): Use
+ assign_stack_local_with_alias.
+ (floatunssidf2): Ditto.
+ (fix_truncdfsi2): Ditto.
+
+2004-04-07 Fariborz Jahanian <fjahanian@apple.com>
+
+ Roll in Ziem Laski's Altivec front-end fixes to
+ support MOTOROLA's Altivec syntax.
+ * Makefile.in: Add c-lex.o dependencies.
+ * c-common.c (vector_constructor_from_expr): New function.
+ * c-common.h (vector_constructor_from_expr): Add declaration.
+ * c-lex.c: include target.h, cpphash.h. Add lexer support
+ for new syntax.
+ (c_lex_prepend): new function. (c_lex_peek): new function.
+ * c-pragma.h: add (c_lex_peek, c_lex_prepend) declarations.
+
+2004-04-06 Dale Johannesen <dalej@apple.com>
+
+ Roll in Zdenek Dvorak's rewrite of doloop optimization.
+ * Makefile.in: add loop-doloop.*, remove doloop.*
+ * loop-doloop.c: New.
+ * doloop.c: Remove.
+ * cfgloop.h: Add new function declarations.
+ * cfgloopanal.c: Add get_loop_level.
+ * loop-iv.c: Recognize unexecuted loops.
+ * loop.c: Remove call to old doloop optimization.
+ * loop.h: Remove LOOP_BCT.
+ * passes.c: Ditto. Call new doloop optimization.
+ * config/rs6000/rs6000-protos.h: Remove duplicate declarations.
+ * config/rs6000/rs6000.c: Cosmetic cleanups. Add -freorder-blocks
+ to -fast.
+
+2004-04-02 Ziemowit Laski <zlaski@apple.com>
+
+ Remove APPLE LOCAL AltiVec code whenever possible; merge in
+ AltiVec/VECTOR_TYPE-handling code from mainline.
+
+2004-04-01 Fariborz Jahanian <fjahanian@apple.com>
+
+ * Makefile.in: add $(PARAMS_H) $(TM_P_H) dependencies
+ for sched-rgn.o.
+ * params.def: add definitions for
+ max-sched-region-blocks and max-sched-region-insns.
+ * sched-rgn.c (too_large): change return type to bool.
+ Use the parametrized values of max-sched-region-blocks,
+ max-sched-region-insns for computing upper limits for
+ interblock scheduling.
+ * doc/invoke.texi: Document max-sched-region-blocks,
+ max-sched-region-insns.
+
+2004-04-01 Caroline Tice <ctice@apple.com>
+
+ * basic-block.h (struct edge_def): Add new field, crossing_edge.
+ (struct basic_block_def): Add new field, partition.
+ (UNPARTITIONED, HOT_PARTITION, COLD_PARTITION): New constant macro
+ definitions.
+ (partition_hot_cold_basic_blocks): Add extern function
+ declaration.
+ * bb-reorder.c (function.h, obstack.h, expr.h, regs.h): Add four new
+ include statements.
+ (N_ROUNDS): Increase the maximum number of rounds by 1.
+ (branch_threshold): Add array value for new round.
+ (exec_threshold): Add array value for new round.
+ (push_to_next_round_p): New function.
+ (add_unlikely_executed_notes): New function.
+ (find_rarely_executed_basic_blocks_and_crossing_edges): New function.
+ (mark_bb_for_unlikely_executed_section): New function.
+ (add_labels_and_missing_jumps): New function.
+ (add_reg_crossing_jump_notes): New function.
+ (fix_up_fall_thru_edges): New function.
+ (find_jump_block): New function.
+ (fix_crossing_conditional_branches): New function.
+ (fix_crossing_unconditional_branches): New function.
+ (fix_edges_for_rarely_executed_code): New function.
+ (partition_hot_cold_basic_blocks): New function.
+ (find_traces): Add an extra round for partitioning hot/cold
+ basic blocks.
+ (find_traces_1_round): Add a parameter. Modify to push all cold blocks,
+ and only cold blocks, into the last (extra) round of collecting traces.
+ (better_edge_p): Add a parameter. Modify to favor non-crossing edges
+ over crossing edges.
+ (bb_to_key): Add code to correctly identify cold blocks when
+ doing partitioning.
+ (connect_traces): Modify to connect all the non-cold traces first, then
+ go back and connect up all the cold traces.
+ (reorder_basic_blocks): Add call to add_unlikely_executed_notes.
+ * cfg.c (entry_exit_blocks): Add initialization for partition field in
+ entry and exit blocks.
+ * cfgbuild.c (make_edges): Update current_function_has_computed_jump
+ if we are doing hot/cold partitioning.
+ * cfgcleanup.c (cfglayout.h): Add new include statement.
+ (try_simplify_condjump): Modify to not attempt on blocks with jumps
+ that cross section boundaries.
+ (try_forward_edges): Likewise.
+ (merge_blocks_move_predecessor_nojumps): Likewise.
+ (merge_blocks_move_successor_nojumps): Likewise.
+ (merge_blocks_move): Likewise.
+ (try_crossjump_to_edge): Modify to not attempt after we have done
+ the block partitioning.
+ (try_crossjump_bb): Modify to not attempt on blocks with jumps that
+ cross section boundaries.
+ (try_optimize_cfg): Likewise.
+ * cfghooks.c (tidy_fallthru_edges): Modify to not remove indirect
+ jumps that cross section boundaries.
+ * cfglayout.c (flags.h): Add new include statement.
+ (update_unlikely_executed_notes): New function.
+ (fixup_reorder_chain): Add code so when a new jumping basic block is
+ added, it's UNLIKELY_EXECUTED_CODE and REG_CROSSING_JUMP notes are
+ updated appropriately.
+ (duplicate_insn_chain): Add code to duplicate the new NOTE insn
+ introduced by this optimization.
+ * cfglayout.h (scan_ahead_for_unlikely_executed_note): Add new
+ extern function declaration.
+ * cfgrtl.c (can_delete_note_p): Add NOTE_INSN_UNLIKELY_EXECUTED_CODE to
+ list of notes that can be deleted.
+ (create_basic_block_structure): Add initialization for partition field.
+ (rtl_can_merge_blocks): Modify to test blocks for jumps that cross
+ section boundaries.
+ (try_redirect_by_replacing_jump): Modify to not attempt on jumps that
+ cross section boundaries.
+ (commit_one_edge_insertion): Add code so newly created basic block
+ ends up in correct (hot or cold) section. Modify to disallow
+ insertions before NOTE_INSN_UNLIKELY_EXECUTED_CODE notes.
+ (rtl_verify_flow_info_1): Add code to verify that no fall_thru edge
+ crosses section boundaries.
+ (cfg_layout_can_merge_blocks_p): Modify to test blocks for jumps that
+ cross section boundaries.
+ (force_nonfallthru_and_redirect): Modify to make sure new basic block
+ ends up in correct section, with correct notes attached.
+ * common.opt (freorder-blocks-and-partition): Add new flag for this
+ optimization.
+ * dbxout.c (dbx_function_end): Add code to make sure scope labels at
+ the end of functions are written into the correct (hot or cold)
+ section.
+ (dbx_source_file): Add code so writing debug file information
+ doesn't incorrectly change sections.
+ * defaults.h (NORMAL_TEXT_SECTION_NAME): New constant macro, for use
+ in partitioning hot/cold basic blocks into separate sections.
+ (SECTION_FORMAT_STRING): New constant macro, for linux/i386 hot/cold
+ section partitioning.
+ (HAS_LONG_COND_BRANCH): New constant macro, indicating whether or not
+ conditional branches can span all of memory.
+ (HAS_LONG_UNCOND_BRANCH): New constant macro, indicationg whether or not
+ unconditional branches can span all of memory.
+ * final.c (scan_ahead_for_unlikely_executed_note): New function.
+ (final_scan_insn): Add code to check for NOTE instruction indicating
+ whether basic block belongs in hot or cold section, and to make sure
+ the current basic block is being written to the appropriate section.
+ Also added code to ensure that jump table basic blocks end up in the
+ correct section.
+ * flags.h (flag_reorder_blocks_and_partition): New flag.
+ * ifcvt.c (find_if_case_1): Modify to not attempt if conversion if
+ one of the branches has a jump that crosses between sections.
+ (find_if_case_2): Likewise.
+ (ifcvt): Modify to not attempt to mark loop exit edges after
+ hot/cold partitioning has occurred.
+ * opts.c (decode_options): Code to handle new flag,
+ flag_reorder_blocks_and_partition; also to turn it off if
+ flag_exceptions is on.
+ (common_handle_option): Code to handle new flag,
+ flag_reorder_blocks_and_partition.
+ * output.h (unlikely_text_section): New extern function declaration.
+ (in_unlikely_text_section): New extern function declaration.
+ * passes.c (rest_of_handle_stack_regs): Add
+ flag_reorder_blocks_and_partition as an 'or' condition for calling
+ reorder_basic_blocks.
+ (rest_of_handle_reorder_blocks): Add flag_reorder_blocks_and_partition
+ as an 'or' condition for calling reorder_basic_blocks.
+ (rest_of_compilation): Add call to partition_hot_cold_basic_blocks.
+ * print-rtl.c (print_rtx): Add code for handling new note,
+ NOTE_INSN_UNLIKELY_EXECUTED_CODE
+ * rtl.c (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note insn (see below).
+ (REG_CROSSING_JUMP): New kind of reg_note, to mark jumps that
+ cross between section boundaries.
+ * rtl.h (NOTE_INSN_UNLIKELY_EXECUTED_CODE): New note instruction,
+ indicating the basic block containing it belongs in the cold section.
+ (REG_CROSSING_JUMP): New type of reg_note, to mark jumps that cross
+ between hot and cold sections.
+ * toplev.c (flag_reorder_blocks_and_partition): Add code to
+ initialize this flag, and to tie it to the command-line option
+ freorder-blocks-and-partition.
+ * varasm.c (cfglayout.h): Add new include statement.
+ (unlikely_section_label_printed): New global variable, used for
+ determining when to output section name labels for cold sections.
+ (in_section): Add in_unlikely_executed_text to enum data structure.
+ (text_section): Modify code to use SECTION_FORMAT_STRING and
+ NORMAL_TEXT_SECTION_NAME macros.
+ (unlikely_text_section): New function.
+ (in_unlikely_text_section): New function.
+ (function_section): Add code to make sure beginning of function is
+ written into correct section (hot or cold).
+ (assemble_start_function): Add code to make sure stuff is written to
+ the correct section.
+ (assemble_zeros): Add in_unlikely_text_section as an 'or' condition
+ to an if statement that was checking 'in_text_section'.
+ (assemble_variable): Add 'in_unlikely_text_section' as an 'or'
+ condition to an if statement that was checking 'in_text_section'.
+ (default_section_type_flags_1): Add check: if in cold section
+ flags = SECTION_CODE.
+ * config/darwin.c (darwin_asm_named_section): Modify to use
+ SECTION_FORMAT_STRING if we are partitioning hot/cold blocks.
+ * config/i386/i386.h (HAS_LONG_COND_BRANCH): Defined this macro
+ specifically for the i386.
+ (HAS_LONG_UNCOND_BRANCH): Defined this macro specifically for the i386.
+ * config/rs6000/darwin.h (UNLIKELY_EXECUTED_TEXT_SECTION_NAME): Change
+ text string to something more informative.
+ (NORMAL_TEXT_SECTION_NAME): Add new definition.
+ (SECTION_FORMAT_STRING): Add new definition.
+ * config/rs6000/rs6000.c (rs6000_assemble_integer): Add
+ '!in_unlikely_text_section' as an 'and' condition to an if statement
+ that was already checking '!in_text_section'.
+ (rs6000_override_options): Turn on flag_reorder_blocks_and_partition
+ with "-fast".
+ * config/rs6000/sysv4.h (HOT_TEXT_SECTION_NAME,NORMAL_TEXT_SECTION_NAME,
+ UNLIKELY_EXECUTED_TEXT_SECTION_NAME,SECTION_FORMAT_STRING): Make
+ sure these are properly defined for linux on ppc.
+ * doc/invoke.texi (freorder-blocks-and-partition): Add documentation
+ for this new flag.
+ * doc/rtl.texi (REG_CROSSING_JUMP): Add documentation for new
+ reg_note.
+ * doc/tm.texi (NORMAL_TEXT_SECTION_NAME, SECTION_FORMAT_STRING,
+ HAS_LONG_COND_BRANCH, HAS_LONG_UNCOND_BRANCH): Add documentation for
+ these new macros.
diff --git a/gcc/ChangeLog.lno b/gcc/ChangeLog.lno
new file mode 100644
index 00000000000..d20a04f1cd8
--- /dev/null
+++ b/gcc/ChangeLog.lno
@@ -0,0 +1,3390 @@
+APPLE LOCAL file lno
+2004-07-18 Sebastian Pop <pop@cri.ensmp.fr>
+
+ Merge from mainline (lno-merge-20040718).
+
+2004-07-17 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (tree-cfg.o): Add CFGLAYOUT_H dependency.
+ * loop-init.c (loop_optimizer_init, loop_optimizer_finalize): Do not
+ free the dominators.
+ * passes.c (rest_of_handle_loop2): Free the dominators.
+ * sched-rgn.c (compute_trg_info): Initialize fields of variable el.
+ * tree-cfg.c: Include cfglayout.h.
+ (tree_duplicate_bb): Copy also phi nodes.
+ (struct ssa_name_map_entry): New type.
+ (collect_defs, add_phi_args_after_copy, ssa_name_map_entry_hash,
+ ssa_name_map_entry_eq, allocate_ssa_names,
+ rewrite_to_new_ssa_names_def, rewrite_to_new_ssa_names_use,
+ rewrite_to_new_ssa_names, tree_duplicate_sese_region): New functions.
+ * tree-flow.h (tree_duplicate_sese_region): Declare.
+ * tree-ssa-loop-ch.c (mark_defs_for_rewrite, duplicate_blocks): Removed.
+ (copy_loop_headers): Use tree_duplicate_sese_region.
+ * tree-ssa-loop-manip.c (copy_phi_nodes): Only copy the phi node
+ arguments.
+ * tree-ssa-pre.c (gate_pre): Disable the optimization.
+
+2004-07-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_is_simple_use): Additional argument.
+ (vect_is_supportable_op): Call vect_is_simple_use with extra argument.
+ (vect_is_supportbale_store): Likewise.
+ (vect_is_supportbale_assignment): Likewise.
+ (vect_mark_stmts_to_be_vectorized): Cleanup - use vect_is_simple_use.
+ (vect_get_vec_def_for_operand): Cleanup.
+
+ (vect_analyze_data_refs): Support certain forms of COMPONENT_REF as
+ array_base. Use force_gimple in handling of data-refs.
+ (vect_force_dr_alignment_p): Support certain forms of COMPONENT_REF.
+ (vect_align_data_ref): Likewise.
+ (vect_analyze_data_ref_dependence): Likewise.
+
+ (vect_analyze_operations): Remove duplicate calls to vect_debug_details.
+ (vect_analyze_scalar_cycles): Likewise.
+ (vect_analyze_data_ref_dependence): Likewise.
+ (vect_analyze_data_refs_alignment): Likewise.
+ (vect_analyze_pointer_ref_access): Likewise.
+ (vect_analyze_pointer_ref_access): Likewise.
+ (vect_analyze_data_refs): Likewise.
+ (vect_analyze_loop_form): Likewise.
+
+2004-07-13 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-data-ref.c: Fix some comments for inclusion in mainline.
+ (tree_fold_gcd): Moved...
+ * tree.c (tree_fold_gcd): ...here.
+ * tree.h (tree_fold_gcd): Declared here.
+
+2004-07-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-niter.c (mark_maybe_infinite_loops): Handle abnormal
+ edges.
+
+2004-07-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (tree-ssa-loop.o, tree-ssa-dce.o): Add function.h
+ dependency.
+ * builtins.c (expand_builtin): Handle BUILT_IN_MAYBE_INFINITE_LOOP.
+ * builtins.def (BUILT_IN_MAYBE_INFINITE_LOOP): New builtin.
+ * function.h (struct function): Add marked_maybe_inf_loops field.
+ * timevar.def (TV_MARK_MILOOPS): New timevar.
+ * tree-flow.h (mark_maybe_infinite_loops): Declare.
+ * tree-optimize.c (init_tree_optimization_passes): Add
+ pass_mark_maybe_inf_loops.
+ * tree-pass.h (pass_mark_maybe_inf_loops): Declare.
+ * tree-ssa-dce.c: Include function.h.
+ (find_obviously_necessary_stmts): Mark back edges only if they were
+ not marked already.
+ (perform_tree_ssa_dce): Do not call mark_dfs_back_edges here.
+ * tree-ssa-loop-niter.c (unmark_surely_finite_loop,
+ mark_maybe_infinite_loops): New functions.
+ * tree-ssa-loop.c: Include function.h.
+ (tree_mark_maybe_inf_loops, gate_tree_mark_maybe_inf_loops,
+ pass_mark_maybe_inf_loops): New pass.
+ * tree-ssa-operands.c (function_ignores_memory_p): Add
+ BUILT_IN_MAYBE_INFINITE_LOOP.
+
+2004-07-12 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * Makefile.in (tree-scalar-evolution.o): Remove dependences on
+ tree-vectorizer.h and tree-data-ref.h.
+ (tree-data-ref.o): Add dependence on lambda.h.
+ * lambda-trans.c, lambda.h: Add missing copyright notice.
+ * tree-scalar-evolution.c: Don't include tree-data-ref.h and
+ tree-vectorizer.h. Fix some comments.
+ * tree-scalar-evolution.h (simple_iv): Modified to match the
+ declaration that is in mainline.
+
+2004-07-11 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c: Update documentation. Use '#ifdef
+ ENABLE_CHECKING' to guard checks that are expected to have been
+ verified during analysis. Use vect_debug_details/vect_debug_stats
+ for dumping information.
+
+ * tree-vectorizer.h (struct _stmt_vec_info): New field "memtag".
+ (STMT_VINFO_MEMTAG): Access macro for new field "memtag".
+ * tree-vectorizer.c (vect_create_data_ref): Get tag from new field.
+ (vect_analyze_data_refs): Record the tag in the new memtag field.
+
+ (vect_align_data_ref): Remove unused argument.
+ (vect_analyze_data_refs): Call vect_align_data_ref with one argument.
+ (vect_get_array_first_index): Additional argument to return the
+ index rather than as the return value of the function.
+ (create_index_for_array_ref): Call vect_get_array_first_index with
+ an extra argument.
+ (vect_create_data_ref): Remove unused argument.
+ (vect_debug_stats, vect_debug_details): Argument "string" removed.
+
+ (vect_analyze_pointer_ref_access): New function.
+ (vect_analyze_data_refs): Call vect_analyze_pointer_ref_access.
+
+ (vect_finish_stmt_generation): New function.
+ (vect_transform_assignment, vect_transform_op, vect_transform_store):
+ (vect_transform_load): Call vect_finish_stmt_generation.
+
+ (get_vectype_for_scalar_type): No need to iterate through the
+ different modes - build_vector_type already does that.
+
+ (vect_transform_loop_bound): Check which edge is actually the 'then'.
+
+ (vect_analyze_operations): Temporarily disable vectorization of loops
+ with unknown loop bound.
+
+2004-07-10 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (determine_biv_step): Use simple_iv.
+
+2004-07-09 Devang Patel <dpatel@apple.com>
+
+ * Makefile.in (tree-ssa-loop-manip.o): Add tree-scalar-evolution.h
+ dependency.
+ * tree-scalar-evolution.c (scev_rest): Check scalar_evolution_info
+ and current_loops.
+ * tree-ssa-loop-manip.c (tree-scalar-evolution.h): Include.
+ (tree_duplicate_loop_to_header_edge): scev_reset () in the end.
+
+2004-07-09 Steven Bosscher <stevenb@suse.de>,
+ Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-pre.c: Merge changes from mainline.
+
+2004-07-09 Steven Bosscher <stevenb@suse.de>
+
+ * varray.h (varray_data_enum): Remove VARRAY_DATA_DG.
+
+2004-07-08 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * varray.c (element): Don't include dependence_node_def.
+
+2004-07-08 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * Makefile.in (OBJS-common): Remove tree-dg.o.
+ (tree-dg.o): Removed.
+ (GTFILES): Remove tree-dg.h.
+ * gengtype.c (open_base_files): Remove tree-dg.h.
+ * tree-data-ref.c (subscript_dependence_tester): Don't define.
+ (dump_data_dependence_relation): Print data references only
+ when they are not NULL.
+ (analyze_array_top): Removed.
+ (initialize_data_dependence_relation): Is extern now.
+ When the data references are NULL the relation is not known.
+ (compute_affine_dependence): Is extern now.
+ (find_data_references_in_loop): Returns chrec_dont_know when
+ failing to analyze a difficult case.
+ (compute_data_dependences_for_loop): Terminate earlier when
+ find_data_references_in_loop fails.
+ * tree-data-ref.h (data_dependence_relation): Update comments.
+ (initialize_data_dependence_relation, compute_affine_dependence):
+ Declared extern.
+ * tree-dg.c, tree-dg.h: Removed.
+ * tree-flow-inline.h (dg_node_for_stmt): Removed.
+ * tree-flow.h: Don't include tree-dg.h.
+ (stmt_ann_d): Remove dependence_node field.
+ * tree-ssa-loop.c: Include tree-data-ref.h.
+ (tree_vectorize, tree_linear_transform): Don't construct the dg_graph.
+ * tree-vectorizer.c: Remove some declarations of static functions.
+ (vect_analyze_data_ref_dependence): Extra parameter for the vectorized
+ loop. Don't rely on the information provided by the data
+ reference structure. Compute directly the relation between
+ the data references instead of querying this information in
+ the dg_graph.
+ (vect_analyze_data_ref_dependences): Pass to
+ vect_analyze_data_ref_dependence the information about the
+ vectorized loop.
+ * varray.h (varray_data_tag): Remove dependence_node_def.
+
+2004-07-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (cand_value_at): Handle types correctly.
+ (may_eliminate_iv): Verify there is no overflow.
+
+2004-07-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (find_bivs, find_givs_in_stmt_scev):
+ Ensure that step of the iv satisfies cst_and_fits_in_hwi.
+ (determine_use_iv_cost_outer): Preserve the fact that the cost
+ is infinity.
+ * tree-ssa-loop-prefetch.c (WRITE_CAN_USE_READ_PREFETCH,
+ READ_CAN_USE_WRITE_PREFETCH, HAVE_FORWARD_PREFETCH,
+ HAVE_BACKWARD_PREFETCH, ACCEPTABLE_MISS_RATE): New macros.
+ (struct mem_ref_group): Type of step changed to HOST_WIDE_INT.
+ (struct mem_ref): Type of delta changed to HOST_WIDE_INT.
+ (dump_mem_ref, find_or_create_group, record_ref,
+ struct ar_data, idx_analyze_ref, analyze_ref,
+ gather_memory_references_ref, issue_prefetch_ref): Updated to reflect
+ this.
+ (ddown): New function.
+ (prune_ref_by_self_reuse, prune_ref_by_group_reuse):
+ Implement.
+ (prune_ref_by_reuse): Use WRITE_CAN_USE_READ_PREFETCH and
+ READ_CAN_USE_WRITE_PREFETCH.
+ (prune_group_by_reuse): Add dumps.
+ (issue_prefetch_ref): Assert that PREFETCH_BLOCK is a power of 2.
+ * tree.c (cst_and_fits_in_hwi): Update comment and fix semantics.
+ (int_cst_value, build_int_cst): Check that we use them only for
+ types representable in HOST_WIDE_INT.
+
+2004-07-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ Remove bogus check for chrec_contains_undetermined.
+
+2004-07-06 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * basic-block.h (edge_source, edge_destination): Removed.
+ * cfgloop.c (superloop_at_depth): Fix comment.
+ * cfgloop.h (loop_from_num, outer_loop, inner_loop, next_loop,
+ loop_num, loop_depth, loop_header, loop_nb_iterations,
+ loop_num_exits, loop_exit_edges, loop_exit_edge): Removed.
+ * lambda-code.c, tree-cfg.c, tree-data-ref.c, tree-dg.c,
+ tree-elim-check.c, tree-scalar-evolution.c, tree-ssa-dom.c,
+ tree-ssa-loop-ivcanon.c, tree-vectorizer.c: Inline removed functions.
+ * tree-data-ref.c: Rewrite some comments.
+ * tree-flow-inline.h (loop_of_stmt): Renamed loop_containing_stmt.
+
+2004-07-04 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_create_data_ref, vect_init_vector):
+ Use insert_on_edge to add code in loop preheader.
+ (vect_transform_loop): Make sure there's a preheader BB.
+
+2004-06-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-prefetch.c: New file.
+ * Makefile.in (tree-ssa-loop-prefetch.o): Add.
+ * timevar.def (TV_TREE_PREFETCH): New.
+ * tree-flow.h (tree_ssa_prefetch_arrays,
+ standard_iv_increment_position): Declare.
+ * tree-optimize.c (init_tree_optimization_passes): Add
+ pass_loop_prefetch.
+ * tree-pass.h (pass_loop_prefetch): Declare.
+ * tree-ssa-loop-ivcanon.c (estimate_loop_size): Force the size to be
+ nonzero.
+ * tree-ssa-loop-ivopts.c (cst_and_fits_in_hwi): Moved to tree.c.
+ (standard_iv_increment_position): New function.
+ (zero_p): Export.
+ * tree-ssa-loop-niter.c (zero_p): Remove duplicate function.
+ * tree-ssa-loop.c (tree_ssa_loop_prefetch,
+ gate_tree_ssa_loop_prefetch): New functions.
+ (pass_loop_prefetch): New pass structure.
+ * tree-ssa-operands.c (function_ignores_memory_p): New function.
+ (get_expr_operands): Use it.
+ * tree.c (cst_and_fits_in_hwi): Moved from tree-ssa-loop-ivopts.c.
+ * tree.h (zero_p, cst_and_fits_in_hwi): Declare.
+
+2004-06-28 Daniel Berlin <dberlin@dberlin.org>
+
+ * lambda-code.c (print_linear_expression): Rename a few variables,
+ simplify some code.
+ (print_lambda_loop): Ditto.
+ (lambda_compute_auxillary_space): Update a comment.
+ (gcc_loop_to_lambda_loop): Update code for chrec_dont_know change.
+ (struct dir_dist_pair): New.
+ (reverse_dep): Ditto.
+ (lambda_dep_mult_constant): New function.
+ (lambda_dep_add): Ditto.
+ (lambda_vec_distdirvec_mult): Ditto.
+ (lambda_vec_distdirmat_mult): Ditto.
+ (lambda_deps_positive): Ditto.
+ (lambda_transform_legal_p): Ditto.
+ * lambda-mat.c (lambda_matrix_mult): Cleanup
+ (lambda_matrix_delete_rows): Ditto.
+ (lambda_matrix_row_add): Ditto.
+ (lambda_matrix_col_exchange): Ditto.
+ (lambda_trans_matrix_is_nonsingular): Rename to standard gcc predicate
+ naming.
+ (lambda_trans_matrix_is_fullrank): Ditto.
+ (lambda_trans_matrix_base): Rename to reflect actual computation.
+ * lambda.h (lambda_transform_legal_p): Add prototype.
+ * tree-loop-linear.c (linear_transform_loops): Rewrite a bit, use legality
+ tester to test transforms.
+
+2004-06-28 Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-data-ref.c (build_classic_dist_vector): Add argument, stop
+ making out-of-bounds array accesses when analyzing less than
+ all the loops. Add checks to verify.
+ (build_classic_dir_vector): Ditto.
+ (compute_data_dependences_for_loop): Pass in starting loop number
+ to build_classic_*.
+
+2004-06-27 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree.def (INTERVAL_CHREC): Removed.
+ (SCEV_KNOWN, SCEV_NOT_KNOWN): New nodes.
+ * tree-pretty-print.c (dump_generic_node): Handle SCEV_KNOWN and
+ SCEV_NOT_KNOWN nodes.
+ * tree-chrec.h (build_polynomial_chrec): When one of the
+ operands is chrec_dont_know, return directly chrec_dont_know.
+ * tree-scalar-evolution.c (instantiate_parameters_1): Same.
+ (initialize_scalar_evolutions_analyzer): Build chrec_dont_know using a
+ SCEV_NOT_KNOWN node, and chrec_known with a SCEV_KNOWN node.
+
+2004-06-24 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-chrec.c (chrec_fold_automatically_generated_operands,
+ chrec_merge):
+ Use chrec_dont_know instead of a call to chrec_contains_undetermined.
+ (tree_fold_factorial, tree_fold_binomial, chrec_evaluate): Resurrect.
+ (chrec_apply): Reinsert the cases that were removed.
+ (chrec_convert): Remove the check for NULL_TREE inserted two days ago.
+ * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): As a sequel of
+ removing the tree_fold_* functions, the analyzed trees can contain
+ NON_LVALUE_EXPR nodes. Use STRIP_TYPE_NOPS for avoiding these nodes.
+ (number_of_iterations_in_loop): Add the missing open parenthesis in
+ the debugging dumps.
+ (initialize_scalar_evolutions_analyzer): Use an INTERVAL_CHREC for
+ constructing the chrec_dont_know node. This fixes some strange
+ problems that arise when chrec_dont_know is an INTEGER_CST.
+ * tree.def (INTERVAL_CHREC): Resurrect.
+
+2004-06-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-chrec.c (chrec_merge): Handle case when one of the arguments
+ was not analyzed yet correctly.
+
+2004-06-23 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-chrec.c (chrec_fold_automatically_generated_operands): Now
+ static. Clean comments.
+ (hide_evolution_in_loop, chrec_merge_types): Removed.
+ * tree-chrec.h (hide_evolution_in_loop,
+ chrec_fold_automatically_generated_operands): Remove declarations.
+ * tree-scalar-evolution.c: Remove an old part of the comment at the
+ beginning of the file.
+ (compute_overall_effect_of_inner_loop,
+ compute_overall_effect_of_inner_loop, add_to_evolution_1,
+ analyze_scalar_evolution_1, analyze_scalar_evolution): Test for
+ chrec_dont_know instead of calling chrec_contains_undetermined.
+
+2004-06-22 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_create_data_ref): Fix setting of mem_tag.
+ (vect_analyze_data_refs): Make sure we have a mem_tag.
+
+2004-06-22 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-fold-const.c, tree-fold-const.h: Removed.
+ * Makefile.in (SCEV_H, tree-chrec.o): Remove tree-fold-const.h.
+ (OBJS-common): Remove tree-fold-const.o.
+ (tree-fold-const.o): Removed.
+ * gengtype.c (open_base_files): Remove tree-fold-const.h.
+ * lambda-code.c, tree-chrec.c, tree-data-ref.c, tree-dg.c,
+ tree-elim-check.c, tree-loop-linear.c, tree-pretty-print.c,
+ tree-scalar-evolution.c, tree-ssa-loop-ivcanon.c,
+ tree-ssa-loop-ivopts.c, tree-ssa-loop-niter.c, tree-vectorizer.c:
+ Don't include tree-fold-const.h.
+ * tree-chrec.c, tree-data-ref.c: Replace uses of tree_fold_* with
+ fold (build (*, ...))
+ * tree-data-ref.c (tree_fold_gcd, tree_fold_divides_p,
+ tree_fold_bezout): Saved from deletion here.
+
+2004-06-22 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-chrec.c, tree-chrec.h, tree-data-ref.c, tree-dg.c,
+ tree-elim-check.c, tree-scalar-evolution.c, tree-ssa-loop-niter.c,
+ tree-vectorizer.c: Replace chrec_top with chrec_dont_know,
+ and chrec_bot with chrec_known. Replace the checks of chrec_top
+ with calls to chrec_contains_undetermined.
+ * tree.def (INTERVAL_CHREC): Removed.
+ * cfgloop.h (loop): Update comments around nb_iterations field.
+ * lambda-code.c (gcc_loop_to_lambda_loop): Always check for
+ undetermined chrec after calling number_of_iterations_in_loop.
+ * tree-chrec.c (chrec_fold_multiply_ival_cst,
+ chrec_fold_multiply_ival_ival,
+ chrec_merge_types, chrec_contains_intervals, chrec_evaluate,
+ chrec_merge_intervals): Removed.
+ (chrec_fold_plus_1, chrec_fold_plus, chrec_fold_minus,
+ chrec_fold_multiply, chrec_merge,
+ evolution_function_is_affine_multivariat, chrec_convert):
+ Remove uses of INTERVAL_CHREC nodes.
+ (chrec_apply): Classify as unknown all the non-affine cases.
+ * tree-fold-const.h (tree_fold_binomial): Removed.
+ * tree-chrec.h (CHREC_LOW, CHREC_UP,
+ chrec_contains_intervals, build_interval_chrec,
+ build_chrec_top_type, evolution_function_is_multivariate,
+ chrec_should_remain_symbolic): Removed.
+ (tree_is_chrec, chrec_zerop, evolution_function_is_affine_p):
+ Remove uses of INTERVAL_CHREC nodes.
+ * tree-data-ref.c (analyze_ziv_subscript,
+ analyze_overlapping_iterations): Same.
+ * tree-pretty-print.c (dump_generic_node): Same.
+ * tree-scalar-evolution.c (chrec_is_positive,
+ instantiate_parameters_1, gather_chrec_stats,
+ initialize_scalar_evolutions_analyzer): Same.
+ (analyze_scalar_evolution_in_loop): Make it static.
+ (resolve_mixers): Fix comments.
+ (chrec_stats, reset_chrecs_counters, dump_chrecs_stats):
+ Remove nb_interval_chrec counter.
+ (chrec_is_positive, simple_iv): Always check for undetermined after
+ a call to number_of_iterations_in_loop or analyze_scalar_evolution.
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables,
+ canonicalize_loop_induction_variables): Same.
+ * tree-ssa-loop-ivopts.c (determine_biv_step): Same.
+ * tree-ssa-loop-niter.c (find_loop_niter_by_eval): Same.
+ (estimate_numbers_of_iterations_loop): Remove redundant call to
+ number_of_iterations_in_loop.
+ * tree-scalar-evolution.h (analyze_scalar_evolution_in_loop):
+ Remove declaration, the function is now static.
+ * tree-vectorizer.c (vect_analyze_loop_with_symbolic_num_of_iters):
+ Don't test for INTERVAL_CHREC nodes.
+
+2004-06-22 Devang Patel <dpatel@apple.com>
+
+ PR 16105
+ * tree-vectorizer.c (vect_analyze_operations): Type of MODIFY_EXPR is
+ not reliable. Use LHS's type.
+
+2004-06-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR rtl-optimization/16001
+ * loop-iv.c (iv_number_of_iterations): Prevent copy propagation in
+ niter_expr.
+
+2004-06-21 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree.def (PEELED_CHREC): Removed.
+ * tree-chrec.c (is_not_constant_evolution, chrec_fold_plus_1,
+ chrec_fold_multiply, chrec_replace_initial_condition, chrec_convert):
+ Don't handle PEELED_CHREC nodes.
+ (chrec_fold_plus_peel_cst, chrec_fold_plus_poly_peel,
+ chrec_fold_plus_peel_poly, chrec_fold_plus_peel_peel,
+ chrec_fold_multiply_peel_cst, chrec_fold_multiply_poly_peel,
+ chrec_fold_multiply_peel_peel, simplify_peeled_chrec): Removed.
+ * tree-chrec.h (tree_is_chrec): Don't handle PEELED_CHREC nodes.
+ (build_peeled_chrec, evolution_function_is_peeled_affine_p): Removed.
+ * tree-pretty-print.c (dump_generic_node): Don't handle
+ PEELED_CHREC nodes.
+ * tree-scalar-evolution.c (analyze_evolution_in_loop,
+ instantiate_parameters_1): Same.
+ (chrec_stats, reset_chrecs_counters, dump_chrecs_stats,
+ gather_chrec_stats): Don't count the number of PEELED_CHREC nodes.
+
+2004-06-18 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * Makefile.in (OBJS-common): Remove tree-elim-check.o.
+ * tree-scalar-evolution.c (first_iteration_non_satisfying_noev_noev,
+ first_iteration_non_satisfying_noev_ev,
+ first_iteration_non_satisfying_ev_noev,
+ first_iteration_non_satisfying_ev_ev,
+ first_iteration_non_satisfying_1,
+ first_iteration_non_satisfying): Removed.
+ (number_of_iterations_in_loop): Clean up.
+ * tree-scalar-evolution.h (first_iteration_non_satisfying): Removed.
+ * tree-ssa-loop-ivopts.c (zero_p): Compare tree pointer
+ against NULL_TREE.
+ * tree-ssa-loop.c (tree_ssa_loop_test): Return when loops
+ structure is not available.
+ (tree_elim_checks): Disabled for the moment. Don't call
+ eliminate_redundant_checks.
+
+2004-06-17 Andrew MacLeod <amacleod@redhat.com>
+
+ * tree-cfg.c (tree_make_forwarder_block): Use SET_PHI_RESULT.
+ * tree-flow-inline.h (get_use_op_ptr): Return a use_operand_p.
+ (get_use_from_ptr, get_def_from_ptr): New. Return operand pointers.
+ (get_def_op_ptr): Return a def_operand_p instead of a 'tree *'.
+ (get_v_may_def_result_ptr): Return a def_operand_p.
+ (get_v_may_def_op_ptr, get_vuse_op_ptr): Return a use_operand_p.
+ (get_v_must_def_op_ptr): Return a def_operand_p.
+ (get_phi_result_ptr): New. Return a pointer to the result of a PHI.
+ (get_phi_arg_def_ptr): New. Return a pointer to an argument of a PHI.
+ (phi_element_for_edge): Remove.
+ * tree-flow.h (propagate_value, replace_exp): Change prototype.
+ (propagate_tree_value): Add new prototype.
+ (phi_element_for_edge): Remove prototype.
+ * tree-into-ssa.c (mark_def_sites): Use new operand types.
+ (prepare_operand_for_rename): Split into two functions.
+ (prepare_use_operand_for_rename): Prepare use operands.
+ (prepare_def_operand_for_rename): Prepare def operands.
+ (rewrite_stmt): Use new operand types.
+ (rewrite_operand): Use new operand types, change parameter type.
+ * tree-outof-ssa.c (replace_variable): Split into two functions.
+ (replace_use_variable): Rewrite uses.
+ (replace_def_variable): Rewrite defs.
+ (rewrite_trees, rewrite_vars_out_of_ssa): Use new operand types.
+ * tree-phinodes.c (make_phi_node, resize_phi_node): Use new types.
+ (add_phi_arg, remove_phi_arg_num): Use new operand types.
+ * tree-ssa-ccp.c (substitute_and_fold): Use new operand types.
+ (ccp_fold, replace_uses_in): Use new operand types.
+ * tree-ssa-copy.c (replace_ssa_names): Rename to replace_ssa_names_ann
+ and no longer set the value, change parameter type.
+ (replace_exp_1): Use new operand types.
+ (propagate_value): Change parameter type, use new operand types.
+ (propagate_tree_value): Propagate_value without SSA operands.
+ (replace_exp, cprop_operand, cprop_into_stmt): Use new operand types.
+ (cprop_into_successor_phis): Use new operand types.
+ * tree-ssa-dom.c (thread_across_edge): Use new operand types.
+ (eliminate_redundant_computations): Use new operand types.
+ * tree-ssa-dse.c (fix_phi_uses): Use new operand_types.
+ (fix_stmt_v_may_defs): Use new operand_types.
+ * tree-ssa-live.c (create_ssa_var_map): Use new operand_types.
+ (build_tree_conflict_graph): Use new operand_types.
+ * tree-ssa-loop.c (duplicate_blocks): Use PHI_ARG_DEF_FROM_EDGE.
+ * tree-ssa-operands.c (struct freelist_d): Remove.
+ (check_optype_freelist, add_optype_freelist): Remove.
+ (allocate_def_optype, allocate_use_optype, allocate_v_may_def_optype,
+ allocate_vuse_optype, allocate_v_must_def_optype): Call ggc_alloc.
+ (free_uses, free_defs, free_vuses, free_v_may_defs, free_v_must_defs):
+ Call ggc_free instead of add_optype_freelist.
+ (init_ssa_operands, fini_ssa_operands): Remove free list code.
+ (finalize_ssa_defs, finalize_ssa_uses): Set new use/def operands.
+ * tree-ssa-operands.h (struct def_optype_d): Change underlying type.
+ (struct use_optype_d): Change underlying type.
+ (def_operand_p, use_operand_p): New types for pointers to operands.
+ (USE_OP, DEF_OP, V_MAY_DEF_RESULT, V_MAY_DEF_OP, VUSE_OP,
+ V_MUST_DEF_OP): Use new pointer type instead of dereferencing directly.
+ (USE_FROM_PTR, DEF_FROM_PTR): New macros to "dereference" operand
+ pointer types.
+ (SET_USE, SET_DEF): New macros to set operands from their pointer.
+ (SET_USE_OP, SET_DEF_OP, SET_V_MAY_DEF_RESULT, SET_V_MAY_DEF_OP,
+ SET_VUSE_OP, SET_V_MUST_DEF_OP): New SET routines for operands.
+ (PHI_RESULT_PTR, PHI_RESULT, SET_PHI_RESULT): Macros to manage the
+ PHI result as an operand.
+ (PHI_ARG_DEF_PTR, PHI_ARG_DEF, SET_PHI_ARG_DEF, PHI_ARG_DEF_FROM_EDGE,
+ PHI_ARG_DEF_PTR_FROM_EDGE): Macros to manage the PHI arguments.
+ * tree-ssa-pre.c (eliminate): Call propagate_tree_value.
+ * tree-tailcall.c (independent_of_stmt_p, propagate_through_phis): Use
+ PHI_ARG_DEF_FROM_EDGE.
+ * tree.h (PHI_RESULT): Renamed to PHI_RESULT_TREE.
+ (PHI_ARG_DEF): Renamed to PHI_ARG_DEF_TREE.
+
+ * tree-ssa-loop-ivopts.c (find_bivs, mark_bivs,
+ find_interesting_uses_outer_or_nonlin, find_interesting_uses_stmt,
+ find_interesting_uses_outside, add_old_iv_candidates,
+ remove_statement, rewrite_use_nonlinear_expr, split_loop_exit_edge,
+ protect_loop_closed_ssa_form_use, compute_phi_arg_on_exit,
+ rewrite_use_outer): Use new operand types.
+
+2004-06-16 Dale Johannesen <dalej@apple.com>
+
+ * Makefile.in (GTFILES): Add tree-chrec.h.
+ * tree-chrec.h (chrec_top, chrec_bot): Add GTY.
+ * tree-scalar-evolution.c (initialize_scalar_evolutions_analyzer):
+ Set chrec_top, chrec_bot once per compilation.
+ * gengtype.c (ifiles): Add tree-fold-const.h, tree-chrec.h.
+
+2004-06-16 Dale Johannesen <dalej@apple.com>
+ * tree-flow.h (tree_ann_common-d.aux): Document required behavior.
+ * tree-ssa-loop-manip.c (allocate_new_names): Don't propagate
+ new_names into copies.
+
+2004-06-16 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR tree-optimization/15993
+ * tree-ssa-dom.c (thread_across_edge): Do not thread edge if its
+ destination is unchanged.
+
+2004-06-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_analyze_data_refs): Minor fix.
+
+2004-06-14 Andrew Pinski <apinski@apple.com>
+
+ * tree-ssa-return.c: Remove.
+ * Makefile.in (OBJS-common): Remove tree-ssa-return.o
+ (tree-ssa-return.o): Remove.
+ * timevar.def (TV_TREE_RETURN): Remove.
+ * tree-optimize.c (init_tree_optimization_passes):
+ Do not run pass_return.
+ * tree-pass.h (pass_return): Remove declaration.
+
+2004-06-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-data-ref.c (init_data_ref): New function.
+ * tree-data-ref.h (init_data_ref): New function.
+ * tree-vectorizer.c (vect_get_array_first_index): Return index instead
+ of success status, and support pointers.
+ (vect_create_index_for_array_ref): Remove ARRAY_REF restriction, and
+ change call to vect_get_array_first_index.
+ (vect_create_data_ref): Handle INDIRECT_REFs.
+ (vect_is_supportable_store): Handle INDIRECT_REFs.
+ (vect_is_supportable_load): Handle INDIRECT_REFs.
+ (vect_analyze_data_ref_dependence): Handle INDIRECT_REFs.
+ (vect_analyze_data_ref_dependences): Remove usage of variable 'ok'.
+ (get_array_base): Removed (not used anymore).
+ (vect_force_dr_alignment_p): Use DR_BASE_NAME instead of
+ get_array_base.
+ (vect_align_data_ref): Likewise.
+ (vect_transform_store): Remove ARRAY_REF restriction.
+ (vect_transform_load): Remove ARRAY_REF restriction.
+ (vect_compute_data_ref_alignment): Support pointers.
+ (vect_analyze_data_refs): Support pointers.
+
+ (vect_debug_stats): New Function.
+ (vect_debug_details): New Function.
+ (vect_transform_loop): Use vect_debug_stats and vec_debug_details.
+ (vect_analyze_loop): Use vect_debug_details.
+ (vect_analyze_scalar_cycles): Use vect_debug_stats.
+ (vect_analyze_data_ref_dependence): Likewse.
+ (vect_analyze_data_refs_alignment): Likewise.
+ (vect_analyze_data_ref_accesses): Likewise.
+ (vect_analyze_data_refs): Likewise.
+ (vect_analyze_loop_form): Likewise.
+
+ (vect_gen_if_guard): Formatting fixes (avoid 80 column overflow).
+ (vect_update_initial_conditions_of_duplicatd_loop): Likewise.
+ (vect_transform_loop): Likewise.
+ (vect_analyze_loop_form): Likewise.
+
+2004-06-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ Merge from mainline (lno-merge-20040612).
+
+2004-06-13 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-chrec.c (evolution_function_is_affine_multivariat): Add check
+ for POLYNOMIAL_CHREC.
+ * tree-dg.c (ddg_direction_between_stmts): Add check for chrec_top.
+
+ * tree-pass.h (TODO_write_loop_closed): New to-do flag.
+ * tree-optimize.c (execute_todo): Handle new to-do flag
+ TODO_write_loop_closed.
+ * tree-ssa-loop.c (struct tree_opt_pass pass_vectorize): Set
+ TODO_write_loop_closed.
+
+ * tree-vectorizer.c (vect_transform_loop): Add calls to
+ add_bb_to_loop.
+ (vect_analyze_data_ref_dependence): Fix last argument in call to
+ ddg_direction_between_stmts.
+
+2004-06-11 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR target/15944
+ * loop-invariant.c (may_assign_reg_p): Use can_copy_p.
+
+2004-06-11 Olga Golovanevsky <olga@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_generate_tmps_on_preheader):
+ (vect_gen_if_guard): New functions.
+ (vect_update_initial_conditions_of_duplicated_loop):
+ Update also phis of bb at the exit of epilog loop.
+ (vect_transform_loop): Remove code that now belongs to
+ vect_generate_tmps_on_preheader () function. Use
+ vect_gen_if_guard function twice.
+
+2004-06-10 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ch.c: New file.
+ * Makefile.in (tree-ssa-loop-ch.o): Add.
+ (tree-ssa-loop.o): Add SCEV_H and tree-vectorizer.h dependency.
+ * cfgloop.h (current_loops): Declare.
+ * common.opt (fivcanon, fivopts, floop-test, ftree-lim): Add.
+ (ftree-loop-optimize, fscalar-evolutions, fall-data-deps,
+ ftree-ddg): Remove.
+ * flags.h (flag_scalar_evolutions, flag_all_data_deps,
+ flag_tree_loop, flag_ddg): Removed.
+ (flag_tree_lim, flag_ivcanon, flag_ivopts,
+ flag_tree_ssa_loop_test): New.
+ (f_options): Remove scalar-evolutions, all-data-deps,
+ tree-ddg, tree-loop-optimize.
+ * toplev.c (flag_scalar_evolutions, flag_all_data_deps,
+ flag_tree_loop, flag_ddg): Removed.
+ (flag_tree_lim, flag_ivcanon, flag_ivopts,
+ flag_tree_ssa_loop_test): New.
+ * opts.c (decode_options, common_handle_option): Initialize new
+ options.
+ * timevar.def (TV_SCALAR_EVOLUTIONS, TV_ALL_DATA_DEPS): Removed.
+ (TV_TREE_ELIM_CHECKS, TV_DEP_GRAPH, TV_LIM, TV_COMPLETE_UNROLL,
+ TV_UNSWITCH): Added.
+ * tree-flow.h (test_unrolling_and_peeling, test_loop_versioning):
+ Removed.
+ (tree_unroll_loops_completely): Declare.
+ * tree-optimize.c (init_tree_optimization_passes): Reorganize loop
+ optimizer passes.
+ * tree-pass.h (pass_scev, pass_scev_init, pass_scev_anal,
+ pass_scev_depend, pass_scev_linear_transform, pass_scev_iv_canon,
+ pass_scev_elim_checks, pass_scev_vectorize, pass_scev_done, pass_ddg,
+ pass_delete_ddg): Removed.
+ (pass_loop_init, pass_loop_test, pass_lim, pass_unswitch,
+ pass_iv_canon, pass_record_bounds, pass_elim_checks, pass_vectorize,
+ pass_complete_unroll, pass_linear_transform, pass_iv_optimize,
+ pass_loop_done): Declare.
+ * tree-scalar-evolution.c (current_loops): Moved to tree-ssa-loop.c.
+ (dd_info_available): Removed.
+ (scev_init, scev_depend, scev_elim_checks, scev_vectorize, scev_done,
+ gate_scev, gate_scev_analysis, gate_scev_depend, gate_scev_elim_checks,
+ gate_scev_vectorize): Removed.
+ (pass_scev, pass_scev_init, pass_scev_anal, pass_scev_depend,
+ pass_scev_vectorize, pass_scev_linear_transform,
+ pass_scev_iv_canon, pass_scev_elim_checks, pass_scev_done,
+ pass_ddg, pass_delete_ddg): Removed.
+ * tree-scalar-evolution.h (scev_analysis): Declare.
+ (scev_analysis): Export.
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ Add parameter to control whether find_loop_niter_by_eval is run.
+ (canonicalize_induction_variables): Do not unroll loops.
+ (tree_unroll_loops_completely): Split from
+ canonicalize_induction_variables.
+ * tree-ssa-loop-ivopts.c (tree_ssa_iv_optimize_init,
+ tree_ssa_iv_optimize_finalize, tree_ssa_iv_optimize,
+ tree_ssa_iv_optimize): Global initialization/finalization removed.
+ * tree-ssa-loop-manip.c (test_unrolling_and_peeling,
+ test_loop_versioning): Removed.
+ * tree-ssa-loop.c: Include tree-scalar-evolution.h and
+ tree-vectorizer.h.
+ (current_loops): Moved from tree-scalar-evolution.c.
+ (tree_ssa_loop_opt): Removed.
+ (gate_loop): Removed.
+ (pass_loop): Modified.
+ (should_duplicate_loop_header_p, mark_defs_for_rewrite,
+ duplicate_blocks, do_while_loop_p, copy_loop_headers,
+ gate_ch, pass_ch): Moved to tree-ssa-loop-ch.c.
+ (tree_ssa_loop_init, pass_loop_init, tree_ssa_loop_im,
+ gate_tree_ssa_loop_im, pass_lim, tree_ssa_loop_unswitch,
+ gate_tree_ssa_loop_unswitch, pass_unswitch, tree_ssa_loop_ivcanon,
+ gate_tree_ssa_loop_ivcanon, pass_iv_canon, tree_ssa_loop_bounds,
+ pass_record_bounds, tree_ssa_loop_test, pass_loop_test,
+ tree_elim_checks, gate_tree_elim_checks, pass_elim_checks,
+ tree_vectorize, gate_tree_vectorize, pass_vectorize,
+ tree_complete_unroll, gate_tree_complete_unroll, pass_complete_unroll,
+ tree_linear_transform, gate_tree_linear_transform,
+ pass_linear_transform, tree_ssa_loop_ivopts, gate_tree_ssa_loop_ivopts,
+ pass_iv_optimize, tree_ssa_loop_done, pass_loop_done): New.
+ * testsuite/gcc.dg/tree-ssa-chrec/*: Updated.
+
+2004-06-10 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree.def: Remove EXPONENTIAL_CHREC node.
+ * tree-chrec.c (is_not_constant_evolution, chrec_fold_plus_1,
+ chrec_fold_multiply, chrec_evaluate, chrec_apply,
+ chrec_replace_initial_condition, initial_condition,
+ hide_evolution_in_loop, hide_evolution_in_other_loops_than_loop,
+ evolution_part_in_loop_num, reset_evolution_in_loop,
+ reset_evolution_in_loop, chrec_merge, is_multivariate_chrec_rec,
+ is_multivariate_chrec, evolution_function_is_affine_multivariate_p,
+ evolution_function_is_univariate_p, chrec_convert): Don't
+ handle EXPONENTIAL_CHREC nodes.
+ (chrec_fold_plus_expo_cst, chrec_fold_plus_cst_expo,
+ chrec_fold_plus_poly_expo, chrec_fold_plus_expo_poly,
+ chrec_fold_plus_expo_expo, chrec_fold_multiply_poly_expo,
+ chrec_fold_multiply_expo_expo, is_pure_sum_chrec): Removed.
+ * tree-chrec.h (tree_is_chrec, evolution_function_is_affine_p):
+ Don't handle EXPONENTIAL_CHREC nodes.
+ (build_exponential_chrec): Removed.
+ (no_evolution_in_loop_p): Use a call to tree_is_chrec for
+ determining when a node represents a scalar evolution.
+ * tree-data-ref.c (siv_subscript_p): Don't handle
+ EXPONENTIAL_CHREC nodes.
+ * tree-pretty-print.c (dump_generic_node): Same.
+ * tree-scalar-evolution.c: Remove FIXME comments about
+ EXPONENTIAL_CHREC nodes. Add a pointer to the slides
+ presented at the GCC Summit 2004 about the scalar evolutions.
+ (compute_overall_effect_of_inner_loop): Clarify the leading comment.
+ (chrec_is_positive, add_to_evolution_1, add_to_evolution,
+ instantiate_parameters_1): Don't handle EXPONENTIAL_CHREC nodes.
+ (multiply_evolution_1, multiply_evolution): Removed.
+ (first_iteration_non_satisfying_ev_ev): Handle only affine
+ functions.
+ (follow_ssa_edge_in_rhs): Cases that were detected as
+ EXPONENTIAL_CHREC nodes are now mapped to the unknown element
+ (be it top or bottom) called chrec_top.
+ (chrec_stats, reset_chrecs_counters, dump_chrecs_stats,
+ gather_chrec_stats): Don't count the EXPONENTIAL_CHREC nodes.
+ * tree-vectorizer.c (vect_is_simple_iv_evolution,
+ vect_analyze_loop_with_symbolic_num_of_iters): Use
+ tree_is_chrec for determining whether the given node has an
+ evolution.
+
+2004-06-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR middle-end/15876
+ * tree-ssa-loop-ivopts.c (force_var_cost): Initialize DECL_RTL
+ correctly.
+
+2004-06-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * passes.c (rest_of_handle_loop2): Run loop optimizations always.
+
+2004-06-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * ra-build.c (livethrough_conflicts_bb): Check also contains_call.
+
+2004-06-09 Olga Golovanevsky <olga@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vctorizer.c
+ (vect_update_initial_conditions_of_duplicated_loop):
+ Handle general form of "init" and "step" of access function.
+ * tree-ssa-loop-manip.c (tree_duplicate_loop_to_exit_cfg):
+ The exit from loop is taken from bb previous to latch instead
+ of latch itself.
+
+2004-06-08 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR tree-opt/15881
+ * tree-scalar-evolution.c (count_ev_in_wider_type): Use
+ fold_convert instead of convert.
+ (compute_overall_effect_of_inner_loop): Likewise.
+ (chrec_is_positive): Likewise.
+ (add_to_evolution_1): Likewise.
+ (add_to_evolution): Likewise.
+ (first_iteration_non_satisfying_1): Likewise.
+ (follow_ssa_edge_in_rhs): Likewise.
+ (interpret_rhs_modify_expr): Likewise.
+ (number_of_iterations_in_loop): Likewise.
+
+2004-06-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR tree-optimization/15779
+ * tree-scalar-evolution.c (scev_initialize): Clean the nb_iterations
+ field.
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables): Do
+ not clean nb_iterations field.
+
+2004-06-07 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * version.c (version_string): Update "merged" stamp.
+
+2004-05-30 Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-loop-linear.c (linear_transform_loops): We don't handle sibling
+ loops, or loops with multiple exits, yet.
+ * lambda-code.c (invariant_in_loop): Check outer loops too for
+ right now.
+ (lle_to_gcc_expression): Special case the coefficient == 1 cases.
+ (lambda_loopnest_to_gcc_loopnest): Use correct test.
+
+2004-05-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+ Jeff Law <law@redhat.com>
+
+ * tree-into-ssa.c (prepare_operand_for_rename): New argument is_use.
+ If the operand is for a use, then strip away the SSA_NAME, do not
+ strip away the SSA_NAME for a set. Never call release_ssa_name.
+ (mark_def_sites): Appropriately pass additional argument to
+ prepare_operand_for_rename. If a VDEF_RESULT is not an SSA_NAME,
+ then set the VDEF_RESULT to the VDEF_OP.
+ (set_def_block): Strip away any SSA_NAME to get to the real
+ underlying variable.
+ (ssa_mark_def_sites): Prevent set_def_block from doing so.
+
+ * tree-ssa-loop.c (mark_defs_for_rewrite): Record defined ssa names.
+ (duplicate_blocks): Use rewrite_ssa_into_ssa.
+ (pass_ch): Remove TODO_rename_vars.
+
+2004-05-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * opts.c (decode_options): Enable flag_scalar_evolutions by default.
+
+2004-05-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * fold-const.c (fold_widened_comparison,
+ fold_sign_changed_comparison): New.
+ (fold): Use them.
+ * tree-flow.h (struct tree_niter_desc): New field additional_info.
+ * tree-ssa-loop-niter.c (simplify_using_outer_evolutions): Do not
+ rewrite expressions in-place.
+ (tree_simplify_using_condition, simplify_using_initial_conditions):
+ New functions.
+ (number_of_iterations_exit): Use simplify_using_initial_conditions.
+ (struct nb_iter_bound): New field additional.
+ (record_estimate, estimate_numbers_of_iterations_loop): Initialize
+ field additional.
+ (upper_bound_in_type, lower_bound_in_type): Export. Handle
+ unsigned->signed conversion correctly.
+ (can_count_iv_in_wider_type): Pass the additional info to
+ can_count_iv_in_wider_type_bound.
+ (can_count_iv_in_wider_type_bound): Use the additional info.
+ * tree.h (lower_bound_in_type, upper_bound_in_type): Declare.
+ * config/i386/i386.c (legitimate_constant_p): Do not allow
+ integer - symbol.
+
+2004-05-29 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * lambda-code.c: Spell check.
+ * lambda-trans.c: Same.
+ * tree-chrec.c: Same.
+ * tree-dg.c: Same.
+ * tree-loop-linear.c: Same.
+ * tree-ssa-loop-im.c: Same.
+ * tree-ssa-loop-ivcanon.c: Same.
+ * tree-ssa-loop-ivopts.c: Same.
+ * tree-ssa-loop-manip.c: Same.
+ * tree-ssa-loop.c: Same.
+ * tree-vectorizer.c: Same.
+
+2004-05-28 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-niter.c (number_of_iterations_cond): Record correct
+ assumptions.
+
+2004-05-28 Dale Johannesen <dalej@apple.com>
+
+ * loop-invariant.c (check_maybe_invariant): Disallow hoisting CALLs.
+
+2004-05-27 Sebastian Pop <pop@cri.ensmp.fr>
+
+ Merge from mainline (lno-merge-20040526).
+ * tree-scalar-evolution.c (draw_tree_cfg): Removed.
+ * tree-into-ssa.c: Didn't merged
+ http://gcc.gnu.org/ml/gcc-patches/2004-05/msg01231.html
+
+2004-05-25 Sebastian Pop <pop@cri.ensmp.fr>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-scalar-evolution.c (first_iteration_non_satisfying_1):
+ Include the evolution of the non varying chrec in other_evs.
+ (number_of_iterations_in_loop): Don't instantiate the chrecs
+ before the computation of loop counts.
+
+2004-05-25 Olga Golovanevsky <olga@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_transform_loop_bound): Advance IVs
+ by correct amount.
+ (vect_transform_loop, vect_build_symbl_bound): Use shifts
+ instead of division/multiplication to advance IVs.
+
+2004-05-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (number_of_iterations_in_loop):
+ Do not produce COND_EXPRs.
+
+2004-05-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (resolve_mixers): New function.
+ (already_instantiated): Type changed to bitmap.
+ (scev_initialize, scev_finalize): Reflect the change.
+ (analyze_scalar_evolution_in_loop): Use resolve_mixers.
+ (instantiate_parameters_1): Add possibility to just resolve mixers.
+ Fold the results.
+ (number_of_iterations_in_loop): Use number_of_iterations_exit.
+ * tree-ssa-loop-niter.c (simplify_using_outer_evolutions): New
+ function.
+ (number_of_iterations_exit): Use it.
+
+2004-05-24 Dale Johannesen <dalej@apple.com>
+ * loop-invariant.c (find_defs): Add DF_EQUIV_NOTES.
+
+2004-05-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (tree-ssa-loop-manip.o): Add cfglayout.h dependency.
+ * tree-flow.h (collect_defs, rename_variables_in_bb, rename_op,
+ allocate_new_names, free_new_names): Declaration removed.
+ (tree_duplicate_loop_to_exit): Declare.
+ * tree-ssa-loop-manip.c: Include cfglayout.h.
+ (collect_defs, rename_variables_in_bb, rename_op,
+ allocate_new_names, free_new_names): Made static.
+ (tdlte_rename_variables_in_loop, tdlte_copy_phi_nodes,
+ tree_duplicate_loop_to_exit_cfg, tree_duplicate_loop_to_exit):
+ Moved from tree-vectorizer.c.
+ * tree-vectorizer.c (vect_duplicate_loopm vect_copy_phi_nodes,
+ vect_rename_variables_in_loop, vect_tree_duplicate_loop): Moved
+ to tree-ssa-loop-manip.c and renamed.
+
+2004-05-20 Olga Golovanevsky <olga@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_transform_loop): New parameter;
+ if bound is unknown, duplicates loop before vectorizing.
+ (vect_transfrom_loop_bound): New parameter; now deal with
+ symbolic loop bound.
+ (vect_analyze_loop_with_symbolic_num_of_iters)
+ (vect_duplicate_loop, vect_copy_phi_nodes)
+ (vect_rename_variables_in_loop, vect_tree_split_edge)
+ (vect_update_initial_conditions_of_duplicated_loop):
+ (vect_tree_duplicate_loop, vect_build_symbl_bound): New functions.
+ (new_loop_vec_info): Initialize the new field loop_vec_info:
+ symb_numb_of_iters.
+ * tree-vectorizer.h (loop_vec_info: symb_numb_of_iters): Added.
+ (LOOP_VINFO_SYMB_NUM_OF_ITERS): Added.
+ * cfgloopmanip.c (duplicate_loop): Made non-static.
+ * tree-ssa-loop-manip.c (collect_defs): Made non-static.
+ (allocate_new_names): Made non-static. Added option to allocate
+ for original loop or not.
+ (rename_op): Made non-static. Added input check.
+ (rename_variables_in_bb): Made mpm-static.
+ original loop were also renamed.
+ (free_new_names): release_ssa_name only if defs of original
+ loop were also renamed.
+ * cfgloop.h (duplicate_loop): Declare.
+ * tree-flow.h (collect_defs, allocate_new_names, rename_op)
+ (rename_variables_in_bb, free_new_names): Declare.
+
+2004-05-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (first_iteration_non_satisfying_noev_ev,
+ first_iteration_non_satisfying_ev_noev,
+ first_iteration_non_satisfying_ev_ev): Check the assumptions returned
+ by number_of_iterations_cond.
+
+2004-05-13 Devang Patel <dpatel@apple.com>
+
+ * cfgloop.c (get_loop_body_in_bfs_order): New.
+ (flow_loop_exit_edges_find): Set EDGE_LOOP_EXIT.
+ * cfgloop.h (get_loop_body_in_bfs_order): New.
+
+2004-05-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * expr.c (expand_expr_real_1): Use REF_ORIGINAL information
+ from INDIRECT_REFS.
+ * tree-flow.h (force_gimple_operand, rewrite_address_base): Declare.
+ * tree-ssa-loop-ivopts.c (force_gimple_operand): Expand.
+ (add_address_candidates): Add candidates with constant offset
+ stripped.
+ (idx_remove_ssa_names, unshare_and_remove_ssa_names,
+ rewrite_address_base): New.
+ (rewrite_use_address): Use rewrite_address_base.
+ * tree-into-ssa.c (register_new_def): Remove unused code.
+ * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop):
+ Handle invariants correctly.
+ * tree-cfg.c (tree_split_block): Do not modify the statements.
+ * tree.h (REF_ORIGINAL): New macro.
+
+2004-05-12 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-chrec.c (chrec_evaluate): Use the type of the chrec
+ instead of integer_type_node when folding operations.
+ (chrec_apply): Factor chrec_type calls.
+ (chrec_eval_next_init_cond): Removed.
+ (chrec_convert): Don't propagate overflows introduced by convert.
+ * tree-chrec.h (chrec_eval_next_init_cond): Removed.
+ * tree-scalar-evolution.c (first_iteration_non_satisfying_noev_ev,
+ first_iteration_non_satisfying_ev_noev,
+ first_iteration_non_satisfying_ev_ev): Use number_of_iterations_cond
+ instead of computing the loop counts.
+
+2004-05-10 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop-invariant.c (find_invariant_insn): Handle trapping insns
+ correctly.
+
+2004-05-10 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-chrec.h (build_chrec_top_type): Disabled, return chrec_top.
+ * tree-scalar-evolution.c (first_iteration_non_satisfying_noev_ev,
+ first_iteration_non_satisfying_ev_noev): Use the type of the chrec
+ instead of integer_type_node when folding operations.
+ (number_of_iterations_to_overflow): New.
+ (first_iteration_non_satisfying_ev_ev): Implement some cases.
+ (set_nb_iterations_in_loop): Return chrec_top on overflow.
+ (follow_ssa_edge_in_rhs): Handle type conversions "a = (type) rhs".
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ Convert the result of find_loop_niter_by_eval to the same type as niter
+ before comparing.
+
+2004-05-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop-iv.c (determine_max_iter, shorten_into_mode,
+ iv_number_of_iterations): Handle constants correctly.
+ * rtl.h (get_mode_bounds): Declaration changed. Duplicate declaration
+ removed.
+ * stor-layout.c (get_mode_bounds): Return a constant suitable for
+ a target mode.
+
+2004-05-06 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-chrec.h (build_chrec_top_type): Check that the type has
+ min and max values before taking their values.
+
+2004-05-06 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * tree-chrec.h (build_chrec_top_type): New.
+ * tree-chrec.c (chrec_fold_multiply_ival_cst,
+ chrec_fold_multiply_ival_ival, chrec_fold_plus_1): Use
+ build_chrec_top_type instead of returning chrec_top.
+
+ * tree-data-ref.c (dump_data_dependence_relation): Don't dump
+ direction per subscript.
+ (analyze_array): Use an extra boolean parameter for the access
+ mode: read or write.
+ (analyze_array_top, finalize_ddr_dependent): New.
+ (compute_direction_vector, set_all_subscripts_to): Removed.
+ (initialize_data_dependence_relation): The dependence relation
+ is unknown when one of the references base name is NULL_TREE.
+ (subscript_dependence_tester, build_classic_dist_vector,
+ build_classic_dir_vector, compute_affine_dependence):
+ Use finalize_ddr_dependent.
+ (build_classic_dir_vector): When one of the directions is
+ dir_star, the subscript coupling cannot deduce independence.
+ (compute_all_dependences): Renamed compute_rw_wr_ww_dependences.
+ (compute_rw_wr_ww_dependences): Don't compute read-read
+ relations. Don't compute the reversed dependence relation.
+ (find_data_references_in_loop): Use analyze_array_top when the
+ MODIFY_EXPR contains a VUSE/VDEF that is not an ARRAY_REF.
+ * tree-data-ref.h (data_reference): Add a field is_read.
+ (DR_IS_READ): New.
+ (DDR_SUBSCRIPTS_VECTOR_FINALIZE): Removed.
+ (analyze_array): Change declaration.
+ * tree-vectorizer.c (vect_analyze_data_refs): Adapt the use of
+ analyze_array to the new prototype. Pass in the read or write
+ mode.
+
+2004-04-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-niter.c: New file.
+ * Makefile.in (tree-ssa-loop-niter.o): New.
+ * cfgloop.h (struct loop): Add bounds field.
+ * df.c (df_reg_clobber_gen): Removed.
+ (df_bb_rd_local_compute, df_insn_refs_record, df_rd_local_compute):
+ Make more effective for hard regs.
+ * loop-invariant.c (check_maybe_invariant, find_defs,
+ find_invariant_insn): Handle hard regs.
+ * tree-chrec.c (chrec_fold_plus_poly_poly, chrec_fold_multiply,
+ chrec_fold_multiply, chrec_merge): Handle types correctly.
+ (chrec_convert): Use count_ev_in_wider_type.
+ * tree-chrec.h (count_ev_in_wider_type): Declare.
+ * tree-flow.h (struct tree_niter_desc): Moved from
+ tree-ssa-loop-ivopts.c.
+ (number_of_iterations_cond, number_of_iterations_exit,
+ loop_niter_by_eval, find_loop_niter_by_eval,
+ estimate_numbers_of_iterations, can_count_iv_in_wider_type,
+ free_numbers_of_iterations_estimates): Declare.
+ * tree-scalar-evolution.c (count_ev_in_wider_type, scev_reset,
+ simple_iv): New.
+ (number_of_iterations_in_loop): Check that the exit condition
+ is tested in every iteration.
+ * tree-scalar-evolution.h (scev_reset, simple_iv): Declare.
+ * tree-ssa-loop-ivcanon.c (MAX_ITERATIONS_TO_TRACK,
+ chain_of_csts_start, get_base_for, get_val_for,
+ loop_niter_by_eval, find_loop_niter_by_eval): Moved to
+ tree-ssa-loop-niter.c.
+ * tree-ssa-loop-ivopts.c (struct tree_niter_desc): Moved to
+ tree-flow.h.
+ (force_gimple_operand): Accept a variable for the target of
+ the assignment.
+ (create_iv, rewrite_use_nonlinear_expr,
+ rewrite_use_address, rewrite_use_compare,
+ rewrite_use_outer): Changed due to this.
+ (tree_ssa_iv_optimize_init): Call estimate_numbers_of_iterations.
+ (get_var_def): Removed.
+ (find_givs_in_stmt_scev): Use simple_iv.
+ (inverse, number_of_iterations_cond): Moved to tree-ssa-loop-niter.c.
+ (determine_number_of_iterations): Use number_of_iterations_exit.
+ (idx_find_step, find_interesting_uses_address): Use
+ can_count_iv_in_wider_type.
+ (force_var_cost): Determine the costs more precisely.
+ (tree_ssa_iv_optimize_finalize): Call
+ free_numbers_of_iterations_estimates.
+ (tree_ssa_iv_optimize_loop): Call scev_reset.
+ * varasm.c (force_const_mem): Set MEM_NOTRAP_P flag.
+ * config/rs6000/rs6000.c (rs6000_emit_move): Set MEM_NOTRAP_P flag.
+
+2004-04-27 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * lambda-code.c (build_int_cst): Moved...
+ * tree-data-ref.c (int_cst_value): Moved...
+ * tree-ssa-loop-ivopts.c (int_cst_value, build_int_cst): Moved...
+ * tree.c (int_cst_value, build_int_cst): ...here.
+ * tree.h (int_cst_value, build_int_cst): Declare.
+
+ * tree-chrec.h (is_chrec, symbolic_parameter_expr_p): Removed.
+
+ * tree-chrec.c (evolution_function_is_affine_multivariat): Check that
+ the left part is a polynomial before taking its variable.
+
+ * tree-elim-check.c (prove_truth_value): Update the use of
+ tree_is_* functions.
+ * tree-fold-const.h (tree_is_ge, tree_is_gt, tree_is_le, tree_is_lt,
+ tree_is_eq, tree_is_ne): Return true when decidable, and use a
+ parameter for returning the result.
+
+ * tree-scalar-evolution.c (types_forbid_solutions_p): Removed.
+ (first_iteration_non_satisfying_noev_noev,
+ first_iteration_non_satisfying_noev_ev,
+ first_iteration_non_satisfying_ev_noev): Update the use of
+ tree_is_* functions. Use no_evolution_in_loop_p instead of
+ evolution_function_is_constant_p. Extends the analyzer to
+ symbolic loop counts.
+ (first_iteration_non_satisfying): Factorize code.
+
+2004-04-26 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * config/rs6000/altivec.md: Fix merge problem.
+
+2004-04-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ Merge from tree-ssa branch (lno-merge-20040425).
+
+2004-04-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (force_gimple_operand): Strip useless type
+ conversions.
+ (number_of_iterations_cond): Fix typo.
+ (rewrite_use_address): Fix.
+
+2004-04-23 Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-loop-linear.c (linear_transform_loops): Add invariants array.
+ * lambda-code.c (gcc_tree_to_linear_expression): Change arguments
+ to include invariants array, and an int, instead of a bool.
+ Handle invariants.
+ (invariant_in_loop): New function.
+ (gcc_loop_to_lambda_loop): Add support for invariants as bounds,
+ and NE_EXPR tests.
+ (gcc_loopnest_to_lambda_loopnest): Add invariants argument,
+ init the invariants array, and pass it along to gcc_loop_to_lambda_loop.
+ (lle_to_gcc_expression): Handle invariants and simple linear offsets.
+ (lambda_loopnest_to_gcc_loopnest): Ditto.
+ Also use the right test if the step is negative.
+
+2004-04-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (instantiate_parameters_1): Handle changed
+ semantics of analyze_scalar_evolution. Split off from ...
+ (instantiate_parameters): ... here.
+
+2004-04-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (analyze_scalar_evolution_1): Keep
+ loop invariants in symbolic form. Use
+ compute_scalar_evolution_in_loop for expressions defined in subloops.
+ (chrec_contains_symbols_defined_in_loop): Check for non-strict
+ nestedness.
+ (compute_scalar_evolution_after_loop): Renamed back to
+ compute_overall_effect_of_inner_loop.
+ (follow_ssa_edge_inner_loop_phi, interpret_loop_phi):
+ Changed due to the renaming.
+ (get_scalar_evolution): Return chrec_not_analyzed_yet for complicated
+ expressions.
+ (compute_scalar_evolution_in_loop): Compute the evolution of the
+ expression returned by compute_overall_effect_of_inner_loop.
+
+2004-04-22 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-elim-check.c (prove_truth_value_gt, prove_truth_value_lt,
+ prove_truth_value_le, prove_truth_value_ge, prove_truth_value_eq,
+ prove_truth_value_ne): Resurrect.
+ (prove_truth_value_symbolic): New. Disabled for the moment.
+ (prove_truth_value): Use it when this function fails on unknown.
+ (try_eliminate_check): Factorize the code.
+ * tree-scalar-evolution.c (compute_scalar_evolution_after_loop):
+ Fix the description comment.
+
+2004-04-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-flow.h (linear_transform_loops): Prototype changed.
+ * tree-vectorizer.h (vectorize_loops): Ditto.
+ * tree-loop-linear.c (linear_transform_loops): Remove unused
+ argument.
+ * tree-vectorizer.c (vectorize_loops): Ditto.
+ * tree-scalar-evolution.c (scalar_evolution_info): Type changed
+ to hash table.
+ (new_scev_info_str): Use xmalloc instead of ggc_alloc.
+ (hash_scev_info, eq_scev_info, del_scev_info,
+ gather_stats_on_scev_database_1): New functions.
+ (find_var_scev_info, dump_chrecs_stats, gather_stats_on_scev_database,
+ scev_initialize, scev_finalize): Work with hash table instead of a
+ list.
+ (scev_elim_checks, scev_vectorize): Do not pass unused arguments to
+ functions.
+
+
+2004-04-21 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-chrec.c (chrec_apply): Fail on chrec_top when the chrec
+ contains symbols defined in the inner loop. Otherwise perform
+ the computation with symbols.
+ (no_evolution_in_loop_p): Same. Moved from here...
+ * tree-chrec.h (no_evolution_in_loop_p): ...there. Define it inline.
+ (chrec_contains_symbols_defined_in_loop): Declare.
+ * tree-scalar-evolution.c (nb_set_scev, nb_get_scev): New counters.
+ (set_scalar_evolution, get_scalar_evolution): Count the number of calls.
+ (chrec_contains_symbols_defined_in_loop): Defined.
+ (compute_scalar_evolution_after_loop, first_iteration_non_satisfying_1,
+ analyze_scalar_evolution_in_loop): Initialize boolean values.
+ (dump_chrecs_stats): Dump the get/set counters.
+
+2004-04-21 Sebastian Pop <sebastian.pop@ensmp.fr>
+ Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (compute_scalar_evolution_in_loop):
+ Use superloop_at_depth.
+ (analyze_scalar_evolution): Keep a symbolic form instead of
+ chrec_top.
+
+2004-04-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (instantiate_parameters): Handle casts
+ correctly.
+ * tree-ssa-loop-manip.c (add_exit_phis_edge): Do not add unnecessary
+ phi nodes.
+ * tree-ssa-loop.c (tree_ssa_loop_opt): Do not call create_preheaders.
+
+2004-04-20 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-scalar-evolution.c (scev_info_str, new_scev_info_str,
+ find_var_scev_info, set_scalar_evolution, get_scalar_evolution):
+ Store a single scalar evolution per definition.
+ (compute_overall_effect_of_inner_loop): Renamed
+ compute_scalar_evolution_after_loop.
+ (compute_scalar_evolution_in_loop): New.
+ (analyze_scalar_evolution): Use the helper function.
+ (analyze_scalar_evolution_1): Helper recursive function.
+ Avoid multiple set/get in the scev database when recursively called.
+
+2004-04-20 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (vect_create_index_for_array_ref): Use create_iv
+ instead of creating iv's from scratch.
+ (vect_transform_loop_bound): Likewise.
+
+2004-04-20 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-chrec.c (chrec_fold_multiply_ival_cst,
+ chrec_fold_multiply_ival_ival, chrec_fold_plus_1): When the fold
+ resulted in an overflow, conservatively answer chrec_top.
+
+2004-04-20 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-chrec.c (chrec_fold_multiply_ival_cst): Compute the min
+ and max on the multiplication result.
+ (chrec_fold_negate): Removed.
+ * tree-chrec.h (chrec_fold_negate): Removed.
+ * tree-scalar-evolution.c (interpret_rhs_modify_expr):
+ Use chrec_fold_minus instead of chrec_fold_negate.
+
+2004-04-20 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-chrec.h (evolution_function_is_constant_p): Be careful.
+ * tree-data-ref.c (analyze_siv_subscript_affine_affine): Renamed
+ analyze_subscript_affine_affine. Exchange the CHREC_VARIABLEs for
+ overlaps.
+ (analyze_miv_subscript): Use directly analyze_subscript_affine_affine,
+ and avoid the call to evolution_function_is_constant_p.
+
+2004-04-20 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-chrec.c (chrec_apply): Fail on chrec_top for symbolic chrecs.
+ (no_evolution_in_loop_p): Return false when non decidable, use
+ a parameter for returning the result.
+ * tree-chrec.h (no_evolution_in_loop_p): Modify its declaration.
+ * tree-scalar-evolution.c (add_to_evolution, multiply_evolution):
+ Avoid the use of no_evolution_in_loop_p.
+ (add_to_evolution_1, multiply_evolution_1): New.
+ (multiply_by_expr_the_loop_evolution, add_expr_to_loop_evolution,
+ build_exponential_evolution_in_loop,
+ build_polynomial_evolution_in_loop): Removed.
+ (first_iteration_non_satisfying_1, analyze_scalar_evolution_in_loop):
+ Modify the use of no_evolution_in_loop_p.
+ * tree-ssa-loop-ivopts.c (find_givs_in_stmt_scev,
+ find_givs_in_stmt_scev): Check that the result of scev analysis
+ does not contain symbols.
+
+2004-04-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (idx_contains_abnormal_ssa_name_p,
+ contains_abnormal_ssa_name_p): New functions.
+ (find_bivs, find_bivs, find_givs_in_stmt_scev):
+ Handle ssa names occuring in abnormal phis.
+ * tree-ssa-loop-im.c (movement_possibility): Ditto.
+
+2004-04-18 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c (create_index_for_array_ref): Remove code under
+ #ifdef POINTER_ARITHMETIC.
+ (vect_create_data_ref): Likewise. Support array addressing
+ instead of pointer arithmetic in vectorized code.
+
+2004-04-16 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ Merge from tree-ssa branch:
+
+ 2004-03-25 Diego Novillo <dnovillo@redhat.com>
+ * tree-ssa-alias.c (struct alias_info): Change type of field
+ 'num_references' to varray_type. Update all users.
+
+2004-04-15 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-into-ssa.c (struct mark_def_sites_global_data): Change type of
+ names_to_rename to sbitmap.
+ (insert_phi_nodes_for, insert_phi_nodes_1, insert_phi_nodes):
+ Allocate worklist globally.
+ (ssa_mark_def_sites_initialize_block, ssa_mark_phi_uses,
+ ssa_mark_def_sites, ssa_rewrite_initialize_block,
+ ssa_rewrite_phi_arguments, ssa_rewrite_stmt, rewrite_ssa_into_ssa):
+ Use sbitmaps instead of bitmaps.
+
+2004-04-15 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-scalar-evolution.c (instantiate_parameters): Don't keep
+ symbols after instantiation. Fully instantiate parameters,
+ or fail on chrec_top.
+
+2004-04-15 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-fold-const.h (chrec_merge_types): Move it...
+ * tree-chrec.c (multiply_int, divide_int, add_int, substract_int,
+ integer_divides_p, lcm, gcd, update_initial_condition_to_origin,
+ remove_initial_condition, ): Removed.
+ (evolution_function_in_loop_num): Renamed into
+ hide_evolution_in_other_loops_than_loop.
+ (hide_evolution_in_loop, hide_evolution_in_other_loops_than_loop): New.
+ (chrec_merge_types): ... here.
+ (chrec_merge): Answer chrec_top on EXPONENTIAL_CHREC.
+ (ziv_subscript_p, siv_subscript_p, analyze_ziv_subscript,
+ analyze_siv_subscript, analyze_siv_subscript_cst_affine,
+ analyze_siv_subscript_affine_cst, analyze_siv_subscript_affine_affine,
+ chrec_steps_divide_constant_p, analyze_miv_subscript,
+ analyze_overlapping_iterations): Moved from here...
+ * tree-chrec.h (evolution_function_in_loop_num): Rename declaration.
+ (hide_evolution_in_other_loops_than_loop, hide_evolution_in_loop): New.
+ (analyze_overlapping_iterations): No longer extern.
+
+ * tree-data-ref.c (ziv_subscript_p, siv_subscript_p,
+ analyze_ziv_subscript,
+ analyze_siv_subscript, analyze_siv_subscript_cst_affine,
+ analyze_siv_subscript_affine_cst, analyze_siv_subscript_affine_affine,
+ chrec_steps_divide_constant_p, analyze_miv_subscript,
+ analyze_overlapping_iterations): ... there.
+ (initialize_data_dependence_relation,
+ access_functions_are_affine_or_constant_p): Moved down.
+ (compute_all_dependences): Moved down. Now is static.
+ (build_classic_dir_vector): New.
+ (build_classic_dist_vector):
+ (find_data_references): Renamed find_data_references_in_loop.
+ Now is static.
+ (compute_data_dependences_for_loop): New.
+ (analyze_all_data_dependences): Use compute_data_dependences_for_loop.
+ * tree-data-ref.h (dd_info_available): Don't declare it extern.
+
+ * tree-scalar-evolution.c (dd_info_available): Declare static.
+ (select_outer_and_current_evolutions): Removed.
+ (stats_*): Move the static variables in the chrec_stats structure.
+ (chrec_stats): New structure.
+ (first_iteration_non_satisfying_1): In the multivariate case,
+ don't forget that the outer loops can change the number of iterations.
+ (cannot_analyze_loop_nb_iterations_yet): Removed.
+ (follow_ssa_edge_inner_loop_phi): Refine the case where the
+ evolution of the inner loop is symbolic.
+ (number_of_iterations_in_loop): Factor the end of the cases.
+
+ * tree-dg.c (classic_dist, classic_dir): Declared static.
+ (dg_delete_graph): Delete the classic_dist and classic_dir.
+ (dg_create_graph): Adapt to use compute_data_dependences_for_loop.
+ (gate_ddg, gate_delete_ddg, pass_ddg, pass_delete_ddg): Moved in
+ tree-scalar-evolution.c.
+ * tree-dg.h (dg_create_graph): Pass in struct loops.
+
+2004-04-15 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-data-ref.h (struct data_reference): New field "aux".
+ * tree-vectorizer.h (aligned_access_p, unknown_alignment_for_access_p):
+ New functions.
+ (DR_MISLAIGNMENT): New macro, for accessing the new 'aux' field in
+ data_reference.
+ * tree-vectorizer.c: (vect_analyze_data_refs_alignment): New function.
+ (vect_compute_data_refs_alignment): New function.
+ (vect_compute_data_ref_alignment): New function.
+ (vect_enhance_data_refs_alignment): New function.
+ (vect_force_dr_alignment_p): New function.
+ (vect_align_data_ref): Use new functions aligned_access_p and
+ vect_force_dr_alignment_p.
+ (vect_analyze_data_ref_access): Alignment related checks moved to new
+ functions that deal with alignment.
+ (vect_analyze_data_refs): Likewise.
+ (vect_analyze_loop): Call vect_analyze_data_refs_alignment.
+
+2004-04-15 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop-invariant.c (may_assign_reg_p): Prevent unused parameter
+ warning.
+ * tree-ssa-loop-manip.c (find_use_block, find_use_blocks,
+ defined_inside_loop_p): Removed.
+ (add_exit_phis_var, add_exit_phis, rewrite_into_loop_closed_ssa):
+ Make more efficient.
+ (find_uses_to_rename_use, find_uses_to_rename_stmt,
+ find_uses_to_rename): New functions.
+
+2004-04-15 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-flow.h (compute_global_livein): Declare.
+ * tree-into-ssa.c (struct def_blocks_d): New field
+ phi_blocks.
+ (compute_global_livein): Export.
+ (set_def_block): Record phi_blocks.
+ (get_def_blocks_for): Allocate phi_blocks.
+ (mark_def_sites): Changed due to set_def_block change.
+ (ssa_mark_def_sites_initialize_block, ssa_mark_def_sites):
+ Make virtual defs be kills.
+ (insert_phi_nodes_for): Handle old phi nodes more efficiently.
+ (def_blocks_free): XFREE the bitmaps.
+ * tree-ssa-loop-manip.c (add_exit_phis_use, add_exit_phis_stmt):
+ Removed.
+ (get_loops_exits): Return bitmap.
+ (add_exit_phis_var, find_use_block, find_use_blocks,
+ defined_inside_loop_p): New functions.
+ (add_exit_phis): Use add_exit_phis_var.
+ (rewrite_into_loop_closed_ssa): Reorganize.
+ * tree-ssa-loop.c (pass_loop): Add garbage collection.
+
+2004-04-14 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-chrec.c (chrec_convert): Handle extending correctly.
+ * tree-scalar-evolution.c (set_scev_keep_symbolic): Removed.
+ (set_scalar_evolution): Do not use it.
+ (get_scalar_evolution): Only handle ssa names and constants.
+ (interpret_loop_phi): When interpreting subloop, compute the
+ evolution in outer loop afterwards.
+ (analyze_scalar_evolution_in_loop): New.
+ * tree-scalar-evolution.h (analyze_scalar_evolution_in_loop): Declare.
+ * tree-ssa-loop-ivopts.c: Include tree-fold-const.h, tree-chrec.h
+ and tree-scalar-evolution.h.
+ (tree_ssa_iv_optimize_init): Call scev_initialize.
+ (determine_biv_step, find_bivs, mark_bivs,
+ find_givs_in_stmt): Use scev analyzer.
+ (find_givs_in_stmt_scev): New function.
+ (find_induction_variables): Remove TODO comment.
+ (force_var_cost): Test for TREE_INVARIANT, not for
+ is_gimple_min_invariant.
+ (find_optimal_iv_set): Update comment.
+ (tree_ssa_iv_optimize_finalize): Call scev_finalize.
+
+2004-04-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa.c (raise_value): Removed.
+ (get_eq_name, check_phi_redundancy): New.
+ (kill_redundant_phi_nodes): Use standard algorithm.
+
+2004-04-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-manip.c (allocate_new_names): Use duplicate_ssa_name.
+ Preserve SSA_NAME_OCCURS_IN_ABNORMAL_PHI flag.
+
+2004-04-10 Daniel Berlin <dberlin@dberlin.org>
+
+ * lambda-code.c (lambda_loopnest_transform): Add comments.
+
+2004-04-09 David Edelsohn <edelsohn@gnu.org>
+
+ Backport from mainline:
+ * config/rs6000/t-linux64 (bispecs): Don't add -mlong-double-128 for
+ 32-bit builds when defaulting to 32-bit.
+
+2004-04-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop-iv.c (iv_number_of_iterations): Sign extend the constant value
+ appropriately for the target mode.
+ * tree-fold-const.c (tree_fold_gcd): Make more efficient.
+ * tree-ssa-loop-manip.c (add_exit_phis_use): Do not add unnecessary
+ phis.
+ (rewrite_into_loop_closed_ssa): Fix comment.
+
+2004-04-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgrtl.c (purge_dead_edges): Clean the EDGE_ABNORMAL_CALL flags.
+ * loop-iv.c (iv_number_of_iterations): Handle the case when we prove
+ that the loop does not roll.
+ * opts.c (decode_options): Enable -floop-optimize2 and
+ -ftree-loop-optimize by default.
+ * tree-cfg.c (factored_computed_goto_label,
+ factored_computed_goto): Removed.
+ (factor_computed_gotos): Do not record them.
+ (disband_implicit_edges): Do not unfactor computed jumps.
+ * tree-ssa-loop-ivopts.c (force_gimple_operand): Give correct types
+ to temporary variables.
+ (idx_force_simple, create_iv, rewrite_use_nonlinear_expr,
+ rewrite_use_address, rewrite_use_compare, rewrite_use_outer):
+ Changed due to force_gimple_operand change.
+ (find_bivs): Handle ill-typed assignments correctly.
+
+2004-04-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * passes.c (rest_of_compilation): Enable rest_of_handle_loop2 by
+ flag_loop_optimize2.
+ * tree-scalar-evolution.c (scev_initialize): Find loop exits.
+
+2004-04-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (rewrite_use_outer): Do not remove ssa names
+ prematurely.
+
+2004-04-01 Mostafa Hagog <mustafa@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * config/rs6000/rs6000.md ("*ctrsi_internal1", "*ctrsi_internal2",
+ "*ctrdi_internal1", "*ctrdi_internal2", "*ctrsi_internal3",
+ "*ctrsi_internal4", "*ctrdi_internal3", "*ctrdi_internal4",
+ "*ctrsi_internal5", "*ctrsi_internal6", "*ctrdi_internal5",
+ "*ctrdi_internal6"): Replace register_operand with nonimmediate_operand
+
+2004-03-31 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-into-ssa.c (ssa_rewrite_initialize_block): Update
+ SSA_NAME_OCCURS_IN_ABNORMAL_PHI.
+ (ssa_rewrite_phi_arguments): Ditto.
+ * tree-ssa.c (kill_redundant_phi_nodes): Prevent replacing
+ ssa names that occur in abnormal phi nodes.
+ * tree-ssa-loop-ivopts.c (get_var_def): Handle non-invariant
+ non-ssa name operands.
+ * java/decl.c (java_init_decl_processing): Initialize
+ long_integer_type_node.
+
+2004-03-31 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (idx_find_step): Prevent misscompilation
+ in case the index overflows.
+
+2004-03-31 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>,
+ Dorit Naishlos <DORIT@il.ibm.com>
+
+ * tree-scalar-evolution.c (dump_chrecs_stats): Prevent format warning.
+
+2004-03-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * lambda-code.c (gcc_loop_to_lambda_loop): Changed due to changes in
+ scev.
+ * tree-data-ref.c (analyze_array_indexes, analyze_array): Ditto.
+ * tree-elim-check.c (try_eliminate_check): Ditto.
+ * tree-vectorizer.c (vect_analyze_scalar_cycles): Ditto.
+ * tree-chrec.c (chrec_fold_plus_1): Handle exponential + peeled chrec
+ correctly. Use correct types.
+ (chrec_fold_negate): New.
+ (chrec_merge): Short-circuit the case when the merged values are
+ identical.
+ (no_evolution_in_loop_p): Handle chrec_top correctly.
+ (chrec_convert): Handle polynomial and exponential chrecs corectly.
+ (chrec_type): Use TREE_TYPE.
+ * tree-chrec.h (chrec_fold_negate): Declare.
+ * tree-phinodes.c (create_phi_node): Do not initialize PHI_MARKED.
+ * tree-scalar-evolution.c: Handle evolutions analysed from different
+ loops correctly. Do not use PHI_MARKED. Use correct types.
+ * tree-scalar-evolution.h (analyze_scalar_evolution,
+ instantiate_parameters): Declaration changed.
+ (struct scev_info_str): Moved to tree-scalar-evolution.c.
+ (MI_VAR, MI_INNER_LOOPS_CHREC, MI_OUTER_LOOPS_CHREC): Removed.
+ (new_scev_info_str): Moved to tree-scalar-evolution.c.
+ * tree-ssa-loop-manip.c (add_exit_phis_use): Just add exit phis for
+ superloops of the loop containing the definition.
+ * tree.h (PHI_MARKED): Removed.
+ (tree_phi_node): Field 'marked' removed.
+
+2004-03-30 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-chrec.c (chrec_contains_symbols): Factorize conditions,
+ chrec_not_analyzed_yet is a NULL_TREE.
+ * tree-chrec.h (prove_truth_value_{lt, le, ge, ne, gt, eq}.c):
+ Removed.
+ (evolution_function_is_multivariate,
+ evolution_function_is_peeled_affine_p): New.
+ * tree-data-ref.c (analyze_all_data_dependences): Dump some
+ statistics on the data dependences.
+ * tree-elim-check.c (not_code, prove_truth_value): New.
+ (try_eliminate_check): Use prove_truth_value.
+ * tree-fold-const.h (tree_is_ne): New.
+ * tree-scalar-evolution.c (types_forbid_solutions_p,
+ first_iteration_non_satisfying_noev_noev,
+ first_iteration_non_satisfying_noev_ev,
+ first_iteration_non_satisfying_ev_noev,
+ first_iteration_non_satisfying_ev_ev,
+ first_iteration_non_satisfying_1,
+ first_iteration_non_satisfying,
+ gather_stats_on_scev_database): New functions.
+ (nb_iterations_less, nb_iterations_eq, nb_iterations_ne): Removed.
+ (set_nb_iterations_in_loop): Be more careful on overflow.
+ (number_of_iterations_in_loop): Use first_iteration_non_satisfying.
+ * tree-scalar-evolution.h (first_iteration_non_satisfying,
+ gather_stats_on_scev_database): Declared.
+
+2004-03-30 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (iv_value): Use correct type.
+ (may_eliminate_iv): Add a fixme comment.
+
+2004-03-29 Devang Patel <dpatel@apple.com>
+
+ * tree-flow.h (tree_ssa_loop_version): Add new parameter, basic_block *.
+ (update_lv_condition): New.
+ * tree-ssa-loop-manip.c (copy_phi_nodes): nreverse copied phi nodes list
+ to ensure that phi nodes remain in same order.
+ (lv_update_pending_stmts): Do not nreverse pending list.
+ (lv_adjust_loop_header_phi): Walk two phi nodes list in parallel.
+ (tree_ssa_loop_version): Now condition_bb is input parameter.
+ (update_lv_condition): New.
+ (test_loop_versioning): Use update_lv_condition.
+ * tree-ssa-loop-unswitch.c (tree_unswitch_loop): Update function
+ tree_ssa_loop_version () call by adding 4th parameter.
+
+2004-03-29 Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
+
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ Fix unused vars warning with -disable-checking.
+ * df.c (df_reg_def_chain_create, df_reg_use_chain_create): Ditto.
+
+2004-03-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfghooks.c (split_edge): Update IRREDUCIBLE_LOOP flags.
+ * tree-flow-inline.h (bsi_after_labels): New.
+ * tree-flow.h (struct ssa_name_ann_d): Add need_phi_state field.
+ (bsi_after_labels, rewrite_ssa_into_ssa, duplicate_ssa_name,
+ tree_ssa_dce_no_cfg_changes, rewrite_into_loop_closed_ssa,
+ verify_loop_closed_ssa, compute_phi_arg_on_exit): Declare.
+ (tree_loop_optimizer_init): Declaration changed.
+ * tree-into-ssa.c (struct mark_def_sites_global_data): Add
+ names_to_rename and ssa_names fields.
+ (insert_phi_nodes, get_value_for, set_value_for, set_def_block,
+ set_livein_block, insert_phi_nodes_1, insert_phi_nodes_for,
+ register_new_def, get_reaching_def, rewrite_into_ssa): Handle
+ rewriting of ssa names.
+ (get_phi_state, set_phi_state, ssa_mark_def_sites_initialize_block,
+ ssa_mark_phi_uses, ssa_mark_def_sites, duplicate_ssa_name,
+ ssa_rewrite_initialize_block, ssa_rewrite_phi_arguments,
+ ssa_rewrite_finalize_block, ssa_rewrite_stmt, rewrite_ssa_into_ssa):
+ New functions.
+ * tree-scalar-evolution.c (scev_initialize): Changed due to
+ tree_loop_optimizer_init change.
+ * tree-ssa-dce.c (perform_tree_ssa_dce, perform_tree_ssa_dce,
+ tree_ssa_cd_dce): Handle no cfg changes mode.
+ (tree_ssa_dce_no_cfg_changes): Resurrect.
+ * tree-ssa-loop-im.c (move_computations): Preserve loop closed ssa.
+ * tree-ssa-loop-ivopts.c (struct version_info): Field outermost_usage
+ removed.
+ (update_outermost_usage, find_outermost_usage): Removed.
+ (ip_normal_pos): Fix.
+ (tree_ssa_iv_optimize_init): Do not call find_outermost_usage.
+ (find_interesting_uses_stmt): Use loop closed ssa form.
+ (find_interesting_uses_outside): New.
+ (find_interesting_uses): Use it.
+ (determine_iv_cost): Prefer IP_NORMAL to IP_END.
+ (split_loop_exit_edge, protect_loop_closed_ssa_form_use,
+ protect_loop_closed_ssa_form, compute_phi_arg_on_exit): New functions.
+ (rewrite_use_outer): Preserve loop closed ssa form.
+ (tree_ssa_iv_optimize): Verify loop closed ssa form.
+ * tree-ssa-loop-manip.c (mfb_redirect_exit_edges): Removed.
+ (free_new_names): Free old ssa names.
+ (extend_exit_phi_nodes, add_exit_phis_edge,
+ add_exit_phis_use, add_exit_phis_stmt, add_exit_phis,
+ get_loops_exits, rewrite_into_loop_closed_ssa,
+ check_loop_closed_ssa_use, check_loop_closed_ssa_stmt,
+ verify_loop_closed_ssa): New functions.
+ (tree_duplicate_loop_to_header_edge): Use loop closed ssa form.
+ (tree_ssa_loop_version): Handle irreducible loops correctly.
+ * tree-ssa-loop.c (tree_loop_optimizer_init): Create loop closed ssa
+ form.
+ (tree_ssa_loop_opt, copy_loop_headers): Changed due to
+ tree_loop_optimizer_init change.
+
+2004-03-25 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-data-ref.c (subscript_dependence_tester): Removed.
+ (build_classic_dist_vector): Implement the subscript tester:
+ test for different distances carried by the same loop.
+
+2004-03-23 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-cfg.c (print_loop): Modify dump formatting.
+ (debug_loop_ir): Renamed tree_debug_loops.
+ (tree_debug_loop): New.
+ * tree-chrec.c: Restructure for handling more carefully types.
+ * tree-chre.h: Same.
+ * tree-fold-const.h: Same.
+ * tree-fold-const.c: Same.
+ * tree-scalar-evolution.c: Same.
+ * tree-scalar-evolution.h: Same.
+ * tree-data-ref.c (dump_data_dependence_relation): Remove the
+ dump of the base_name because it produces too many conflicts in
+ the diffs of the testsuite.
+ (compute_all_dependences): Use pointers to the dependence_relations varray.
+ (int_cst_value, build_classic_dist_vector): New.
+ (find_data_references): Use pointers to datarefs varray.
+ (analyze_all_data_dependences): Compute the classic distances.
+ * tree-data-ref.h: Declare functions.
+ * tree-dg.c (dg_create_graph): Update the uses of the data-ref functions.
+ * tree-flow.h (debug_loop_ir): Renamed to tree_debug_loops.
+ (tree_debug_loop): Declare.
+
+2004-03-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-flow.h (tree_ssa_dce_no_cfg_changes): Declaration removed.
+ * tree-ssa-dce.c (remove_dead_stmt): Invalidate dominators if we
+ thread the edge.
+ (tree_ssa_dce_no_cfg_changes): Removed.
+ (perform_tree_ssa_dce, tree_ssa_dce, perform_tree_ssa_dce): Remove
+ no cfg changes mode.
+ * tree-ssa-loop-ivopts.c (force_gimple_operand): Handle overflowed
+ constants.
+ (find_interesting_uses_outer_or_nonlin): New.
+ (find_interesting_uses_op, find_interesting_uses_outer): Use it.
+ (find_interesting_uses_cond, idx_record_use,
+ find_interesting_uses_stmt): Changed due to find_interesting_uses_op
+ change.
+ (create_new_iv, remove_statement, rewrite_use_nonlinear_expr,
+ rewrite_use_outer, tree_ssa_iv_optimize): Handle direct removal of
+ unused ivs.
+ (remove_unused_ivs): New.
+ (tree_ssa_iv_optimize_loop): Call it.
+
+2004-03-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (SCEV_H): New.
+ (tree-ssa-loop-ivcanon.o, tree-ssa-loop-ivopts.o,
+ tree-scalar-evolution.o, tree-data-ref.o, tree-dg.o,
+ tree-elim-check.o, tree-vectorizer.o, tree-loop-linear.o,
+ lambda-code.o): Use it.
+ * tree-chrec.h (build_interval_chrec, build_polynomial_chrec,
+ build_exponential_chrec, build_peeled_chrec): Give a type to the
+ chrec node.
+ * tree-scalar-evolution.c (follow_ssa_edge_in_rhs): Preserve correct
+ type.
+ (analyze_evolution_in_loop): Fix test for edges from inside the loop.
+ (scev_initialize): New.
+ (scev_init): Use it.
+ (scev_finalize): New.
+ (scev_done): Use it.
+ * tree-flow-inline.h (loop_of_stmt): Handle initialization statements
+ without crash.
+ * tree-scalar-evolution.h (scev_initialize, scev_finalize): Declare.
+
+2004-03-23 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c: (vect_align_data_ref): Check for DECL_ALIGN
+ instead of TYPE_ALIGN. Check for DECL_EXTERNAL.
+ (vect_analyze_data_refs): Check for DECL_EXTERNAL.
+
+ Add documentation for functions.
+
+2004-03-22 Dale Johannesen <dalej@apple.com>
+
+ * Makefile.in (OBJS-common): Remove duplicate loop-iv.o.
+
+2004-03-22 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c: Avoid usage of global variables.
+
+2004-03-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-unswitch.o: New file.
+ * Makefile.in (tree-ssa-loop-unswitch.o): Add.
+ (tree-ssa-loop-im.o): Add flags.h dependency.
+ * flags.h (flag_unswitch_loops): Declaration moved from ...
+ * toplev.h (flag_unswitch_loops): ... here.
+ * tree-flow.h (tree_ssa_loop_version): Declaration changed.
+ (tree_ssa_unswitch_loops, estimate_loop_size): Declare.
+ * tree-ssa-loop-im.c: Include flags.h.
+ (movement_possibility, stmt_cost, move_computations_stmt):
+ Handle unswitchable conditions.
+ * tree-ssa-loop-ivcanon.c (estimate_loop_size): Export.
+ * tree-ssa-loop-ivopts.c (find_interesting_uses_cond): Handle
+ if (0) and if (1).
+ * tree-ssa-loop-manip.c (tree_ssa_loop_version): Return the newly
+ created loop.
+ * tree-ssa-loop.c (tree_ssa_loop_opt): Call tree_ssa_unswitch_loops.
+
+2004-03-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ Merge from tree-ssa branch (lno-merge-20040321).
+
+2004-03-20 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c: (vect_init_vector): New function.
+ (vect_get_vec_def_for_operand): Support loop invariant uses.
+ (vect_is_simple_use): Likewise.
+ (vect_mark_stmts_to_be_vectorized): Likewise.
+ (vect_analyze_scalar_cycles): Redundant check removed.
+
+ (vect_analyze_operations): Don't fail for vdefs that have uses
+ outside the loop.
+
+ (vect_stmt_relevant_p): A call to get_stmt_operands removed (already
+ performed at new_loop_vec_info).
+ (vect_mark_stmts_to_be_vectorized): Likewise.
+
+ (need_imm_uses_for): New Function.
+ (vectorize_loops): Add call to compute_immediate_uses and free_df.
+
+2004-03-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-chrec.c (chrec_fold_multiply_ival_cst): Handle negative
+ constants correctly.
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ Enable use of scev.
+
+2004-03-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR optimization/14658
+ * loop-invariant.c (move_invariant_reg): Handle assignments
+ with nontrivial lhs correctly.
+
+2004-03-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * df.c (df_reg_def_chain_create, df_reg_use_chain_create): Do not clean
+ up the old information here.
+ (df_reg_def_chain_clean, df_reg_use_chain_clean): New.
+ (df_analyse_subcfg): Call them.
+
+2003-03-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-flow.h (loop_commit_inserts): Declare.
+ * tree-ssa-loop-im.c (commit_inserts): Rename to...
+ (loop_commit_inserts): ... this.
+ * move_computations (move_computations, determine_lsm): Use
+ loop_commit_inserts.
+ * tree-ssa-loop-ivopts.c (AVG_LOOP_NITER): New macro.
+ (struct iv): New field use_id.
+ (struct version_info): New field preserve_biv.
+ (alloc_iv, record_use, free_loop_data): Initialize new fields.
+ (enum use_type): Add USE_OUTER.
+ (dump_use, find_interesting_uses_op, add_derived_ivs_candidates,
+ determine_use_iv_cost, rewrite_use): Handle USE_OUTER.
+ (dump_cand, find_interesting_uses_stmt, add_candidate_1,
+ determine_use_iv_cost_condition, determine_iv_cost, set_cost,
+ create_new_iv, rewrite_use_nonlinear_expr): Handle final value
+ replacement.
+ (find_interesting_uses_outer, add_iv_outer_candidates,
+ may_replace_final_value, determine_use_iv_cost_outer,
+ remove_statement, rewrite_use_outer): New functions.
+ (var_at_use): Replaced by ...
+ (var_at_stmt): ... this.
+ (get_computation_at): Split from ...
+ (get_computation): ... here.
+ (get_computation_cost_at): Split from ...
+ (get_computation_cost): ... here.
+ (iv_value): Split from ...
+ (cand_value_at): ... here.
+ (may_eliminate_iv, rewrite_use_compare): Reflect these changes.
+ (tree_ssa_iv_optimize_loop): Call loop_commit_inserts.
+ * tree-ssanames.c (make_ssa_name): Handle NULL argument.
+
+2003-03-18 Devang Patel <dpatel@apple.com>
+
+ * tree-ssa-live.c (new_tree_live_info): Set num_blocks to
+ last_basic_block instead of n_basic_blocks.
+ (calculate_live_on_entry): Use last_basic_block instead of
+ n_basic_blocks.
+ (calculate_live_on_exit): Same.
+
+2004-03-17 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-cfg.c (thread_jumps): Don't thread jumps over loop headers.
+ * tree-flow.h (rewrite_into_ssa): Declaration changed.
+ (kill_redundant_phi_nodes, tree_loop_optimizer_init): Declare.
+ * tree-optimize.c (execute_todo): Do not free vars_to_rename.
+ (execute_one_pass): Do not allocate vars_to_rename.
+ (tree_rest_of_compilation): Allocate vars_to_rename.
+ * tree-scalar-evolution.c (number_of_iterations_in_loop): Handle
+ loops exited when condition is true.
+ (initialize_scalar_evolutions_analyzer): Use tree_loop_optimizer_init.
+ * tree-ssa-chrec.c (how_far_to_positive): Handle chrec_top correctly.
+ * tree-ssa-dom.c (tree_ssa_dominator_optimize): Changed due to
+ rewrite_into_ssa change.
+ * tree-ssa-loop-im.c (move_computations, determine_lsm): Ditto.
+ * tree-ssa-loop-ivcanon.c (canonicalize_loop_induction_variables):
+ Use scev analyser.
+ * tree-ssa-loop-manip.c (allocate_new_names): Update name memory
+ tags.
+ * tree-ssa-loop.c (tree_loop_optimizer_init): New.
+ (tree_ssa_loop_opt, copy_loop_headers): Use it.
+ * tree-ssa.c (rewrite_into_ssa): Use argument to decide whether
+ to rename all variables.
+ (rewrite_all_into_ssa): New.
+ (pass_build_ssa): Use it.
+ (kill_redundant_phi_nodes): Export.
+
+2004-03-15 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * tree-ssa-return.c (tree_ssa_return):
+ Move check for NULL return value above check
+ for a modify expr.
+
+2004-03-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (gate_scev_iv_canon): Do not check rtl
+ level flags here.
+ * tree-ssa-loop-ivcanon.c (get_base_for): Verfify that the argument
+ of the phi node is a constant.
+ (loop_niter_by_eval, create_canonical_iv, try_unroll_loop_completely,
+ canonicalize_loop_induction_variables): Handle loops with more than
+ one exit.
+ (find_loop_niter_by_eval): New.
+ (canonicalize_induction_variables): Check rtl level flags here.
+
+2004-03-12 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * tree-ssa-return.c (tree_ssa_return):
+ Only do it when we have a modify expr.
+
+ * tree-ssa-return.c (tree_ssa_return):
+ Add new comments and fix some old ones.
+
+2004-03-12 Falk Hueffner <falk@debian.org>
+
+ * tree-pass.h: Declare pass_return.
+
+2004-03-11 Andrew Pinski <apinski@apple.com>
+
+ PR optimization/14135
+ * tree-ssa-return.c: New file.
+ * Makefile.in (tree-ssa-return.o): Add.
+ * tree-optimize.c (init_tree_optimization_passes): Add
+ pass_return.
+ * timevar.def (TV_TREE_RETURN): New.
+
+2004-03-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivcanon.o: New file.
+ * Makefile.in (tree-ssa-loop-ivcanon.o): Add.
+ * flags.h (flag_unroll_loops): Declare.
+ * loop-invariant.c (record_use): Fix.
+ * params.def (PARAM_MAX_COMPLETELY_PEELED_INSNS): Increment.
+ * timevar.def (TV_TREE_LOOP_IVCANON): New.
+ * toplev.h (flag_unroll_loops): Declaration moved to flags.h.
+ * tree-flow.h (enum tree_ann_type): Remove MISC_ANN.
+ (struct tree_ann_common_d): Add aux field.
+ (struct misc_ann_d): Removed.
+ (struct stmt_ann_d): Removed aux field.
+ (union tree_ann_d): Removed misc field.
+ (canonicalize_induction_variables): Declare.
+ * tree-optimize.c (init_tree_optimization_passes): Add
+ pass_scev_iv_canon.
+ * tree-pass.h (pass_scev_iv_canon): Declare.
+ * tree-scalar-evolution.c (scev_iv_canon, gate_scev_iv_canon,
+ pass_scev_iv_canon): New.
+ (scev_done): Run cfg cleanup.
+ * tree-ssa-loop-im.c (LIM_DATA, determine_invariantness_stmt,
+ move_computations_stmt, schedule_sm): Use aux field in common
+ part of annotations.
+ * tree-ssa-loop-manip.c (allocate_new_names, rename_op,
+ free_new_names): Use common aux field.
+ (tree_duplicate_loop_to_header_edge): Fix memory leak.
+ * tree-ssa.c (mark_def_sites): Fix.
+ * tree-vectorizer.h (set_stmt_info, vinfo_for_stmt): Use aux field in
+ common part of annotations.
+ * gcc.dg/tree-ssa/ivcanon-1.c: New test.
+
+2004-03-11 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (lambda-mat.o, lambda-trans.o, lambda-code.o): Add TM_H
+ dependency.
+
+2004-03-09 Olga Golovonevsky <olga@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c: (vect_transform_binop): Removed.
+ (vect_transform_op): New function instead of vect_transform_binop,
+ to support both unary and binary operations.
+ (vect_is_supportable_binop): Removed.
+ (vect_is_supportable_op): New function instead of
+ vect_is_supportable_binop to support additional codes.
+ * tree-vectorizer.h: (operation_type): New enum type declared.
+ * config/rs6000/altivec.md: (andvv16qi3, andv8hi3, one_cmplv16qi2,
+ one_cmplv8hi2, one_cmplv4si2, iorv16qi3, iorv8hi3,): New modelling.
+ (*movv4si_internal): Relax condition.
+ (*movv8hi_internal1): Likewise.
+ (*movv16qi_internal1): Likewise.
+ (*movv4sf_internal1): Likewise.
+
+2004-03-09 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (df.o): Remove FIBHEAP_H dependency.
+ (invariant.o): Add df.h dependency.
+ * df.c: Do not include fibheap.h.
+ (df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
+ prune_to_subcfg, df_bb_modify, df_find_def, dataflow_set_a_op_b,
+ dataflow_set_copy): New functions.
+ (df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
+ df_refs_update, df_reg_table_realloc, df_ref_create,
+ df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
+ df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
+ df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
+ (df_rd_transfer_function, df_ru_transfer_function,
+ df_lr_transfer_function): Type of bitmaps changed to void *.
+ (hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
+ (hybrid_search): ... new function.
+ (iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
+ (iterative_dataflow): ... new function. Avoid use of fibheaps for
+ a worklist. Do not process basic blocks unnecessarily.
+ * df.h (struct ref): Add data field.
+ (DF_REF_DATA): New macro.
+ (df_analyse_subcfg, df_find_def): Declare.
+ (transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
+ (transfer_function): ... declare.
+ (iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
+ (iterative_dataflow): ... declare.
+ (enum set_representation, struct dataflow): New.
+ * loop-invariant.c: Include df.h.
+ (struct loop_data): Remove modified_regs field.
+ (struct def): Remove redundant fields.
+ (struct use): Add insn field.
+ (defs, adef, last_def, m_reg_info, reg_info): Removed.
+ (struct reg): Removed.
+ (record_def, note_insn_stores, find_defs_insn, find_defs_bb,
+ get_current_def, record_dependencies_fer, record_dependencies,
+ move_actual_defs): Removed.
+ (find_defs, find_invariants_insn, create_new_invariant,
+ find_invariants_bb, find_invariants_body, find_invariants,
+ find_invariants_to_move, move_invariant_reg,
+ move_invariants, move_single_loop_invariants,
+ move_loop_invariants): Use df.c.
+ (init_inv_motion_data): Do not initialize removed structures.
+ (free_inv_motion_data, free_loop_data): Do not cleanup removed
+ structures.
+ (check_dependencies, find_invariant_insn, record_uses): New.
+ (record_use): Record the insn.
+ (get_inv_cost): Update comments.
+
+2004-03-09 Andreas Jaeger <aj@suse.de>
+
+ * common.opt: Put tree-loop-linear at right place.
+
+2004-03-09 Daniel Berlin <dberlin@dberlin.org>
+
+ * Makefile.in: Add lambda-mat.o, lambda-code.o, and tree-loop-linear.o.
+ * common.opt: Add -ftree-loop-linear.
+ * flags.h: Add flag_tree_loop_linear.
+ * opts.c: Handle tree-loop-linear option.
+ * timevar.def (TV_TREE_LINEAR_TRANSFORM): New.
+ * tree-flow.h (linear_transform_loops): New prototype.
+ * tree-optimize.c (pass_scev_linear_transform): New.
+ * tree-pass.h (pass_scev_linear_transform): Ditto.
+ * tree-scalar-evolution.c (scev_linear_transform): Ditto.
+ (gate_scev): Add check for flag_tree_loop_linear.
+ (gate_scev_linear_transform): New.
+ * lambda-code.c: New file.
+ * lambda-mat.c: New file.
+ * lambda-trans.c: New file.
+ * lambda.h: New file.
+ * tree-loop-linear.c: New file.
+
+2004-03-09 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * tree-ssa-phiopt.c (conditional_replacement):
+ Initialize new_var to NULL to prevent the
+ uninitialized warning.
+
+ * tree-ssa-phiopt.c (conditional_replacement):
+ Disable the making a new variable for different
+ types.
+
+ * tree-ssa-phiopt.c (conditional_replacement):
+ Disable the use of non-gimple of invert_truthvalue.
+
+2004-03-08 Andrew Pinski <apinski@apple.com>
+
+ * tree-ssa-phiopt.c (make_temp): New function.
+ (tree_ssa_phiopt): Use absolute_replacement
+ and value_replacement.
+ (conditional_replacement): Handle the case
+ the conditional is not a variable and
+ the types do not match.
+ Handle the case where invert_truthvalue
+ would create non-gimple.
+ (absolute_replacement): New function.
+ (value_replacement): New function.
+
+2004-03-08 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * tree-scalar-evolution.c (set_scalar_evolution,
+ set_scalar_evolution_outer_value): Compute the loop number
+ instead of passing it as a parameter.
+
+2004-03-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-live.c (coalesce_tpa_members): Update the root
+ variable of the partition.
+
+2004-03-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (enum iv_position): Add IP_ORIGINAL.
+ (struct iv_cand): Add incremented_at.
+ (dump_cand, add_candidate_1, add_candidate, add_old_iv_candidates,
+ var_at_use, get_computation, get_computation_cost,
+ cand_value_at, determine_iv_cost, find_best_candidate,
+ create_new_iv): Handle IP_ORIGINAL.
+ (stmt_after_ip_original_pos, stmt_after_increment): New functions.
+ (find_givs_in_stmt): Cast the values to the result type.
+ (record_invariant): Do not record virtual operands.
+
+2004-03-03 Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-scalar-evolution.c: Use pointers to varray instead of
+ varrays for functions that insert in the scev database.
+
+2004-03-03 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * Makefile.in (OBJS-common): Add tree-elim-check.o.
+ (tree-chrec.o): Add dependence on tree-pass.h.
+ (tree-elim-check.o): New rule.
+ * tree-elim-check.c: New file.
+ * basic-block.h (edge_source, edge_destination): New inlined
+ functions.
+ * cfgloop.h (loop_nb_iterations): Added a comment on the use
+ of this accessor.
+ * common.opt (ftree-elim-checks): New flag.
+ * flags.h (flag_tree_elim_checks): Declared here.
+ * opts.c (decode_options): Set flag_tree_elim_checks to zero.
+ (common_handle_option): Add case OPT_ftree_elim_checks.
+ * timevar.def (TV_TREE_ELIM_CHECKS): Defined.
+ * toplev.c (flag_tree_elim_checks): Defined.
+ * tree-cfg.c (print_pred_bbs, print_succ_bbs, print_loop):
+ Modify the dumping style. Print nb_iterations.
+ * tree-chrec.c, tree-chrec.h, tree-scalar-evolution.c,
+ tree-scalar-evolution.h, tree-data-ref.c: New version of the
+ scalar evolution algorithm. Don't use a schedule for
+ analyzing the scalar variables.
+ * tree-fold-const.c (tree_fold_bezout): Define.
+ * tree-fold-const.h (tree_fold_int_round_div,
+ tree_fold_int_trunc_mod, tree_fold_int_ceil_mod,
+ tree_fold_int_floor_mod, tree_fold_int_round_mod): Removed, because
+ not used for the moment.
+ (chrec_merge_types): New function.
+ * tree-optimize.c (pass_scev_elim_checks): Register the pass.
+ * tree-pass.h (pass_scev_elim_checks): Declare the pass.
+ * tree-pretty-print.c (dump_generic_node): Print
+ PEELED_CHREC. Remove PERIODIC_CHREC.
+ * tree-vectorizer.c: Modify the use of
+ analyze_scalar_evolution.
+ * tree.def (POLYNOMIAL_CHREC, EXPONENTIAL_CHREC): Store the
+ evolution loop in a third leaf instead of in TREE_TYPE.
+ TREE_TYPE is then used in storing the type of the chrec.
+ (PERIODIC_CHREC): Removed since it is not used for the moment.
+ (PEELED_CHREC): New node.
+ * doc/invoke.texi (fdump-tree-scev, fdump-tree-ddall): Correct
+ the name of these flags.
+ (ftree-elim-checks, fdump-tree-elck): Document.
+
+2004-03-02 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (number_of_iterations_cond, cand_value_at):
+ Cast the constants.
+
+2004-03-01 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (tree-ssa-loop-ivopts.o): Add HASHTAB_H dependency.
+ * tree-ssa-loop-ivopts.c: Include hashtab.h.
+ (old_highest_ssa_version): Rename to version_info_size.
+ (struct tree_niter_desc): Split from ...
+ (struct loop_data): ... here.
+ (relevant): New variable.
+ (tree_ssa_iv_optimize_init, set_iv, find_induction_variables,
+ record_invariant, find_interesting_uses, add_old_ivs_candidates,
+ determine_set_costs, free_loop_data, tree_ssa_iv_optimize_finalize):
+ Use bitmap of relevant ssa names.
+ (var_at_use): New function.
+ (get_computation): Use it.
+ (multiply_by_cost): Cache all results.
+ (mbc_entry_hash, mbc_entry_eq): New functions.
+ (number_of_iterations_cond): Split from ...
+ (determine_number_of_iterations): ... here.
+ (cand_value_at, may_eliminate_iv): New functions.
+ (determine_use_iv_cost_condition, rewrite_use_compare): Implement iv
+ elimination.
+
+2004-03-01 Devang Patel <dpatel@apple.com>
+
+ * tree-dg.c (dg_delete_graph): Reset varrays.
+ (gate_ddg) : Check current loops.
+
+2004-02-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-cfg.c (cleanup_control_expr_graph): Prevent probability from
+ overflowing.
+ * loop-invariant.c (get_current_def): Fix.
+ * tree-ssa-loop-im.c (move_computations): Only call rewrite_into_ssa
+ if vars_to_rename is nonempty.
+ * tree-ssa-loop-ivopts.c (outermost_usage, ivs): Removed.
+ (struct version_info): New.
+ (version_info, max_inv_id): New variables.
+ (struct cost_pair): Added depends_on field.
+ (struct iv_use): Removed fields choices, n_choices, min_cost and
+ min_cost_cand.
+ (enum iv_position, dump_cand, ip_end_pos, add_candidate_1,
+ determine_iv_cost, create_new_iv): IP_START position disabled.
+ (find_optimal_iv_set_1, min_remaining_cost, undo_changes,
+ execute_removal, add_forbidden_ivs, try_candidate): Removed.
+ (dump_use): Do not dump removed fields.
+ (ver_info, name_info, update_outermost_usage, record_invariant,
+ find_invariants_stmt, find_depends, try_improve_iv_set): New functions.
+ (find_outermost_usage): Handle uses in phis.
+ (divide): Update comment.
+ (tree_ssa_iv_optimize_init): Initialize version_info instead of ivs
+ and outermost_usage.
+ (set_iv, get_iv, find_induction_variables, add_old_ivs_candidates):
+ Use version_info instead of ivs.
+ (record_use): Do not initialize removed fields.
+ (find_interesting_uses_op): Call record_use.
+ (find_interesting_uses_stmt): Call find_invariants_stmt.
+ (find_interesting_uses): Scan just the current loop.
+ (set_use_iv_cost): Initialize depends_on field.
+ (get_use_iv_cost): Return depends_on field.
+ (get_computation): Handle special cases.
+ (force_var_cost, split_address_cost, ptr_difference_cost,
+ difference_cost, get_computation_cost, determine_use_iv_cost_generic,
+ determine_use_iv_cost_address, determine_use_iv_cost_condition):
+ Determine depends_on bitmap.
+ (determine_use_iv_costs): Dump depends_on bitmap.
+ (init_set_costs): Use information about invariants.
+ (find_best_candidate, set_cost, get_initial_solution,
+ find_optimal_iv_set): Take depends_on into account.
+ (rewrite_uses): Use use->selected to select candidate.
+ (free_loop_data, tree_ssa_iv_optimize_finalize): Cleanup version_info
+ instead of ivs. Free depends_on bitmaps.
+ (tree_ssa_iv_optimize_loop): Do not pass iv_set to rewrite_uses.
+
+2004-02-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloopmanip.c (loopify): Fix comment.
+ * loop-iv.c (lowpart_byte, lowpart_subreg_p): Removed.
+ (lowpart_subreg, simple_reg_p, iv_get_reaching_def, get_biv_step_1,
+ iv_analyse_op, iv_analyse, get_iv_value): Use standard subreg
+ manipulation functions.
+ (simplify_using_assignment): Handle hardregs correctly.
+ (canon_condition): Use swap_commutative_operands_p.
+ (iv_number_of_iterations): Avoid overflow.
+ * loop-unroll.c (unroll_loop_runtime_iterations): Pass additional
+ argument to compare_and_jump_seq.
+ * loop-unswitch.c (unswitch_loop, may_unswitch_on,
+ unswitch_single_loop, compare_and_jump_seq): Handle comparisons of
+ ccmode registers.
+ * rtl.h (compare_and_jump_seq): Declaration changed.
+
+2004-02-25 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.h (assignment_vec_info_type): New enum value for
+ stmt_vec_info_type.
+ * tree-vectorizer.c (vect_transform_assignment): New function.
+ Support vectorization of assignment stmts.
+ (vect_transform_stmt): Call vect_transform_assignment.
+ (vect_is_supportable_assignment): New function.
+ (vect_analyze_operations): Call vect_is_supportable_assignment.
+
+ (vect_create_index_for_array_ref): Replace unsigned_intSI_type_node
+ with size_type_node.
+ (vect_transform_loop_bound): Likewise.
+
+ (get_vectype_for_scalar_type): Avoid division by 0.
+
+ (vect_analyze_operations): Apply check for no-out-of-loop-uses also
+ to stmts that are marked irrelevant.
+
+2004-02-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-flow.h (for_each_index): Declare.
+ * tree-ssa-loop-im.c (struct lim_aux_data): Add always_executed_in
+ and sm_done fields.
+ (struct use): New.
+ (max_uid): New static variable.
+ (outermost_invariant_loop, commit_inserts, may_move_till,
+ force_move_till, record_use, free_uses, single_reachable_address,
+ rewrite_uses, schedule_sm, determine_lsm_reg,
+ loop_suitable_for_sm, determine_lsm_loop, determine_lsm): New functions.
+ (add_dependency): Use outermost_invariant_loop.
+ (set_level): Add sanity checking.
+ (determine_invariantness_stmt): Set always_executed_in field.
+ (move_computations_stmt): Modified.
+ (move_computations): Use commit_inserts.
+ (fill_always_executed_in): Take possibility of an infinite loop into
+ account.
+ (tree_ssa_lim): Call determine_lsm.
+ * tree-ssa-loop-ivopts.c (for_each_index): Export.
+ (rewrite_use_address): Improve handling of memory tags.
+
+ * tree-ssa-loop.c (do_while_loop_p): Readd.
+ (copy_loop_headers): Readd check for do_while_loop_p.
+ * tree-ssa-operands.c (add_stmt_operand): Modified.
+
+2004-02-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ Merge from tree-ssa branch (lno-merge-20040221).
+
+2004-02-20 Devang Patel <dpatel@apple.com>
+
+ * tree-vectorizer.c (vect_analyze_data_ref_dependence): Use
+ ddg_direction_between_stmts ().
+
+2004-02-20 Devang Patel <dpatel@apple.com>
+
+ * tree-data-ref.h (data_dependence_direction): Add new member
+ dir_independent.
+ * tree-dg.h (tree-data-ref.h): Include.
+ (ddg_direction_between_stmts, ddg_distance_between_stmts): New decls.
+ * tree-dg.c (find_ddr_between_stmts, ddg_direction_between_stmts,
+ ddg_distance_between_stmts): New functions.
+
+2004-02-19 Devang Patel <dpatel@apple.com>
+
+ * tree-dg.c (dg_delete_edges, dg_delete_node, dg_delete_graph,
+ dg_delete_edge, gate_delete_ddg): New functions.
+ (pass_delete_ddg): New.
+ * tree-dg.h (dg_delete_graph, dg_delete_edge): New extern decls.
+ * tree-optimize.c (init_tree_optimization_passes): Add new pass
+ pass_delete_ddg.
+ * tree-pass.h (pass_delete_ddg): New extern.
+
+2004-02-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-flow.h (create_iv): Declare.
+ * tree-ssa-loop-ivopts.c (create_iv): New function.
+ (create_new_iv): Use create_iv.
+
+2004-02-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop.c (do_while_loop_p): New function.
+ (copy_loop_headers): Do not peel do-while loops.
+
+2004-02-19 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop-invariant.c: New file.
+ * Makefile.in (loop-invariant.o): New.
+ * cfgloop.h (init_set_costs, global_cost_for_size,
+ move_loop_invariants): Declare.
+ * toplev.c (rest_of_handle_loop2): Call move_loop_invariants.
+ (lang_dependent_init): Call init_set_costs.
+ * tree-ssa-loop-ivopts.c (avail_regs, res_regs, small_cost, pres_cost,
+ spill_cost): Made static.
+ (global_cost_for_size): Export.
+ (ivopts_global_cost_for_size, init_set_costs): New functions.
+ (determine_set_costs): Do not initialize set cost constants.
+ Use ivopts_global_cost_for_size.
+ (try_candidate, find_optimal_iv_set_1, set_cost): Use
+ ivopts_global_cost_for_size.
+
+ * cfgloop.c (fill_sons_in_loop): Fix typo in comment.
+
+2004-02-17 Devang Patel <dpatel@apple.com>
+
+ * tree-vectorize.c (vect_create_data_ref): Set TREE_ADDRESSABLE bit.
+ (vectorize_loops): Reset loop->aux.
+
+2004-02-16 Devang Patel <dpatel@apple.com>
+
+ * Makefile.in (TREE_FLOW_H): Add tree-dg.h
+ (OBJS-common): Add tree-dg.o
+ (gtype-desc.o): Depend on tree-dg.h
+ (tree-dg.o): New rule.
+ (GTFILES): Add tree-data-ref.h, tree-data-ref.h
+ * common.opt (ftree-ddg): Add new option.
+ * flags.h (flag_ddg): New extern.
+ * gengtype.c (open_base_files): Add tree-dg.h and tree-data-ref.h in
+ the list.
+ * opts.c (decode_option): Set flag_ddg to zero.
+ (common_handle_option): Handle OPT_ftree_ddg.
+ * timevar.def (TV_DEP_GRAPH): New.
+ * toplev.c (flag_ddg): New flag.
+ (lang_independent_options): Add entry for -ftree-ddg.
+ * tree-data-ref.c (compute_all_dependences): Make externally visible.
+ * tree-data-ref.h (data_reference, subscript, data_dependence_relation)
+ Add GTY markers.
+ (compute_all_dependences): Make externally visible.
+ * tree-dg.c: New file.
+ * tree-dg.h: New file.
+ * tree-flow-inline.h (dg_node_for_stmt): New function.
+ * tree-flow.h (tree-dg.h): Include.
+ (stmt_ann_d): New member, dg_node.
+ * tree-optimize.c (init_tree_optimization_passes): Add pass_ddg.
+ * tree-pass.h (PROP_scev): Define.
+ (tree_opt_pass pass_ddg): Extern decl.
+ * tree-scalar-evolution.c (pass_scev_anal): Provide PROP_scev property.
+ * varray.c (element[NUM_VARRAY_DATA]): Add new member for dependence
+ graph.
+ * varray.h (varray_data_enum): New member VARRAY_DATA_DG.
+ (varray_data_tag): New member dg.
+ (VARRAY_DG_INIT): New #define.
+ (VARRAY_DG): New #define.
+ (VARRAY_PUSH_DG): New #define.
+
+2004-02-12 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-optimize.c (init_tree_optimization_passes): Move ch after
+ the first dominator optimization pass.
+ * tree-ssa-loop.c (should_duplicate_loop_header_p,
+ copy_loop_headers): Work over ssa.
+ (pass_ch): Require and update ssa form.
+ (mark_defs_for_rewrite, duplicate_blocks): New.
+
+2004-02-10 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (for_each_index, prepare_decl_rtl,
+ peel_address): Handle RESULT_DECL.
+
+2004-02-10 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop-doloop.c (doloop_optimize): Use get_simple_loop_desc.
+ * loop-init.c (loop_optimizer_finalize): Free the simple loop
+ descriptions.
+ * loop-unroll.c (unroll_and_peel_loops): Do not free the simple loop
+ descriptions.
+ (decide_peel_once_rolling, decide_peel_completely,
+ decide_unroll_stupid): Test assumptions.
+ decide_unroll_constant_iterations, decide_unroll_runtime_iterations,
+ decide_peel_simple, peel_loop_simple, unroll_loop_stupid): Update
+ number of iterations info.
+ (unroll_loop_constant_iterations, unroll_loop_runtime_iterations,
+ (loop_exit_at_end_p): Use get_simple_loop_desc.
+
+2004-02-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloop.h (struct niter_desc): Add first_special, extend,
+ extend_mode, delta and mult fields.
+ (get_iv_value): Declare.
+ * expr.c (force_operand): Handle subregs of expressions.
+ * loop-doloop.c (doloop_valid_p): Test desc->infinite properly.
+ * loop-iv.c (dump_iv_info): Dump new fields.
+ (lowpart_byte, lowpart_subreg_p, lowpart_subreg,
+ iv_constant, iv_subreg, iv_extend, iv_neg, iv_add, iv_mult,
+ get_biv_step_1, get_biv_step, shorten_into_mode,
+ canonicalize_iv_subregs): New functions.
+ (simple_reg_p, simple_set_p, iv_get_reaching_def, iv_analyse_biv,
+ iv_analyse_op, iv_analyse, iv_number_of_iterations): Handle subregs.
+ * loop-unswitch.c (may_unswitch_on): Handle subregs.
+
+2004-02-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * Makefile.in (tree-ssa-loop-ivopts.o): Add RECOG_H and insn-config.h
+ dependency.
+ * loop-iv.c (iv_analysis_loop_init): Ensure we only care about
+ increments that are done just once each iteration.
+ * timevar.def (TV_TREE_LOOP_IVOPTS, TV_TREE_CH): New.
+ * tree-ssa-loop-ivopts.c: Include insn-config.h and recog.h.
+ (INFTY): Increase.
+ (struct iv_use): Add choices, n_choices, min_cost_cand and selected
+ fields. Rename field best_cost to min_cost.
+ (CONSIDER_ALL_CANDIDATES_BOUND): Decrease.
+ (dump_use): Dump new fields.
+ (dump_uses, cst_and_fits_in_hwi, int_cst_value, build_int_cst,
+ divide, strip_offset, add_cost, multiply_by_cost, get_address_cost,
+ force_var_cost, peel_address, ptr_difference_const,
+ split_address_cost, ptr_difference_cost, difference_cost,
+ get_computation_cost): New functions.
+ (find_induction_variables): Formating changes.
+ (record_use): Initialize new fields.
+ (add_old_ivs_candidates): Do not add invariants.
+ (set_use_iv_cost): Set min_cost.
+ (get_use_iv_cost): Fix.
+ (get_computation): Use less memory.
+ (determine_use_iv_cost_generic, determine_use_iv_cost_address,
+ determine_use_iv_cost_condition, determine_iv_cost): Use
+ new cost estimation functions.
+ (compute_iv_set_cost): Removed.
+ (struct undo_record): New.
+ (use_with_min_choices, min_remaining_cost, undo_changes,
+ execute_removal, add_forbidden_ivs, try_candidate, set_cost,
+ get_initial_solution): New functions.
+ (find_optimal_iv_set_1, find_optimal_iv_set): Made more effective.
+ (create_new_ivs, rewrite_use_nonlinear_expr, rewrite_use_address):
+ Unshare created expressions.
+ (free_loop_data): Free new structures.
+ (tree_ssa_iv_optimize_loop): Remove garbage collection.
+ (tree_ssa_iv_optimize): Use TV_TREE_LOOP_IVOPTS timevar.
+ * tree-ssa-loop.c (pass_ch): Use TV_TREE_CH timevar.
+
+2004-02-02 Steven Bosscher <stevenb@suse.de>
+
+ * common.opt: Re-order some options in ASCII collating order.
+
+2004-01-30 Devang Patel <dpatel@apple.com>
+
+ * cfgloopmanip.c (loopify): Always redirect switch_bb's BRANCH_EDGE,
+ however redirect FALLTHRU_EDGE only if asked.
+ * tree-ssa-loop-manip.c (tree_ssa_loop_version): Update FALLTHRU_EDGE
+ pending stmts.
+
+2004-01-29 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (find_optimal_iv_set_1, compute_iv_set_cost):
+ Fix memory leak, speed up.
+ (tree_ssa_iv_optimize_finalize): Move reseting of DECL_RTL...
+ (free_loop_data): ... here.
+
+2004-01-29 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * basic-block.h (FOR_BB_INSNS, FOR_BB_INSNS_REVERSE): New macros.
+ * cfgloop.c (num_loop_branches): New function.
+ * cfgloop.h (struct loop_desc): Add field strange.
+ (struct loop): Remove fields simple, desc, has_desc.
+ (num_loop_branches, get_simple_loop_desc, free_simple_loop_desc):
+ Declare.
+ (simple_loop_desc): New inline function.
+ * cfgloopanal.c (count_loop_iterations): Set field strange.
+ (simple_loop_exit_p): Initialize postincr properly.
+ * loop-iv.c (assign_luids, mark_sets, simplify_using_initial_values):
+ Use FOR_BB_INSNS/FOR_BB_INSNS_REVERSE.
+ (iv_number_of_iterations): Restrict the number of iterations to the
+ actual mode.
+ (find_simple_exit): Check results with the old simple loop analyser.
+ (get_simple_loop_desc, free_simple_loop_desc): New functions.
+ * loop-unroll.c (loop_exit_at_end_p): New function.
+ (unroll_and_peel_loops, peel_loops_completely,
+ decide_unrolling_and_peeling, decide_peel_once_rolling,
+ decide_peel_completely, peel_loop_completely,
+ decide_unroll_constant_iterations, unroll_loop_constant_iterations,
+ decide_unroll_runtime_iterations, unroll_loop_runtime_iterations,
+ decide_peel_simple, decide_unroll_stupid): Use new iv analysis.
+ * predict.c (predict_loops): Use new iv analysis.
+
+ * tree-ssa-loop.c (copy_loop_headers): Predict entry edge from
+ copied loop header to be taken.
+
+ * tree-cfg.c (tree_find_edge_insert_loc,
+ bsi_insert_on_edge_immediate): Return the newly created block.
+ (bsi_commit_edge_inserts_1): Add parameter to
+ tree_find_edge_insert_loc call.
+ * tree-flow.h (bsi_insert_on_edge_immediate): Declaration changed.
+ * tree-ssa-loop-ivopts.c (create_new_iv): Update loop for newly
+ created block.
+
+ * cfg.c (unlink_block): Clean prev_bb and next_bb fields.
+
+2004-01-29 Devang Patel <dpatel@apple.com>
+
+ * cfglayout.h (loopify): Add new bool parameter.
+ * cfgloopmanip.c (loopify): Support new bool argument.
+ * loop-unswitch.c (unswitch_loop): Supply additional argument 'true'
+ to loopify.
+ * tree-cfg.c (tree_block_label): Make externally visible.
+ * tree-flow.h (tree_block_label, test_loop_versioning, tree_ssa_loop_version): New
+ extern decls.
+ * tree-ssa-loop-manip.c (lv_adjust_loop_entry_edge, lv_udate_pending_stmts,
+ lv_adjust_loop_header_phi, tree_ssa_loop_version): New functions.
+ * tree-ssa-loop.c (tree_ssa_loop_opt): Test loop versioning.
+
+2004-01-29 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-scalar-evolution.c (scev_analyze_inner_loop_phi): Add ;.
+
+2004-01-29 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * Makefile.in (tree-ssa-dom.o): Depends on cfgloop.h.
+ * tree-flow-inline.h (loop_of_stmt): New function.
+ * tree-ssa-dom.c: Include cfgloop.h.
+ (tree_ssa_dominator_optimize): Detect and finalize the natural
+ loops structure.
+ (simplify_rhs_and_lookup_avail_expr): Verify that the folded
+ operations belong to the same loop.
+
+ * cfgloop.h (loop): Rewrite comments for the nb_iterations field.
+ * tree-data-ref.c (analyze_all_data_dependences): Increase the size
+ of the dependence graph when computing all the dependences.
+ * tree-optimize.c (init_tree_optimization_passes): Move the
+ pass_scev after the pass_pre.
+ * tree-scalar-evolution.h: Update comments.
+ * tree-scalar-evolution.c (symbolically_analyze,
+ scev_follow_ssa_edge_same_loop, scev_follow_ssa_edge_inner_loop,
+ loop_is_strictly_included_in, scev_analyze_inner_loop_phi,
+ draw_tree_cfg): New functions.
+ (compute_value_on_exit_of_loop): Removed.
+ (analyze_evolution): Mark phi nodes instead of looking into
+ the already_visited array.
+ (analyze_evolution_in_loop): Use scev_follow_ssa_edge_same_loop,
+ scev_follow_ssa_edge_inner_loop.
+ (scev_analyze_modify_expr): Refine the wrap-around case.
+ (scev_follow_ssa_edge): Handle edges to the current and inner loops
+ separately calling scev_follow_ssa_edge_same_loop or
+ scev_follow_ssa_edge_inner_loop.
+ (merge_branches_of_condition_phi_node): Restructure.
+ (set_nb_iterations_in_loop): Add one to the number of iterations.
+ When the loop copy headers is on, we always exit the loop after
+ having executed once its body.
+ (record_dependences_for_opnd): Do not record dependences on variables
+ that are not in the current loop.
+ (pass_scev_depend): Rename the pass from alldd to ddall.
+ * tree-ssa-loop.c (gate_ch): New function.
+ (pass_ch): Use gate_ch.
+ * doc/invoke.texi (-ftree-ch, -fdump-tree-ch): Document flags.
+ (fdump-tree-scev, fdump-tree-ddall): Update names, and comments.
+
+ * common.opt (ftree-ch): Document.
+ * flags.h (flag_tree_ch): Declare.
+ * opts.c (flag_tree_ch): Set it on by default.
+ (flag_scalar_evolutions, flag_all_data_deps): Turn off by default.
+ (OPT_ftree_ch): Handle this case.
+ * toplev.c (lang_independent_options): Register flag_tree_ch.
+
+2004-01-28 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfghooks.c (split_block): Update probabilities.
+
+ * cfgloopmanip.c (loopify): Always redirect branch edge to the new
+ loop.
+ * loop-iv.c (canon_condition, simplify_using_condition): Export.
+ (check_simple_exit): Do not allow cc mode registers.
+ * loop-unroll.c (unroll_loop_runtime_iterations): Use
+ compare_and_jump_seq.
+ * loop-unswitch.c (may_unswitch_on_p): Renamed to may_unswitch_on,
+ returns the condition, use iv_analyse.
+ (compare_and_jump_seq): New function.
+ (unswitch_loops): Call iv_analysis_done.
+ (unswitch_single_loop, unswitch_loop): Handle nontrivial invariants.
+ * rtl.h (compare_and_jump_seq, canon_condition,
+ simplify_using_condition): Declare.
+
+2004-01-28 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * loop-iv.c: New.
+ * loop-doloop.c: New.
+ * Makefile.in (loop-doloop.o, loop-iv.o): Add.
+ * alias.c (init_alias_analysis): Test flag_unroll_loops instead of
+ flag_old_unroll_loops.
+ * cfgloop.h (struct rtx_iv, struct niter_desc): New.
+ (get_loop_level, iv_analysis_loop_init, iv_get_reaching_def,
+ iv_analyse, find_simple_exit, iv_number_of_iterations,
+ iv_analysis_done, doloop_optimize_loops): Declare.
+ * cfgloopanal.c (get_loop_level): New.
+ * common.opt (floop-optimize2): New.
+ (fold-unroll-loops, fold-unroll-all-loops): Remove.
+ * doloop.c (doloop_condition_get): Export.
+ * flags.h (flag_old_unroll_loops, flag_old_unroll_all_loops):
+ Declaration removed.
+ * loop-unswitch.c (reversed_condition): Export.
+ * loop.c (loop_invariant_p): Use flag_unroll_loops instead
+ of flag_old_unroll_loops.
+ * opts.c (common_handle_option): Handle -floop-optimize2,
+ do not handle -fold-unroll-loops and -fold-unroll-all-loops.
+ * params.def (PARAM_MAX_DOLOOP_INSNS): New.
+ * rtl.h (get_mode_bounds, doloop_condition_get,
+ reversed_condition): Declare.
+ * stor-layout.c (get_mode_bounds): New function.
+ * toplev.c (flag_old_unroll_loops, flag_old_unroll_all_loops):
+ Remove.
+ (flag_loop_optimize2): New.
+ (rest_of_handle_loop_optimize): Use flag_unroll_loops instead
+ of flag_old_unroll_loops.
+ (rest_of_handle_loop2): Call doloop_optimize_loops.
+ (rest_of_compilation): Use flag_loop_optimize2.
+ (process_options): Remove flag_old_unroll_loops handling, add
+ flag_loop_optimize2 handling.
+ * toplev.h (flag_loop_optimize2): Declare.
+ * unroll.c (unroll_loop): Use flag_unroll_all_loops instead of
+ flag_old_unroll_all_loops.
+
+2004-01-26 Dorit Naishlos <dorit@il.ibm.com>
+
+ * Makefile.in: (tree-vectorizer.o): Remove dependency on real.h.
+ * tree-vectorizer.c: (real.h): Remove included file.
+ (vect_get_vec_def_for_operand): No need to explicitly use build_int_2
+ and build_real.
+
+ (vect_transform_loop_bound): Create loop IV update at loop exit
+ block, following changes in loop control.
+
+ (vectorize_loops): Remove debug printout.
+
+ * config/rs6000/altivec.md: (*movv4si_internal): More complex
+ condition.
+ (*movv8hi_internal1): Likewise.
+ (*movv16qi_internal1): Likewise.
+ (*movv4sf_internal1): Likewise.
+
+2004-01-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c (determine_set_costs): Do not use
+ GENERAL_REGNO_P.
+
+2004-01-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-ivopts.c: New file.
+ * Makefile.in (tree-ssa-loop-ivopts.o): Add.
+ * expr.c (expand_expr_1): Handle expand_expr_1.
+ * fold-const.c (invert_tree_comparison, invert_tree_comparison):
+ Export.
+ * tree-cfg.c (stmt_bsi): New function.
+ * tree-flow.h (stmt_bsi, tree_ssa_dce_no_cfg_changes,
+ tree_ssa_iv_optimize): Declare.
+ * tree-simple.c (get_base_symbol): Handle INDIRECT_REF.
+ * tree-ssa-dce.c (tree_ssa_dce_no_cfg_changes): Split from ...
+ (tree_ssa_dce): ... here.
+ * tree-ssa-loop.c (tree_ssa_loop_opt): Call tree_ssa_iv_optimize.
+ * tree-ssanames.c (make_ssa_name): Allow creating ssa name without
+ statement.
+ * tree.h (invert_tree_comparison, swap_tree_comparison): Declare.
+
+2004-01-25 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * doloop.c (doloop_optimize): Test for loop->top instead of
+ loop->scan_start.
+
+2004-01-22 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-alias-common.c (HAVE_BANSHEE): Do not define it.
+ (create_alias_vars): Do not test HAVE_BANSHEE value.
+
+2004-01-22 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-ssa-loop-manip.c: New file.
+ * Makefile.in (tree-ssa-loop-manip.o): Add.
+ * basic-block.h (struct reorder_block_def): New field copy_number.
+ * cfghooks.c (split_block, make_forwarder_block): Update irreducible
+ loop information.
+ * cfgloopmanip.c (duplicate_loop_to_header_edge): Set copy_number.
+ * tree-cfg.c (tree_duplicate_bb): Duplicate also virtual operands.
+ * tree-flow.h (enum tree_ann_type): Add MISC_ANN.
+ (struct misc_ann_d): New.
+ (union tree_ann_d): Add misc field.
+ (test_unrolling_and_peeling, tree_duplicate_loop_to_header_edge):
+ Declare.
+ * tree-ssa-loop.c (tree_ssa_loop_opt): Call
+ test_unrolling_and_peeling.
+ * tree-ssa-operands.c (copy_virtual_operands): New.
+ * tree-ssa-operands.h (copy_virtual_operands): Declare.
+
+ * dominance.c: Fix comment.
+
+ * cfgloopanal.c (mark_irreducible_loops): Rewriten.
+ (struct edge, struct vertex, struct graph): New.
+ (dump_graph, new_graph, add_edge, dfs, check_irred, for_each_edge,
+ free_graph): New functions.
+
+2004-01-21 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-scalar-evolution.c (pass_scev): Don't use a name.
+ (pass_scev_anal): Named this pass "scev".
+
+2004-01-21 Dorit Naishlos <dorit@il.ibm.com>
+
+ * Makefile.in: (tree-vectorizer.o): Add dependency on real.h.
+ * tree-vectorizer.c: (vect_is_simple_use): Allow constants.
+ (real.h): Included to support constants vectorization.
+ (vect_get_vec_def_for_operand): New function.
+ (vect_transform_binop): Use above new function.
+ (vect_transform_store): Likewise.
+ (vect_transform_load): Likewise.
+
+ (vect_get_new_vect_var): Allow more flexibility in naming scheme.
+ (vect_create_index_for_array_ref): Call vect_get_new_vect_var with a
+ name prefix instead of a variable.
+ (vect_create_data_ref): Likewise.
+ (vect_create_destination_var): Likewise.
+
+ (vect_analyze_data_refs): Temporarily restrict vectorizable data refs
+ to ARRYA_RES which base is a VAR_DECL.
+ (vect_create_data_ref): Support only VAR_DECL array base. Mark all
+ vops for renaming.
+
+ (vect_get_array_first_index): New function.
+ (vect_create_index_for_array_ref): Consider array_first_index.
+ (vect_analyze_data_ref_access): Likewise.
+
+ (vect_get_loop_niters): Use number_of_iterations_in_loop.
+ (vect_analyze_loop_form): Don't attempt to vectorize if
+ number_of_iterations == 0.
+
+ (vect_analyze_operations): Fix vectype analysis.
+
+ (vect_create_index_for_array_ref): Fix code insertion in loop prolog.
+ (vect_transform_loop_bound): Likewise.
+
+2004-01-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>,
+ Devang Patel <dpatel@apple.com>
+
+ * basic-block.h (struct reorder_block_def): Moved from cfglayout.h.
+ (alloc_rbi_pool, initialize_bb_rbi, free_rbi_pool): Declare.
+ * bb-reorder.c (copy_bb, copy_bb_p): Use duplicate_block hooks.
+ * loop-unswitch.c (unswitch_loop): Ditto.
+ * tracer.c (tail_duplicate): Ditto.
+ * tree-ssa-loop.c (copy_loop_headers): Ditto.
+ * cfg.c (rbi_pool): New.
+ (alloc_rbi_pool, free_rbi_pool, initialize_bb_rbi): New functions.
+ * cfghooks.c (can_duplicate_block_p, duplicate_block): New functions.
+ * cfghooks.h (struct cfg_hooks): Add can_duplicate_block_p and
+ duplicate_block hooks.
+ (can_duplicate_block_p, duplicate_block): Declare.
+ * cfglayout.c (cfg_layout_pool): Removed.
+ (cfg_layout_initialize_rbi): Removed.
+ (fixup_reorder_chain): Use initialize_bb_rbi.
+ (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb):
+ Ir-independent parts moved to cfghooks.c.
+ (cfg_layout_initialize): Use alloc_rbi_pool and initialize_bb_rbi.
+ (cfg_layout_finalize): Use free_rbi_pool.
+ (can_copy_bbs_p): Use can_duplicate_block_p.
+ (copy_bbs): Use duplicate_block.
+ * cfglayout.h (struct reorder_block_def): Moved to basic-block.h
+ (cfg_layout_can_duplicate_bb_p, cfg_layout_duplicate_bb,
+ cfg_layout_initialize_rbi): Declaration removed.
+ * cfgrtl.c (cfg_layout_create_basic_block): Use initialize_bb_rbi.
+ (cfg_layout_rtl_cfg_hooks): Add cfg_layout_can_duplicate_bb_p and
+ cfg_layout_duplicate_bb.
+ * tree-cfg.c (build_tree_cfg): Call alloc_rbi_pool.
+ (create_bb): Call initialize_bb_rbi.
+ (delete_tree_cfg): Call free_rbi_pool.
+ (tree_duplicate_bb): Ir independent parts moved to cfghooks.c.
+ (tree_cfg_hooks): Add tree_can_duplicate_bb_p and tree_duplicate_bb.
+ * tree-flow.h (tree_duplicate_bb): Declaration removed.
+
+2004-01-21 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * tree-alias-common.c (create_alias_vars): Don't use
+ andersen_alias_ops when we don't HAVE_BANSHEE.
+
+ * tree-ssa-loop.c (pass_ch): Remove TODO_verify_ssa.
+
+2004-01-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ Merge from tree-ssa branch (lno-merge-20040120).
+
+2004-01-18 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-scalar-evolution.c: (get_loop_exit_condition): Exposed to
+ external usage.
+ * tree-scalar-evolution.h: (get_loop_exit_condition): Exposed to
+ external usage.
+ * tree-vectorizer.c: (vect_is_simple_iv_evolution): Additional argument
+ to control how strict this function would be.
+ (vect_create_index_for_array_ref): Invoke vect_is_simple_iv_evolution
+ with "strict" set to true.
+ (vect_transform_loop_bound): More general loop bound transformation
+ scheme, independent of the loop exit condition form.
+ (vect_analyze_scalar_cycles): Invoke vect_is_simple_iv_evolution with
+ "strict" set to false.
+ (vect_get_loop_niters): Use monev utilities/precomputed info -
+ loop->nb_iterations and get_loop_exit_condition.
+
+2004-01-17 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c: (vect_get_name_for_new_var): Removed.
+ (vect_get_new_vect_var): New function. Replaces above function.
+ (vect_create_index_for_array_ref): Call vect_get_new_vect_var
+ instead of vect_get_name_for_new_var.
+ (vect_create_data_ref): Likewise.
+ (vect_create_destination_var): Likewise.
+ * tree-vectorizer.h: (vect_var_kind): New enum type.
+
+2004-01-15 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-chrec.c (remove_initial_condition,
+ add_expr_to_loop_evolution_1, add_expr_to_loop_evolution_2): New functions.
+ (add_expr_to_loop_evolution): Use these functions.
+ (build_polynomial_evolution_in_loop,
+ build_exponential_evolution_in_loop): Move from here...
+ * tree-chrec.h (build_polynomial_evolution_in_loop,
+ build_exponential_evolution_in_loop): Remove declarations.
+ * tree-scalar-evolution.c (build_polynomial_evolution_in_loop,
+ build_exponential_evolution_in_loop): ... to here. Declare
+ these functions static.
+ (select_outer_and_current_evolutions): New function.
+ (matched_an_increment, scev_analyze_modify_expr,
+ compute_overall_effect_of_inner_loop,
+ analyze_scalar_evolution): Use this function.
+ (add_to_evolution, multiply_evolution): Construct canonical
+ chains of recurrences.
+
+2004-01-14 Dorit Naishlos <dorit@il.ibm.com>
+ Sebastian Pop <s.pop@laposte.net>
+
+ * tree-vectorizer.c: (vect_is_simple_iv_evolution): Correctly use
+ APIs of the new monev analyzer. Additional argument (loop_num).
+ (vect_transform_loop_bound): Additional argument to
+ vect_is_simple_iv_evolution.
+ (vect_analyze_scalar_cycles): Likewise.
+ (vect_analyze_data_ref_access): Likewise.
+ (vect_get_loop_niters): Likewise.
+
+2004-01-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-optimize.c: (optimize_function_tree): Cleanup.
+
+ * tree-vectorizer.h: (DBG_VECT, DBG_VECT2): Removed.
+ (vec_array_base_name_differ_p): Removed.
+ (vec_analyze_array): Removed.
+ (struct _stmt_vec_info): New field: loop.
+ (STMT_VINFO_LOOP): New access function to above new field.
+ (new_stmt_vec_info): Additional argument.
+
+ * tree-vectorizer.c: (vect_is_simple_use): New function.
+ (vect_is_supportable_binop): Added call to vect_is_simple_use().
+ (vect_is_supportable_store): Added call to vect_is_simple_use().
+ (vect_is_supportable_load): Added call to vect_is_simple_use().
+
+ (vect_create_index_for_array_ref): Correct handling of accesses with
+ an offset (e.g, a[i+OFF]).
+ (vect_create_data_ref): Pass STMT as an argument to
+ vect_create_index_for_array_ref, instead of an operand.
+ (vect_transform_store): Handle accesses with an offset.
+ (vect_transform_load): Handle accesses with an offset.
+
+ (vect_create_data_ref): Set the mem_tag of the pointer used for the
+ vector data-access to reflect correct may-alias info.
+
+ (get_address_calculation_operands): Removed.
+ (exist_non_indexing_operands_for_use_p): New function, in place of
+ get_address_calculation_operands() to correctly handle induction (for
+ now this means to detect and not attempt to vectorize computations
+ like a[i]=i).
+ (vect_analyze_scalar_cycles): call above new function instead of
+ get_address_calculation_operands().
+ (vect_mark_stmts_to_be_vectorized): Likewise.
+
+ (get_vectype_for_scalar_type): Added test of VECTOR_MODE_SUPPORTED_P.
+
+ (new_stmt_vec_info): Takes also LOOP as an argument and initializes
+ new field STMT_VINFO_LOOP.
+ (new_loop_vec_info): Pass additional argument to new_stmt_vec_info.
+
+ (vect_stmt_relevant_p): Use flow_bb_inside_loop_p instead of comparing
+ loop->depth's.
+ (vect_analyze_operations): Likewise.
+
+ (vect_align_data_ref): Removed stderr debug printouts, some of which
+ replaced with code dumping dependending on TDF_DETAILS to dump_file.
+ (vect_create_index_for_array_ref): Likewise.
+ (vect_create_destination_var): Likewise.
+ (vect_create_data_ref): Likewise.
+ (vect_transform_binop): Likewise.
+ (vect_transform_store): Likewise.
+ (vect_transform_load): Likewise.
+ (vect_transform_stmt): Likewise.
+ (vect_transform_loop_bound): Likewise.
+ (vect_transform_loop): Likewise.
+ (vect_analyze_operations): Likewise.
+ (vect_is_simple_iv_evolution): Likewise.
+ (vect_analyze_scalar_cycles): Likewise.
+ (vect_analyze_data_ref_dependences): Likewise.
+ (vect_analyze_data_refs): Likewise.
+ (vect_mark_relevant): Likewise.
+ (vect_stmt_relevant_p): Likewise.
+ (vect_mark_stmts_to_be_vectorized): Likewise.
+ (vect_get_loop_niters): Likewise.
+ (vectorize_loops): Likewise.
+
+2004-01-13 Sebastian Pop <s.pop@laposte.net>
+ Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-fold-const.h (tree_fold_int_plus, tree_fold_int_minus,
+ tree_fold_int_multiply): Remove NON_LVALUE_EXPR from the
+ answers of the folder. Fixes bootstraps for powerpc.
+
+2004-01-12 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-chrec.c (chrec_fold_plus, chrec_fold_multiply): Verify
+ that there is no chrecs nested in the operands before calling
+ the folder.
+ (evolution_function_in_loop_num): When there is no evolution
+ in the loop, return the initial condition.
+ (evolution_part_in_loop_num): When there is no evolution
+ in the loop, return NULL_TREE.
+ (chrec_eval_next_init_cond): Adapt the function for the
+ multivariate case.
+ (tree_contains_chrecs): Avoid the use of double negation.
+ * tree-chrec.h (chrec_eval_next_init_cond): Add a parameter
+ for the dimension in which to evaluate the variation.
+ * tree-scalar-evolution.c (is_ssa_name_a_version_of_variable,
+ expression_contains_variable_p, remove_variable_from_expression,
+ analyze_non_gimple_initial_condition, matched_an_increment,
+ matched_an_exponentiation, matched_a_wrap_around,
+ matched_an_arithmetic_wrap_around,
+ evolution_of_phi_already_analyzed_p): New static functions.
+ (scev_analyze_modify_expr): Use these functions. Refine the
+ cases detected as wrap-around variables.
+ (analyze_initial_condition): Don't erase the evolution in the
+ previous dimensions when computing the initial condition for a
+ new loop.
+ (analyze_evolution_in_loop): Call the scev_analyze_modify_expr
+ on the tree node, not on its evolution.
+ (scev_follow_ssa_edge): In the case of an inner loop-phi-node,
+ when the outer edge is a phi-node follow up the edge.
+ (scev_follow_ssa_edge): Avoid the analysis of the inner loop
+ when it has already been analyzed.
+ (merge_evolutions): Refine the operation for zero, one, and
+ more branches of evolutions.
+
+2004-01-09 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-scalar-evolution.c: New version of the analyzer.
+ * tree-scalar-evolution.h: Same.
+ * tree-chrec.c: Same.
+ * tree-data-ref.c: Same.
+ * tree-chrec.h: Same.
+ * tree-data-ref.h: Same.
+ * tree-fold-const.h: Same.
+
+ * tree-vectorizer.c (vect_transform_loop_bound,
+ vect_analyze_scalar_cycles, vect_analyze_data_ref_access,
+ vect_analyze_data_refs, vect_get_loop_niters): Use the new
+ interface of the analyzer.
+ * tree-optimize.c (optimize_function_tree): Same.
+
+2004-01-08 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfgloop.h (loop_is_included_in): Declaration removed.
+ * tree-scalar-evolution.c (stmt_is_in_loop, stmt_is_not_in_loop,
+ loop_is_included_in): Use existing functions to implement
+ them.
+
+2004-01-06 Sebastian Pop <s.pop@laposte.net>
+
+ * cfgloop.h (loop_is_included_in, outer_loop, inner_loop,
+ next_loop, loop_num, loop_depth, loop_header,
+ loop_nb_iterations, loop_num_exits, loop_exit_edges,
+ loop_exit_edge): New inline functions.
+ (loop_is_included_in): Declare here.
+ * tree-flow-inline.h (loop_of_stmt): New inline function.
+ * tree-scalar-evolution.c (loop_is_included_in): Remove declaration.
+ (stmt_is_in_loop, stmt_is_not_in_loop): New functions.
+ (loop_is_included_in, loop_is_included_in_rec): Moved up in the same file.
+
+2004-01-06 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c: Fix typos.
+
+2004-01-05 Andreas Jaeger <aj@suse.de>
+
+ * tree-vectorizer.h: Follow coding standards, remove extra
+ whitespace.
+ * tree-vectorizer.c: Likewise.
+
+ * tree-vectorizer.c (vectorize_loops): Output statistics to
+ dump_file, fix printf string.
+ (vect_transform_loop): Replace DBG_VECT code with code dumping
+ dependend on TDF_DETAILS to dump_file.
+ (vect_is_supportable_binop): Likewise.
+ (vect_analyze_operations): Likewise.
+ (get_address_calculation_operands): Likewise.
+ (vect_analyze_scalar_cycles): Likewise.
+ (vect_analyze_data_ref_dependence): Likewise.
+ (vect_analyze_data_ref_access): Likewise.
+ (vect_analyze_data_ref_accesses): Likewise.
+ (vect_analyze_data_refs): Likewise.
+ (vect_mark_relevant): Likewise.
+ (vect_get_loop_niters): Likewise.
+ (vect_mark_stmts_to_be_vectorized): Likewise.
+ (vect_analyze_loop_form): Likewise.
+ (vectorize_loops): Likewise.
+
+ * tree-vectorizer.h (DBG_VEC): Remove.
+
+2004-01-04 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * doloop.c (doloop_optimize): Update number of iterations for the
+ loops entered at bottom.
+
+2004-01-04 Andreas Jaeger <aj@suse.de>
+
+ * common.opt: Re-order some options in ASCII collating orders.
+
+2004-01-03 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * cfghooks.h (struct cfg_hooks): New fields split_block_after_labels
+ and move_block_after, type of cfgh_make_forwarder_block field changed.
+ (HEADER_BLOCK, LATCH_EDGE): Moved to cfgloop.c.
+ (split_block_after_labels, move_block_after): New macros.
+ (make_forwarder_block): Changed.
+ * cfgloop.c (HEADER_BLOCK, LATCH_EDGE): Moved from cfghooks.h.
+ (update_latch_info, mfb_keep_just, mfb_keep_nonlatch,
+ fill_sons_in_loop): New functions.
+ (canonicalize_loop_headers): Changed due to changes in
+ make_forwarder_block.
+ * cfgloopmanip.c (split_loop_bb): Don't update dominators.
+ (create_preheader): Use make_forwarder_block.
+ (mfb_keep_just, mfb_update_loops): New.
+ * cfgrtl.c (rtl_split_block_after_labels): New.
+ (redirect_edge_with_latch_update): Removed.
+ (rtl_make_forwarder_block): New sematics.
+ (rtl_split_block): Update dominators.
+ (rtl_cfg_hooks, cfg_layout_rtl_cfg_hooks):
+ Add rtl_split_block_after_labels.
+ * tree-cfg.c (tree_make_forwarder_block): Changed semantics.
+ (create_blocks_annotations): Removed.
+ (build_tree_cfg): Don't call create_blocks_annotations.
+ (create_bb): Create annotations for a new block.
+ (tree_split_edge): Don't call create_block_annotation.
+ Update irreducible loop information.
+ (tree_loop_optimizer_finalize): Add loop structure check.
+ (tree_redirect_edge_and_branch_1): Return the original edge if
+ no redirecting is neccessary.
+ (tree_split_block): Make the semantics same as for rtl_split_block.
+ (tree_split_block_after_labels, tree_move_block_after): New.
+ (tree_cfg_hooks): Add tree_split_block_after_labels and
+ tree_move_block_after.
+
+ * cfgloopanal.c (mark_irreducible_loops): Fix.
+ * loop-unswitch.c (unswitch_loop): Fix.
+
+ * Makefile.in (tree-ssa-loop.o): Add cfgloop.h and tree-inline.h
+ dependency.
+ * jump.c (next_nonnote_insn_in_loop, duplicate_loop_exit_test,
+ copy_loop_headers): Removed.
+ * rtl.h (copy_loop_headers): Declaration removed.
+ * toplev.c (rest_of_compilation): Do not call loop header copying.
+ * tree-dump.c (dump_files): Add .ch dump.
+ * tree-flow.h (tree_duplicate_bb, copy_loop_headers): Declare.
+ * tree-optimize.c (optimize_function_tree): Add loop header copying
+ pass.
+ * tree-ssa-loop.c: Include cfgloop.h and tree-inline.h.
+ (dump_file, dump_flags): Renamed to loop_dump_file and
+ loop_dump_flags.
+ (call_expr_p, should_duplicate_loop_header_p, copy_loop_headers):
+ New.
+ * tree.h (enum tree_dump_index): Add ch dump.
+ * doc/invoke.texi (-fdump-tree-copy-headers): Document.
+ * testsuite/gcc.dg/tree-ssa/20030711-1.c: Update test outcome.
+ * testsuite/gcc.dg/tree-ssa/20030714-2.c: Ditto.
+ * testsuite/gcc.dg/tree-ssa/copy-headers.c: New test.
+ * tree-cfg.c (tree_duplicate_bb): New function.
+
+ * tree-ssa-loop-im.c: New file.
+ * Makefile.in (tree-ssa-loop-im.o): Add.
+ * params.def (PARAM_LIM_EXPENSIVE): New parameter.
+ * tree-dump.c (dump_files): Move .loop dump.
+ * cfgloop.h (superloop_at_depth, get_loop_body_in_dom_order): Declare.
+ (loop_dump_file, loop_dump_flags): Declare variables.
+ * cfgloop.c (superloop_at_depth, get_loop_body_in_dom_order): New
+ functions.
+ * tree-flow.h (struct stmt_ann_d): Add aux field.
+ (bsi_commit_edge_inserts): Declaration changed.
+ (tree_ssa_lim): Declare.
+ * tree-mudflap.c (mf_xform_derefs_1): Use in_array_bounds_p.
+ * tree-optimize.c (optimize_function_tree): Move loop optimization
+ pass.
+ * tree-sra.c (scalarize_structures): Modified due to
+ bsi_commit_edge_inserts change.
+ * tree-ssa-loop.c (tree_ssa_loop_opt): Call tree_ssa_lim.
+ * tree-ssa.c (rewrite_trees, rewrite_vars_out_of_ssa): Modified due to
+ bsi_commit_edge_inserts change.
+ * tree.c (in_array_bounds_p): New function.
+ * tree.h (in_array_bounds_p): Declare.
+ (enum tree_dump_index): Move loop dump.
+ * tree-cfg.c (bsi_commit_edge_inserts): Don't take update_annotations
+ argument.
+
+ * tree-ssa.c (rewrite_into_ssa, rewrite_out_of_ssa): Ensure that the
+ closed files are not used.
+
+ * tree-tailcall.c (find_tail_calls, eliminate_tail_call): Update
+ phi nodes for vdefs of the eliminated call.
+
+2004-01-03 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-optimize.c (optimize_function_tree): Move the closing brace of
+ DCE2 to the right place.
+
+2004-01-03 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-vectorizer.c (vect_analyze_operations): Test vectorization_factor
+ before computing modulo.
+
+2004-01-02 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-vectorizer.c (vect_is_supportable_binop): Returns false instead
+ of NULL.
+
+2004-01-02 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.h (UNITS_PER_SIMD_WORD): New.
+
+2004-01-02 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-data-ref.c (vec_analyze_array, vec_array_base_name_differ_p,
+ array_base_name_differ_p): Removed for fixing the previous patch.
+
+2004-01-02 Richard Henderson <rth@redhat.com>
+
+ * target.h (struct gcc_target): Remove vectype_for_scalar_type.
+ * target-def.h (TARGET_VECTYPE_FOR_SCALAR_TYPE): Remove.
+ * config/rs6000/rs6000.c (rs6000_vectype_for_scalar_type): Remove.
+ (TARGET_VECTYPE_FOR_SCALAR_TYPE): Remove.
+
+ * tree.c (build_vector_type_with_mode): Rename from make_vector,
+ remove unsignedp argument, update callers.
+ (build_vector_type): New.
+ * tree.h (build_vector_type): Declare it.
+ * tree-vectorizer.c (get_vectype_for_scalar_type): Use it.
+
+2004-01-02 Richard Henderson <rth@redhat.com>
+
+ * tree-scalar-evolution.c (finalize_scalar_evolutions_analyzer):
+ Clear dump_file.
+
+2004-01-02 Sebastian Pop <s.pop@laposte.net>
+
+ * tree-data-ref.c (vec_analyze_array): Renamed to analyze_array.
+ (analyze_array): Removed.
+ (find_data_references): Adapted to use the new analyze_array
+ function.
+ (array_base_name_differ_p): Moved to tree-data-ref.h.
+ (vec_array_base_name_differ_p): Removed.
+ * tree-data-ref.h (array_base_name_differ_p): Moved here.
+ * tree-vectorizer.c (vect_analyze_data_ref_dependence): Use
+ array_base_name_differ_p instead of vec_array_base_name_differ_p.
+ (vect_analyze_data_refs): Use analyze_array instead of
+ vec_analyze_array.
+ (vectorize_loops): Remove the initializers and finalizers of the
+ scalar evolution analyzer.
+
+2004-01-01 Dorit Naishlos <dorit@il.ibm.com>
+
+ * tree-vectorizer.c: New file. Implements loop vectorization
+ pass.
+ * tree-vectorizer.h: New file.
+ * Makefile.in: (tree-vectorizer.c,tree-vectorizer.h): New files.
+ * tree-dump.c: (dump_files): New dump file for the new
+ vectorization pass.
+ * tree.h: (TDI_vect): New dump index for the new vectorization
+ pass.
+ * timevar.def (TV_TREE_VECTORIZATION): Support new
+ vectorization pass.
+ * opts.c: (flag_tree_vetorize): New flag to enable/disable the
+ new vectorization pass.
+ * flags.h: Same.
+ * toplev.c: Same.
+ * common.opt: (ftree-vectorize): Same.
+ * doc/invoke.texi: Document above new options.
+ * tree-optimize.c: (optimize_function_tree): Invoke the new
+ vetorization pass.
+ * tree-flow.h: (struct stmt_ann_d): New field (aux) to allow
+ recording information per stmt.
+ * tree-data-ref.c (vec_analyze_array): New function, exposing
+ API to the vectorizer.
+ (vec_array_base_name_differ_p): New function, exposing API to
+ the vectorizer.
+ * tree-data-ref.h: Same.
+ * defaults.h: (UNITS_PER_SIMD_WORD): Define.
+ * config/rs6000/rs6000.h: (UNITS_PER_SIMD_WORD): Same.
+ * target-def.h (TARGET_VECTYPE_FOR_SCALAR_TYPE): Declare a new
+ target hook for vectorization.
+ * target.h (vectype_for_scalar_type): Same.
+ * config/rs6000/rs6000.c: (rs6000_vectype_for_scalar_type):
+ Implement the above new target hook.
+
+2003-12-31 Sebastian Pop <s.pop@laposte.net>
+
+ * version.c (version_string): Change the identifier for the
+ sub-branch.
+
+2003-12-31 Sebastian Pop <s.pop@laposte.net>
+ Daniel Berlin <dberlin@dberlin.org>
+
+ * tree-phinodes.c (create_phi_node): Initialise PHI_MARKED to 0.
+ * tree-scalar-evolution.c (already_visited,
+ node_already_visited_by_ssa_path): Removed.
+ (analyze_evolution): Remove initialisation of already_visited.
+ (construct_schedule): idem.
+ (monev_follow_ssa_edge): use PHI_MARKED for deciding whether
+ to analyze the phi-node.
+ (follow_ssa_edge_and_record_dependences_rec): idem.
+ * tree.h (PHI_MARKED): New macro.
+ (tree_phi_node): Add a field marked.
+
+2003-12-27 Sebastian Pop <s.pop@laposte.net>
+
+ * Makefile.in (OBJS-common): Added tree-chrec.o
+ tree-scalar-evolution.o, tree-data-ref.o, tree-fold-const.o.
+ (tree-optimize.o): Add dependencies on tree-fold-const.h
+ tree-chrec.h tree-scalar-evolution.h tree-data-ref.h
+ (tree-chrec.o, tree-scalar-evolution.o, tree-data-ref.o,
+ tree-fold-const.o): New rules.
+ * cfgloop.h (loop): New field nb_iterations.
+ (loop_from_num): New function.
+ * common.opt (fscalar-evolutions, fall-data-deps): Added.
+ * flags.h (flag_scalar_evolutions, flag_all_data_deps): Declared.
+ * opts.c (decode_options, common_handle_option): Initialize
+ flag_scalar_evolutions and flag_all_data_deps.
+ * timevar.def (TV_SCALAR_EVOLUTIONS, TV_ALL_DATA_DEPS): New.
+ * toplev.c (flag_scalar_evolutions, flag_all_data_deps): Defined.
+ (lang_independent_options): Add flag_scalar_evolutions and
+ flag_all_data_deps.
+ * tree-dump.c (scev, alldd): New extensions.
+ * tree.h (tree_dump_index): Added TDI_scev and TDI_alldd.
+ * tree-optimize.c (tree-fold-const.h, tree-chrec.h,
+ tree-scalar-evolution.h, tree-data-ref.h): Included.
+ (optimize_function_tree): Added the entry point for the analysis of
+ scalar evolutions and data dependences.
+ * tree-pretty-print.c (tree-fold-const.h, tree-chrec.h): Included.
+ (dump_generic_node): Added code for dumping POLYNOMIAL_CHREC,
+ EXPONENTIAL_CHREC, PERIODIC_CHREC, and INTERVAL_CHREC.
+ * tree.def (INTERVAL_CHREC, POLYNOMIAL_CHREC, EXPONENTIAL_CHREC,
+ PERIODIC_CHREC): New tree nodes.
+ * varray.h (index_in_varray_tree, tree_is_in_varray_tree_p,
+ index_in_varray_int, int_is_in_varray_int_p): New inlined functions.
+ * tree-chrec.c, tree-chrec.h, tree-data-ref.c, tree-data-ref.h,
+ tree-fold-const.c, tree-fold-const.h, tree-scalar-evolution.c,
+ tree-scalar-evolution.h: New files.
+ * doc/invoke.texi (-fdump-scalar-evolutions, -fdump-all-data-deps):
+ Documented.
+ * testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-[01..50].c : New testcases.
+ * testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-[01..50].c.scev: Expected
+ outputs for the scalar evolution analyzer.
+ * testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-{10, 30, 31, 32, 33, 34,
+ 35, 36}.c.alldd: Expected outputs for the data dependence analyzer.
+ * testsuite/gcc.dg/tree-ssa-chrec/tree-ssa-scev.exp: New file.
+ * testsuite/lib/scantree.exp (diff-tree-dumps): New procedure.
+ * ChangeLog.lno: New file.
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 44a954a21f3..f7fbb5963eb 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -301,14 +301,17 @@ INSTALL_HEADERS_DIR = @build_install_headers_dir@
# Header files that are made available under the same name
# to programs compiled with GCC.
+# APPLE LOCAL begin radar 2872232 add tgmath.h
USER_H = $(srcdir)/ginclude/float.h \
$(srcdir)/ginclude/iso646.h \
$(srcdir)/ginclude/stdarg.h \
$(srcdir)/ginclude/stdbool.h \
$(srcdir)/ginclude/stddef.h \
+ $(srcdir)/ginclude/tgmath.h \
$(srcdir)/ginclude/varargs.h \
$(srcdir)/unwind.h \
$(EXTRA_HEADERS)
+# APPLE LOCAL end radar 2872232 add tgmath.h
# The GCC to use for compiling libgcc.a and crt*.o.
# Usually the one we just built.
@@ -518,11 +521,14 @@ INSTALL_LIBGCC = install-libgcc
# Options to use when compiling libgcc2.a.
#
LIBGCC2_DEBUG_CFLAGS = -g
-LIBGCC2_CFLAGS = -O2 $(LIBGCC2_INCLUDES) $(GCC_CFLAGS) $(TARGET_LIBGCC2_CFLAGS) $(LIBGCC2_DEBUG_CFLAGS) $(GTHREAD_FLAGS) -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED @inhibit_libc@
+# APPLE LOCAL control opt level. --ilr
+LIBGCC2_CFLAGS = $(LIBGCC2_OPT) $(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 -isystem include
LIBGCC2_INCLUDES =
+# APPLE LOCAL control opt level. --ilr
+LIBGCC2_OPT = -O2
# Additional target-dependent options for compiling libgcc2.a.
TARGET_LIBGCC2_CFLAGS =
@@ -635,6 +641,24 @@ UNPROTOIZE_INSTALL_NAME := $(shell echo unprotoize|sed '$(program_transform_name
GCOV_INSTALL_NAME := $(shell echo gcov|sed '$(program_transform_name)')
GCCBUG_INSTALL_NAME := $(shell echo gccbug|sed '$(program_transform_name)')
+# APPLE LOCAL begin order files --ilr
+# When configure --enable-build_gcc is specified then we know that the
+# makefile was created as a result of using build_gcc. For such builds
+# we want to use the order files in the order-files directory. The
+# makefile will test ORDER_FILES. If it is not null then the appropriate
+# order file is added to the cc1* link.
+#ORDER_FILES = @enable_build_gcc@
+### ORDER FILES ARE CURRENTLY DISABLED. TO ENABLE THEM REMOVE THE LINE ###
+### BELOW AND UNCOMMENT THE LINE ABOVE. ###
+ORDER_FILES =
+ifeq ($(ORDER_FILES),yes)
+CC1_ORDER_FLAGS = `if [ -f $(srcdir)/../order-files/cc1.order ]; then \
+ echo -sectorder __TEXT __text $(srcdir)/../order-files/cc1.order -e start ; fi`
+else
+CC1_ORDER_FLAGS =
+endif
+# APPLE LOCAL end order files --ilr
+
# Setup the testing framework, if you have one
EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
echo $${rootme}/../expect/expect ; \
@@ -891,6 +915,7 @@ C_AND_OBJC_OBJS = attribs.o c-errors.o c-lex.o c-pragma.o c-decl.o c-typeck.o \
C_OBJS = c-parse.o c-lang.o stub-objc.o $(C_AND_OBJC_OBJS)
# Language-independent object files.
+# APPLE LOCAL begin lno, loops-to-memset
OBJS-common = \
tree-chrec.o tree-scalar-evolution.o tree-data-ref.o \
tree-cfg.o tree-dfa.o tree-eh.o tree-ssa.o tree-optimize.o tree-gimple.o \
@@ -908,6 +933,7 @@ OBJS-common = \
cfg.o cfganal.o cfgbuild.o cfgcleanup.o cfglayout.o cfgloop.o \
cfgloopanal.o cfgloopmanip.o loop-init.o loop-unswitch.o loop-unroll.o \
cfgrtl.o combine.o conflict.o convert.o coverage.o cse.o cselib.o \
+ tree-ssa-loop-prefetch.o tree-ssa-loop-memset.o \
dbxout.o ddg.o tree-ssa-loop-ch.o loop-invariant.o tree-ssa-loop-im.o \
debug.o df.o diagnostic.o dojump.o dominance.o loop-doloop.o \
dwarf2asm.o dwarf2out.o emit-rtl.o except.o explow.o loop-iv.o \
@@ -929,6 +955,7 @@ OBJS-common = \
et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o passes.o \
rtl-profile.o tree-profile.o rtlhooks.o cfgexpand.o lambda-mat.o \
lambda-trans.o lambda-code.o tree-loop-linear.o
+# APPLE LOCAL end lno, loops-to-memset
OBJS-md = $(out_object_file)
OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) tree-inline.o \
@@ -1182,9 +1209,11 @@ $(SPECS): xgcc$(exeext)
gcc-cross: xgcc$(exeext)
cp xgcc$(exeext) gcc-cross$(exeext)
+# APPLE LOCAL begin order files --ilr
cc1$(exeext): $(C_OBJS) $(BACKEND) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cc1$(exeext) \
- $(C_OBJS) $(BACKEND) $(LIBS)
+ $(C_OBJS) $(BACKEND) $(LIBS) $(CC1_ORDER_FLAGS)
+# APPLE LOCAL end order files --ilr
# Build the version of limits.h that we will install.
xlimits.h: glimits.h limitx.h limity.h
@@ -1222,7 +1251,8 @@ libgcc.mk: config.status Makefile mklibgcc $(LIB2ADD) $(LIB2ADD_ST) xgcc$(exeext
DPBIT_FUNCS='$(DPBIT_FUNCS)' \
TPBIT='$(TPBIT)' \
TPBIT_FUNCS='$(TPBIT_FUNCS)' \
- MULTILIBS=`$(GCC_FOR_TARGET) --print-multi-lib` \
+ APPLE_LOCAL='APPLE LOCAL libcc_kext' \
+ MULTILIBS="`$(GCC_FOR_TARGET) --print-multi-lib` static;@static@fno-pic kext;@Dmalloc=kern_os_malloc@Dfree=kern_os_free@DLIBCC_KEXT@static@fno-pic@fno-exceptions@fno-non-call-exceptions$(KEXT_EXTRA_FLAGS)" \
EXTRA_MULTILIB_PARTS='$(EXTRA_MULTILIB_PARTS)' \
SHLIB_LINK='$(SHLIB_LINK)' \
SHLIB_INSTALL='$(SHLIB_INSTALL)' \
@@ -1386,6 +1416,8 @@ c-lex.o : c-lex.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) debug.h $(C_TREE_H) $(C_COMMON_H) real.h c-incpath.h cppdefault.h \
$(C_PRAGMA_H) input.h intl.h $(FLAGS_H) toplev.h output.h \
$(CPPLIB_H) $(EXPR_H) $(TM_P_H)
+# APPLE LOCAL AltiVec
+c-lex.o: $(TARGET_H) ../libcpp/internal.h
c-ppoutput.o : c-ppoutput.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(C_COMMON_H) $(TREE_H) $(CPPLIB_H) $(srcdir)/../libcpp/internal.h $(TM_P_H) $(C_PRAGMA_H)
c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
@@ -1430,6 +1462,8 @@ c-common.o : c-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(TARGET_H) $(C_TREE_H) tree-iterator.h langhooks.h tree-mudflap.h \
intl.h opts.h real.h $(CPPLIB_H) tree-inline.h $(HASHTAB_H) \
builtins.def
+# APPLE LOCAL 64bit shorten warning 3865314
+c-common.o : options.h
c-pretty-print.o : c-pretty-print.c $(C_PRETTY_PRINT_H) \
$(C_COMMON_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) real.h \
@@ -1445,6 +1479,8 @@ c-opts.o : c-opts.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
c-cppbuiltin.o : c-cppbuiltin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TREE_H) version.h $(C_COMMON_H) $(C_PRAGMA_H) $(FLAGS_H) toplev.h \
langhooks.h output.h except.h real.h $(TARGET_H) $(TM_P_H)
+# APPLE LOCAL pascal strings
+c-cppbuiltin.o : ../libcpp/include/cpplib.h ../libcpp/internal.h
# A file used by all variants of C and some other languages.
@@ -1576,9 +1612,10 @@ prefix.o: prefix.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) Makefile prefix.h
-DPREFIX=\"$(prefix)\" \
-c $(srcdir)/prefix.c $(OUTPUT_OPTION)
+# APPLE LOCAL begin AltiVec
convert.o: convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(FLAGS_H) \
- convert.h toplev.h langhooks.h
-
+ convert.h toplev.h langhooks.h c-tree.h c-common.h
+# APPLE LOCAL end AltiVec
langhooks.o : langhooks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) toplev.h \
tree-inline.h $(RTL_H) insn-config.h $(INTEGRATE_H) langhooks.h \
$(LANGHOOKS_DEF_H) $(FLAGS_H) $(GGC_H) diagnostic.h intl.h
@@ -1636,11 +1673,14 @@ tree-ssa-propagate.o : tree-ssa-propagate.c $(TREE_FLOW_H) $(CONFIG_H) \
diagnostic.h errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h \
$(TREE_DUMP_H) $(BASIC_BLOCK_H) tree-pass.h langhooks.h \
tree-ssa-propagate.h vec.h gt-tree-ssa-propagate.h
+# APPLE LOCAL begin lno
tree-ssa-dom.o : tree-ssa-dom.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h diagnostic.h \
errors.h function.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
$(BASIC_BLOCK_H) domwalk.h real.h tree-pass.h $(FLAGS_H) langhooks.h \
- tree-ssa-propagate.h
+ tree-ssa-propagate.h \
+ cfgloop.h
+# APPLE LOCAL end lno
tree-ssa-threadupdate.o : tree-ssa-threadupdate.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(EXPR_H) $(GGC_H) output.h \
diagnostic.h errors.h function.h $(TM_H) coretypes.h $(TREE_DUMP_H) \
@@ -1696,14 +1736,20 @@ tree-ssa-operands.o : tree-ssa-operands.c $(TREE_FLOW_H) $(CONFIG_H) \
tree-eh.o : tree-eh.c $(TREE_FLOW_H) $(CONFIG_H) $(SYSTEM_H) \
$(RTL_H) $(TREE_H) $(TM_H) $(FLAGS_H) function.h except.h langhooks.h \
$(GGC_H) tree-pass.h gt-tree-eh.h
+# APPLE LOCAL begin lno
tree-ssa-loop.o : tree-ssa-loop.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
- tree-pass.h $(FLAGS_H) tree-inline.h $(SCEV_H)
+ tree-pass.h $(FLAGS_H) tree-inline.h $(SCEV_H) function.h
tree-ssa-loop-unswitch.o : tree-ssa-loop-unswitch.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) domwalk.h $(PARAMS_H)\
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
tree-pass.h
+tree-ssa-loop-prefetch.o : tree-ssa-loop-prefetch.c $(TREE_FLOW_H) $(CONFIG_H) \
+ $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) varray.h $(EXPR_H) \
+ output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
+ tree-pass.h $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H)
+# APPLE LOCAL end lno
tree-ssa-loop-niter.o : tree-ssa-loop-niter.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) cfgloop.h $(PARAMS_H) tree-inline.h \
output.h diagnostic.h $(TM_H) coretypes.h $(TREE_DUMP_H) $(FLAGS_H) \
@@ -1712,6 +1758,12 @@ tree-ssa-loop-ivcanon.o : tree-ssa-loop-ivcanon.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) $(PARAMS_H) tree-inline.h \
output.h diagnostic.h $(TM_H) coretypes.h $(TREE_DUMP_H) $(FLAGS_H) \
tree-pass.h $(SCEV_H)
+# APPLE LOCAL begin loops-to-memset
+tree-ssa-loop-memset.o : tree-ssa-loop-memset.c $(TREE_FLOW_H) $(CONFIG_H) \
+ $(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) cfgloop.h $(PARAMS_H) tree-inline.h \
+ output.h diagnostic.h $(TM_H) coretypes.h $(TREE_DUMP_H) flags.h \
+ tree-pass.h $(SCEV_H)
+# APPLE LOCAL end loops-to-memset
tree-ssa-loop-ch.o : tree-ssa-loop-ch.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) tree-inline.h \
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
@@ -1721,10 +1773,12 @@ tree-ssa-loop-ivopts.o : tree-ssa-loop-ivopts.c $(TREE_FLOW_H) $(CONFIG_H) \
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
tree-pass.h $(GGC_H) $(RECOG_H) insn-config.h $(HASHTAB_H) $(SCEV_H) \
cfgloop.h $(PARAMS_H) sbitmap.h
+# APPLE LOCAL begin lno added tree-inline.h $(FLAGS_H)
tree-ssa-loop-manip.o : tree-ssa-loop-manip.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) \
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
- tree-pass.h cfglayout.h $(SCEV_H)
+ tree-pass.h cfglayout.h $(SCEV_H) tree-inline.h $(FLAGS_H)
+# APPLE LOCAL end lno added tree-inline.h $(FLAGS_H)
tree-ssa-loop-im.o : tree-ssa-loop-im.c $(TREE_FLOW_H) $(CONFIG_H) \
$(SYSTEM_H) $(RTL_H) $(TREE_H) $(TM_P_H) $(CFGLOOP_H) domwalk.h $(PARAMS_H)\
output.h diagnostic.h $(TIMEVAR_H) $(TM_H) coretypes.h $(TREE_DUMP_H) \
@@ -2956,11 +3010,13 @@ srcinfo: $(INFOFILES)
TEXI_CPP_FILES = cpp.texi fdl.texi cppenv.texi cppopts.texi
+# APPLE LOCAL begin GPL compliance
TEXI_GCC_FILES = gcc.texi gcc-common.texi frontends.texi standards.texi \
invoke.texi extend.texi md.texi objc.texi gcov.texi trouble.texi \
bugreport.texi service.texi contribute.texi compat.texi funding.texi \
gnu.texi gpl.texi fdl.texi contrib.texi cppenv.texi cppopts.texi \
- implement-c.texi
+ implement-c.texi sourcecode.texi
+# APPLE LOCAL end GPL compliance
TEXI_GCCINT_FILES = gccint.texi gcc-common.texi contribute.texi makefile.texi \
configterms.texi portability.texi interface.texi passes.texi \
diff --git a/gcc/alias.c b/gcc/alias.c
index a0f77d559a1..dbda2aec741 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -97,7 +97,8 @@ typedef struct alias_set_entry *alias_set_entry;
static int rtx_equal_for_memref_p (rtx, rtx);
static rtx find_symbolic_term (rtx);
-static int memrefs_conflict_p (int, rtx, int, rtx, HOST_WIDE_INT);
+/* APPLE LOCAL nop on true-dependence. */
+static int memrefs_conflict_p (int, rtx, int, rtx, HOST_WIDE_INT, int);
static void record_set (rtx, rtx, void *);
static int base_alias_check (rtx, rtx, enum machine_mode,
enum machine_mode);
@@ -113,6 +114,8 @@ static bool nonoverlapping_component_refs_p (tree, tree);
static tree decl_for_component_ref (tree);
static rtx adjust_offset_for_component_ref (tree, rtx);
static int nonoverlapping_memrefs_p (rtx, rtx);
+/* APPLE LOCAL aliasing improvement */
+static int overlapping_memrefs_p (rtx, rtx);
static int write_dependence_p (rtx, rtx, int);
static int nonlocal_mentioned_p_1 (rtx *, void *);
@@ -1612,6 +1615,8 @@ addr_side_effect_eval (rtx addr, int size, int n_refs)
return addr;
}
+/* APPLE LOCAL begin nop on true-dependence. */
+
/* Return nonzero if X and Y (memory addresses) could reference the
same location in memory. C is an offset accumulator. When
C is nonzero, we are testing aliases between X and Y + C.
@@ -1627,11 +1632,19 @@ addr_side_effect_eval (rtx addr, int size, int n_refs)
being referenced as a side effect. This can happen when using AND to
align memory references, as is done on the Alpha.
+ Caller can decide what value to return by passing memrefs_may_conflist as
+ 0 or 1. If 1, caller wants memrefs_conflict_p to assume conflict if
+ aliasing info is insufficient to decide on memory conflict. If 0,
+ caller wants memrefs_conflict_p to assume no conflict for insufficient
+ aliasing info.
+
Nice to notice that varying addresses cannot conflict with fp if no
local variables had their addresses taken, but that's too hard now. */
+
static int
-memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
+memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c,
+ int memrefs_may_conflist)
{
if (GET_CODE (x) == VALUE)
x = get_addr (x);
@@ -1679,25 +1692,31 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
rtx y1 = XEXP (y, 1);
if (rtx_equal_for_memref_p (x1, y1))
- return memrefs_conflict_p (xsize, x0, ysize, y0, c);
+ return memrefs_conflict_p (xsize, x0, ysize, y0, c,
+ memrefs_may_conflist);
if (rtx_equal_for_memref_p (x0, y0))
- return memrefs_conflict_p (xsize, x1, ysize, y1, c);
+ return memrefs_conflict_p (xsize, x1, ysize, y1, c,
+ memrefs_may_conflist);
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));
+ c - INTVAL (x1) + INTVAL (y1),
+ memrefs_may_conflist);
else
return memrefs_conflict_p (xsize, x0, ysize, y,
- c - INTVAL (x1));
+ c - INTVAL (x1),
+ memrefs_may_conflist);
}
else if (GET_CODE (y1) == CONST_INT)
- return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1));
+ return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1),
+ memrefs_may_conflist);
- return 1;
+ return memrefs_may_conflist;
}
else if (GET_CODE (x1) == CONST_INT)
- return memrefs_conflict_p (xsize, x0, ysize, y, c - INTVAL (x1));
+ return memrefs_conflict_p (xsize, x0, ysize, y, c - INTVAL (x1),
+ memrefs_may_conflist);
}
else if (GET_CODE (y) == PLUS)
{
@@ -1707,9 +1726,10 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
rtx y1 = XEXP (y, 1);
if (GET_CODE (y1) == CONST_INT)
- return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1));
+ return memrefs_conflict_p (xsize, x, ysize, y0, c + INTVAL (y1),
+ memrefs_may_conflist);
else
- return 1;
+ return memrefs_may_conflist;
}
if (GET_CODE (x) == GET_CODE (y))
@@ -1724,7 +1744,7 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
rtx x1 = canon_rtx (XEXP (x, 1));
rtx y1 = canon_rtx (XEXP (y, 1));
if (! rtx_equal_for_memref_p (x1, y1))
- return 1;
+ return memrefs_may_conflist;
x0 = canon_rtx (XEXP (x, 0));
y0 = canon_rtx (XEXP (y, 0));
if (rtx_equal_for_memref_p (x0, y0))
@@ -1733,11 +1753,12 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
/* Can't properly adjust our sizes. */
if (GET_CODE (x1) != CONST_INT)
- return 1;
+ return memrefs_may_conflist;
xsize /= INTVAL (x1);
ysize /= INTVAL (x1);
c /= INTVAL (x1);
- return memrefs_conflict_p (xsize, x0, ysize, y0, c);
+ return memrefs_conflict_p (xsize, x0, ysize, y0, c,
+ memrefs_may_conflist);
}
case REG:
@@ -1754,7 +1775,8 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
break;
if (! memrefs_conflict_p (xsize, i_x ? i_x : x,
- ysize, i_y ? i_y : y, c))
+ ysize, i_y ? i_y : y, c,
+ memrefs_may_conflist))
return 0;
}
break;
@@ -1771,7 +1793,8 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
{
if (GET_CODE (y) == AND || ysize < -INTVAL (XEXP (x, 1)))
xsize = -1;
- return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)), ysize, y, c);
+ return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)), ysize, y, c,
+ memrefs_may_conflist);
}
if (GET_CODE (y) == AND && GET_CODE (XEXP (y, 1)) == CONST_INT)
{
@@ -1781,7 +1804,8 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
a following reference, so we do nothing with that for now. */
if (GET_CODE (x) == AND || xsize < -INTVAL (XEXP (y, 1)))
ysize = -1;
- return memrefs_conflict_p (xsize, x, ysize, canon_rtx (XEXP (y, 0)), c);
+ return memrefs_conflict_p (xsize, x, ysize, canon_rtx (XEXP (y, 0)), c,
+ memrefs_may_conflist);
}
if (CONSTANT_P (x))
@@ -1797,24 +1821,28 @@ memrefs_conflict_p (int xsize, rtx x, int ysize, rtx y, HOST_WIDE_INT c)
{
if (GET_CODE (y) == CONST)
return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)),
- ysize, canon_rtx (XEXP (y, 0)), c);
+ ysize, canon_rtx (XEXP (y, 0)), c,
+ memrefs_may_conflist);
else
return memrefs_conflict_p (xsize, canon_rtx (XEXP (x, 0)),
- ysize, y, c);
+ ysize, y, c,
+ memrefs_may_conflist);
}
if (GET_CODE (y) == CONST)
return memrefs_conflict_p (xsize, x, ysize,
- canon_rtx (XEXP (y, 0)), c);
+ canon_rtx (XEXP (y, 0)), c,
+ memrefs_may_conflist);
if (CONSTANT_P (y))
return (xsize <= 0 || ysize <= 0
|| (rtx_equal_for_memref_p (x, y)
&& ((c >= 0 && xsize > c) || (c < 0 && ysize+c > 0))));
- return 1;
+ return memrefs_may_conflist;
}
- return 1;
+ return memrefs_may_conflist;
}
+/* APPLE LOCAL end nop on true-dependence. */
/* Functions to compute memory dependencies.
@@ -2117,6 +2145,119 @@ nonoverlapping_memrefs_p (rtx x, rtx y)
return sizex >= 0 && offsety >= offsetx + sizex;
}
+/* APPLE LOCAL begin aliasing improvement */
+/* Helper for the following. Return 1 only if we're sure of overlap. */
+
+static int
+overlapping_trees_p (tree exprx, tree expry)
+{
+ /* If no info about either one, can't tell. */
+ if (exprx == 0 || expry == 0)
+ return 0;
+
+ /* Top level code must match. */
+ if (TREE_CODE (exprx) != TREE_CODE (expry))
+ return 0;
+
+ /* Components. */
+ if (TREE_CODE (exprx) == COMPONENT_REF)
+ {
+ /* They must refer to the same field... */
+ if (TREE_OPERAND (exprx, 1) != TREE_OPERAND (expry, 1))
+ return 0;
+ /* ...of the same object. (The object may be null, which
+ will compare as not overlapping.) */
+ return overlapping_trees_p (TREE_OPERAND (exprx, 0),
+ TREE_OPERAND (expry, 0));
+ }
+
+ /* Pointers. */
+ if (TREE_CODE (exprx) == INDIRECT_REF)
+ return overlapping_trees_p (TREE_OPERAND (exprx, 0),
+ TREE_OPERAND (expry, 0));
+
+ if (TREE_CODE (exprx) == VAR_DECL
+ || TREE_CODE (exprx) == PARM_DECL
+ || TREE_CODE (exprx) == CONST_DECL
+ || TREE_CODE (exprx) == FUNCTION_DECL)
+ return exprx == expry;
+
+ return 0;
+}
+
+/* Return 1 if memrefs definitely overlap, 0 otherwise. */
+
+
+static int
+overlapping_memrefs_p (rtx x, rtx y)
+{
+ tree exprx = MEM_EXPR (x), expry = MEM_EXPR (y);
+ rtx offsetx = MEM_OFFSET (x), offsety = MEM_OFFSET (y);
+
+ /* See if offsets collide. Known but different offsets do not
+ overlap. Unknown offsets will if the underlying object is the same. */
+ if (offsetx != 0 && offsety != 0 && !rtx_equal_p (offsetx, offsety))
+ return 0;
+
+ return overlapping_trees_p (exprx, expry);
+}
+/* APPLE LOCAL end aliasing improvement */
+
+
+/* APPLE LOCAL begin nop on true-dependence. */
+/*
+ True dependence: X is read after store in MEM takes place.
+ This is similar to true_dependence. Except that function returns 1
+ only if it can determine the conflict. If it cannot or if there
+ is no conflict, it returns 0.
+*/
+
+int
+must_true_dependence (rtx mem, rtx x)
+{
+ rtx x_addr, mem_addr;
+ enum machine_mode mem_mode;
+
+ if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem))
+ return 1;
+
+ /* (mem:BLK (scratch)) is a special mechanism to conflict with everything.
+ This is used in epilogue deallocation functions. */
+ if (GET_MODE (x) == BLKmode && GET_CODE (XEXP (x, 0)) == SCRATCH)
+ return 1;
+ if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH)
+ return 1;
+
+ mem_mode = GET_MODE (mem);
+ x_addr = get_addr (XEXP (x, 0));
+ mem_addr = get_addr (XEXP (mem, 0));
+
+ /* APPLE LOCAL begin aliasing improvement */
+ if (overlapping_memrefs_p (mem, x))
+ return 1;
+ /* APPLE LOCAL end */
+
+ if (aliases_everything_p (x))
+ return 1;
+
+ x_addr = canon_rtx (x_addr);
+ mem_addr = canon_rtx (mem_addr);
+
+ /* We cannot use aliases_everything_p to test MEM, since we must look
+ at MEM_MODE, rather than GET_MODE (MEM). */
+ if (mem_mode == QImode || GET_CODE (mem_addr) == AND)
+ return 1;
+
+ /* In true_dependence we also allow BLKmode to alias anything. Why
+ don't we do this in anti_dependence and output_dependence? */
+ if (mem_mode == BLKmode || GET_MODE (x) == BLKmode)
+ return 1;
+
+ return memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr,
+ SIZE_FOR_MODE (x), x_addr, 0, 0);
+}
+/* APPLE LOCAL end nop on true-dependence. */
+
/* True dependence: X is read after store in MEM takes place. */
int
@@ -2160,6 +2301,11 @@ true_dependence (rtx mem, enum machine_mode mem_mode, rtx x,
&& CONSTANT_POOL_ADDRESS_P (base))))
return 0;
+ /* APPLE LOCAL begin aliasing improvement */
+ if (overlapping_memrefs_p (mem, x))
+ return 1;
+ /* APPLE LOCAL end */
+
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
return 0;
@@ -2167,7 +2313,8 @@ true_dependence (rtx mem, enum machine_mode mem_mode, rtx x,
mem_addr = canon_rtx (mem_addr);
if (! memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr,
- SIZE_FOR_MODE (x), x_addr, 0))
+ /* APPLE LOCAL nop on true-dependence. */
+ SIZE_FOR_MODE (x), x_addr, 0, 1))
return 0;
if (aliases_everything_p (x))
@@ -2223,12 +2370,18 @@ canon_true_dependence (rtx mem, enum machine_mode mem_mode, rtx mem_addr,
x_addr = get_addr (XEXP (x, 0));
+ /* APPLE LOCAL begin aliasing improvement */
+ if (overlapping_memrefs_p (mem, x))
+ return 1;
+ /* APPLE LOCAL end */
+
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x), mem_mode))
return 0;
x_addr = canon_rtx (x_addr);
if (! memrefs_conflict_p (GET_MODE_SIZE (mem_mode), mem_addr,
- SIZE_FOR_MODE (x), x_addr, 0))
+ /* APPLE LOCAL nop on true-dependence. */
+ SIZE_FOR_MODE (x), x_addr, 0, 1))
return 0;
if (aliases_everything_p (x))
@@ -2268,6 +2421,19 @@ write_dependence_p (rtx mem, rtx x, int writep)
if (GET_MODE (mem) == BLKmode && GET_CODE (XEXP (mem, 0)) == SCRATCH)
return 1;
+ /* APPLE LOCAL begin make SPEC gcc work with strict aliasing */
+ x_addr = get_addr (XEXP (x, 0));
+ mem_addr = get_addr (XEXP (mem, 0));
+
+ /* If two addresses are "the same" they conflict, even if type
+ checking says they don't. This is a bit too conservative
+ since there's no guarantee identical registers will have the
+ same values in both addresses. This is required to build
+ the (nonstandard) version of gcc found in SPEC. */
+ if (rtx_equal_p (x_addr, mem_addr))
+ return 1;
+ /* APPLE LOCAL end make SPEC gcc work with strict aliasing */
+
if (DIFFERENT_ALIAS_SETS_P (x, mem))
return 0;
@@ -2290,6 +2456,11 @@ write_dependence_p (rtx mem, rtx x, int writep)
return 0;
}
+ /* APPLE LOCAL begin aliasing improvement */
+ if (overlapping_memrefs_p (mem, x))
+ return 1;
+ /* APPLE LOCAL end */
+
if (! base_alias_check (x_addr, mem_addr, GET_MODE (x),
GET_MODE (mem)))
return 0;
@@ -2298,7 +2469,8 @@ write_dependence_p (rtx mem, rtx x, int writep)
mem_addr = canon_rtx (mem_addr);
if (!memrefs_conflict_p (SIZE_FOR_MODE (mem), mem_addr,
- SIZE_FOR_MODE (x), x_addr, 0))
+ /* APPLE LOCAL nop on true-dependence. */
+ SIZE_FOR_MODE (x), x_addr, 0, 1))
return 0;
fixed_scalar
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index 24e987f420a..c0499581206 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -556,4 +556,9 @@ bmp_iter_and_compl (bitmap_iterator *bi, unsigned *bit_no)
bmp_iter_and_compl (&(ITER), &(BITNUM)); \
bmp_iter_next (&(ITER), &(BITNUM)))
+/* APPLE LOCAL begin loops-to-memset */
+/* True if MAP is an empty bitmap. */
+#define bitmap_empty_p(MAP) (!(MAP)->first)
+/* APPLE LOCAL end loops-to-memset */
+
#endif /* GCC_BITMAP_H */
diff --git a/gcc/builtins.c b/gcc/builtins.c
index afeb9bc5ce6..8bbfafda733 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5726,6 +5726,12 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
return target;
break;
+ /* APPLE LOCAL begin lno */
+ case BUILT_IN_MAYBE_INFINITE_LOOP:
+ /* This is just a fake statement that expands to nothing. */
+ return const0_rtx;
+ /* APPLE LOCAL end lno */
+
default: /* just do library call, if unknown builtin */
break;
}
@@ -8177,6 +8183,11 @@ fold_builtin_1 (tree exp, bool ignore)
break;
default:
+ /* APPLE LOCAL begin constant cfstrings */
+ /* Don't just do the library call if it's unknown, try using
+ our target version, then call the library call if that doesn't work. */
+ return (*targetm.expand_tree_builtin) (fndecl, arglist,NULL_TREE);
+ /* APPLE LOCAL end constant cfstrings */
break;
}
diff --git a/gcc/builtins.def b/gcc/builtins.def
index d422783f91e..36cac6b1e60 100644
--- a/gcc/builtins.def
+++ b/gcc/builtins.def
@@ -583,6 +583,8 @@ DEF_GCC_BUILTIN (BUILT_IN_FRAME_ADDRESS, "frame_address", BT_FN_PTR_UINT,
DEF_GCC_BUILTIN (BUILT_IN_FROB_RETURN_ADDR, "frob_return_addr", BT_FN_PTR_PTR, ATTR_NULL)
DEF_EXT_LIB_BUILTIN (BUILT_IN_GETTEXT, "gettext", BT_FN_STRING_CONST_STRING, ATTR_FORMAT_ARG_1)
DEF_C99_BUILTIN (BUILT_IN_IMAXABS, "imaxabs", BT_FN_INTMAX_INTMAX, ATTR_CONST_NOTHROW_LIST)
+/* APPLE LOCAL lno */
+DEF_GCC_BUILTIN (BUILT_IN_MAYBE_INFINITE_LOOP, "maybe_infinite_loop", BT_FN_VOID, ATTR_NULL)
DEF_GCC_BUILTIN (BUILT_IN_INIT_DWARF_REG_SIZES, "init_dwarf_reg_size_table", BT_FN_VOID_PTR, ATTR_NULL)
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITE, "finite", BT_FN_INT_DOUBLE, ATTR_CONST_NOTHROW_LIST)
DEF_EXT_LIB_BUILTIN (BUILT_IN_FINITEF, "finitef", BT_FN_INT_FLOAT, ATTR_CONST_NOTHROW_LIST)
diff --git a/gcc/c-common.c b/gcc/c-common.c
index b414915bc87..70131d49527 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -47,6 +47,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree-mudflap.h"
#include "opts.h"
#include "real.h"
+/* APPLE LOCAL 64bit shorten warning 3865314 */
+#include "options.h"
cpp_reader *parse_in; /* Declared in c-pragma.h. */
@@ -158,6 +160,13 @@ cpp_reader *parse_in; /* Declared in c-pragma.h. */
tree char_array_type_node;
+ ** APPLE LOCAL begin pascal strings **
+ Type `unsigned char[SOMENUMBER]'.
+ Used for pascal-type strings ("\pstring").
+
+ tree pascal_string_type_node;
+ ** APPLE LOCAL end pascal strings **
+
Type `int[SOMENUMBER]' or something like it.
Used when an array of int needed and the size is irrelevant.
@@ -254,6 +263,13 @@ int flag_short_double;
int flag_short_wchar;
+/* APPLE LOCAL begin lvalue cast */
+/* Nonzero means allow assignment, increment or decrement of casts of
+ lvalues (e.g., '((foo *)p)++') if both the lvalue and its cast are
+ of POD type with identical size and alignment. */
+int flag_lvalue_cast_assign = 1;
+/* APPLE LOCAL end lvalue cast */
+
/* Nonzero means allow Microsoft extensions without warnings or errors. */
int flag_ms_extensions;
@@ -261,6 +277,11 @@ int flag_ms_extensions;
int flag_no_asm;
+/* APPLE LOCAL begin CW asm blocks */
+/* Nonzero means accept CW-style asm blocks. */
+int flag_cw_asm_blocks;
+/* APPLE LOCAL end CW asm blocks */
+
/* Nonzero means give string constants the type `const char *', as mandated
by the standard. */
@@ -330,6 +351,12 @@ int flag_hosted = 1;
int warn_main;
+/* APPLE LOCAL begin disable_typechecking_for_spec_flag */
+/* This makes type conflicts a warning, instead of an error,
+ to work around some problems with SPEC. */
+
+int disable_typechecking_for_spec_flag;
+/* APPLE LOCAL end disable_typechecking_for_spec_flag */
/* ObjC language option variables. */
@@ -347,6 +374,13 @@ int flag_next_runtime = 1;
int flag_next_runtime = 0;
#endif
+/* APPLE LOCAL begin ObjC C++ ivars */
+/* Generate special '- .cxx_construct' and '- .cxx_destruct' methods
+ to initialize any non-POD ivars in ObjC++ classes. */
+
+int flag_objc_call_cxx_cdtors = 0;
+/* APPLE LOCAL end ObjC C++ ivars */
+
/* Tells the compiler that this is a special run. Do not perform any
compiling, instead we are to test some platform dependent features
and output a C header file with appropriate definitions. */
@@ -459,6 +493,23 @@ int flag_permissive;
int flag_enforce_eh_specs = 1;
+/* APPLE LOCAL begin private extern Radar 2872481 --ilr */
+/* Nonzero if -fpreproceessed specified. This is needed by
+ init_reswords() so that it can make __private_extern__ have the
+ same rid code as extern when -fpreprocessed is specified. Normally
+ there is a -D on the command line for this. But if -fpreprocessed
+ was specified then macros aren't expanded. So we fake the token
+ value out using the rid code. */
+int flag_preprocessed = 0;
+/* APPLE LOCAL end private extern Radar 2872481 --ilr */
+
+/* APPLE LOCAL begin structor thunks */
+/* Nonzero if we prefer to clone con/de/structors. Alternative is to
+ gen multiple tiny thunk-esque things that call/jump to a unified
+ con/de/structor. This is a classic size/speed tradeoff. */
+int flag_clone_structors = 0;
+/* APPLE LOCAL end structor thunks */
+
/* Nonzero means to generate thread-safe code for initializing local
statics. */
@@ -511,6 +562,45 @@ static int constant_fits_type_p (tree, tree);
static tree check_case_value (tree);
static bool check_case_bounds (tree, tree, tree *, tree *);
+/* APPLE LOCAL begin CW asm blocks */
+/* State variable telling the lexer what to do. */
+enum cw_asm_states cw_asm_state = cw_asm_none;
+
+/* True in an asm block while parsing a decl. */
+int cw_asm_in_decl;
+
+/* This is true exactly within the interior of an asm block. It is
+ not quite the same as any of the states of cw_asm_state. */
+int cw_asm_block;
+
+/* An additional state variable, true when the next token returned
+ should be a BOL, false otherwise. */
+int cw_asm_at_bol;
+
+/* True when the lexer/parser is handling operands. */
+int cw_asm_in_operands;
+
+/* Count used for synthetic labels derived from asm block labels. */
+int cw_asm_labelno;
+
+/* Working buffer for building the assembly string. */
+static char *cw_asm_buffer;
+
+/* An array tracking which variables to list as inputs and outputs. */
+static GTY(()) varray_type cw_asm_operands;
+static GTY(()) varray_type cw_asm_operands_arg;
+
+/* Two arrays used as a map from user-supplied labels, local to an asm
+ block, to unique global labels that the assembler will like. */
+static GTY(()) varray_type cw_asm_labels;
+static GTY(()) varray_type cw_asm_labels_uniq;
+
+static int cw_asm_expr_val (tree arg);
+static void print_cw_asm_operand (char *, tree, unsigned, bool, bool);
+static int cw_asm_get_register_var (tree, unsigned, bool);
+static tree cw_asm_identifier (tree expr);
+/* APPLE LOCAL end CW asm blocks */
+
static tree handle_packed_attribute (tree *, tree, tree, int, bool *);
static tree handle_nocommon_attribute (tree *, tree, tree, int, bool *);
static tree handle_common_attribute (tree *, tree, tree, int, bool *);
@@ -542,6 +632,9 @@ static tree handle_no_limit_stack_attribute (tree *, tree, tree, int,
static tree handle_pure_attribute (tree *, tree, tree, int, bool *);
static tree handle_deprecated_attribute (tree *, tree, tree, int,
bool *);
+/* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */
+static tree handle_unavailable_attribute (tree *, tree, tree, int, bool *);
+/* APPLE LOCAL end "unavailable" attribute --ilr */
static tree handle_vector_size_attribute (tree *, tree, tree, int,
bool *);
static tree handle_nonnull_attribute (tree *, tree, tree, int, bool *);
@@ -613,6 +706,10 @@ const struct attribute_spec c_common_attribute_table[] =
handle_pure_attribute },
{ "deprecated", 0, 0, false, false, false,
handle_deprecated_attribute },
+ /* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */
+ { "unavailable", 0, 0, false, false, false,
+ handle_unavailable_attribute },
+ /* APPLE LOCAL end "unavailable" attribute --ilr */
{ "vector_size", 1, 1, false, true, false,
handle_vector_size_attribute },
{ "visibility", 1, 1, false, false, false,
@@ -746,7 +843,8 @@ fname_as_string (int pretty_p)
strname.text = (unsigned char *) namep;
strname.len = len - 1;
- if (cpp_interpret_string (parse_in, &strname, 1, &cstr, false))
+ /* APPLE LOCAL pascal strings add extra flag */
+ if (cpp_interpret_string (parse_in, &strname, 1, &cstr, false, false))
{
XDELETEVEC (namep);
return (char *) cstr.text;
@@ -835,6 +933,8 @@ fix_string_type (tree value)
{
const int wchar_bytes = TYPE_PRECISION (wchar_type_node) / BITS_PER_UNIT;
const int wide_flag = TREE_TYPE (value) == wchar_array_type_node;
+ /* APPLE LOCAL pascal strings */
+ const int pascal_flag = TREE_TYPE (value) == pascal_string_type_node;
const int nchars_max = flag_isoc99 ? 4095 : 509;
int length = TREE_STRING_LENGTH (value);
int nchars;
@@ -847,7 +947,8 @@ fix_string_type (tree value)
pedwarn ("string length %qd is greater than the length %qd ISO C%d compilers are required to support",
nchars - 1, nchars_max, flag_isoc99 ? 99 : 89);
- e_type = wide_flag ? wchar_type_node : char_type_node;
+ /* APPLE LOCAL pascal strings */
+ e_type = wide_flag ? wchar_type_node : (pascal_flag ? unsigned_char_type_node : char_type_node);
/* Create the array type for the string constant. flag_const_strings
says make the string constant an array of const char so that
copying it to a non-const pointer will get a warning. For C++,
@@ -861,13 +962,16 @@ fix_string_type (tree value)
unconditionally. */
i_type = build_index_type (build_int_cst (NULL_TREE, nchars - 1));
a_type = build_array_type (e_type, i_type);
- if (flag_const_strings)
+ /* APPLE LOCAL fwritable strings */
+ if (flag_const_strings && ! flag_writable_strings)
a_type = c_build_qualified_type (a_type, TYPE_QUAL_CONST);
TREE_TYPE (value) = a_type;
- TREE_CONSTANT (value) = 1;
- TREE_INVARIANT (value) = 1;
- TREE_READONLY (value) = 1;
+ /* APPLE LOCAL begin fwritable strings */
+ TREE_CONSTANT (value) = !flag_writable_strings;
+ TREE_INVARIANT (value) = !flag_writable_strings;
+ TREE_READONLY (value) = !flag_writable_strings;
+ /* APPLE LOCAL end fwritable strings */
TREE_STATIC (value) = 1;
return value;
}
@@ -981,6 +1085,14 @@ tree
convert_and_check (tree type, tree expr)
{
tree t = convert (type, expr);
+ /* APPLE LOCAL begin 64bit shorten warning 3865314 */
+ if (warn_shorten_64_to_32
+ && TYPE_PRECISION (TREE_TYPE (expr)) == 64
+ && TYPE_PRECISION (type) == 32)
+ {
+ warning ("implicit conversion shortens 64-bit value into a 32-bit value");
+ }
+ /* APPLE LOCAL end 64bit shorten warning 3865314 */
if (TREE_CODE (t) == INTEGER_CST)
{
if (TREE_OVERFLOW (t))
@@ -3064,6 +3176,10 @@ c_common_nodes_and_builtins (void)
array type. */
char_array_type_node
= build_array_type (char_type_node, array_domain_type);
+ /* APPLE LOCAL begin pascal strings */
+ pascal_string_type_node
+ = build_array_type (unsigned_char_type_node, array_domain_type);
+ /* APPLE LOCAL end pascal strings */
/* Likewise for arrays of ints. */
int_array_type_node
@@ -3299,7 +3415,9 @@ typedef struct disabled_builtin
} disabled_builtin;
static disabled_builtin *disabled_builtins = NULL;
-static bool builtin_function_disabled_p (const char *);
+/* APPLE LOCAL begin IMA built-in decl merging fix (radar 3645899) */
+bool builtin_function_disabled_p (const char *);
+/* APPLE LOCAL end */
/* Disable a built-in function specified by -fno-builtin-NAME. If NAME
begins with "__builtin_", give an error. */
@@ -3321,8 +3439,10 @@ disable_builtin_function (const char *name)
/* Return true if the built-in function NAME has been disabled, false
otherwise. */
-
-static bool
+/* APPLE LOCAL begin IMA built-in decl merging fix (radar 3645899) */
+/* Remove static */
+bool
+/* APPLE LOCAL end */
builtin_function_disabled_p (const char *name)
{
disabled_builtin *p;
@@ -4887,6 +5007,70 @@ handle_deprecated_attribute (tree *node, tree name,
return NULL_TREE;
}
+/* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) --ilr */
+/* Handle a "unavailable" attribute; arguments as in
+ struct attribute_spec.handler. */
+
+static tree
+handle_unavailable_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
+{
+ tree type = NULL_TREE;
+ int warn = 0;
+ const char *what = NULL;
+
+ if (DECL_P (*node))
+ {
+ tree decl = *node;
+ type = TREE_TYPE (decl);
+
+ if (TREE_CODE (decl) == TYPE_DECL
+ || TREE_CODE (decl) == PARM_DECL
+ || TREE_CODE (decl) == VAR_DECL
+ || TREE_CODE (decl) == FUNCTION_DECL
+ || TREE_CODE (decl) == FIELD_DECL)
+ {
+ TREE_DEPRECATED (decl) = 1;
+ TREE_UNAVAILABLE (decl) = 1;
+ }
+ else
+ warn = 1;
+ }
+ else if (TYPE_P (*node))
+ {
+ if (!(flags & (int) ATTR_FLAG_TYPE_IN_PLACE))
+ *node = build_variant_type_copy (*node);
+ TREE_DEPRECATED (*node) = 1;
+ TREE_UNAVAILABLE (*node) = 1;
+ type = *node;
+ }
+ else
+ warn = 1;
+
+ if (warn)
+ {
+ *no_add_attrs = true;
+ if (type && TYPE_NAME (type))
+ {
+ if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
+ what = IDENTIFIER_POINTER (TYPE_NAME (*node));
+ else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
+ && DECL_NAME (TYPE_NAME (type)))
+ what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
+ }
+ if (what)
+ warning ("`%s' attribute ignored for `%s'",
+ IDENTIFIER_POINTER (name), what);
+ else
+ warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
+ }
+
+ return NULL_TREE;
+}
+/* APPLE LOCAL end "unavailable" attribute --ilr */
+
/* Handle a "vector_size" attribute; arguments as in
struct attribute_spec.handler. */
@@ -5685,14 +5869,79 @@ fold_offsetof (tree expr)
return convert (size_type_node, fold_offsetof_1 (expr));
}
-/* Return nonzero if REF is an lvalue valid for this language;
- otherwise, print an error message and return zero. USE says
- how the lvalue is being used and so selects the error message. */
+/* APPLE LOCAL begin non lvalue assign */
+/* Return nonzero if the expression pointed to by REF is an lvalue
+ valid for this language; otherwise, print an error message and return
+ zero. USE says how the lvalue is being used and so selects the error
+ message. If -fnon-lvalue-assign has been specified, certain
+ non-lvalue expression shall be rewritten as lvalues and stored back
+ at the location pointed to by REF. */
int
-lvalue_or_else (tree ref, enum lvalue_use use)
+lvalue_or_else (tree *ref, enum lvalue_use use)
{
- int win = lvalue_p (ref);
+ tree r = *ref;
+ int win = lvalue_p (r);
+
+ /* If -fnon-lvalue-assign is specified, we shall allow assignments
+ to certain constructs that are not (stricly speaking) lvalues. */
+ if (!win && flag_non_lvalue_assign)
+ {
+ /* (1) Assignment to casts of lvalues, as long as both the lvalue and
+ the cast are POD types with identical size and alignment. */
+ if ((TREE_CODE (r) == NOP_EXPR || TREE_CODE (r) == CONVERT_EXPR
+ || TREE_CODE (r) == NON_LVALUE_EXPR)
+ && (use == lv_assign || use == lv_increment || use == lv_decrement
+ || use == lv_addressof)
+ /* APPLE LOCAL non lvalue assign */
+ && lvalue_or_else (&TREE_OPERAND (r, 0), use))
+ {
+ tree cast_to = TREE_TYPE (r);
+ tree cast_from = TREE_TYPE (TREE_OPERAND (r, 0));
+
+ if (simple_cst_equal (TYPE_SIZE (cast_to), TYPE_SIZE (cast_from))
+ && TYPE_ALIGN (cast_to) == TYPE_ALIGN (cast_from))
+ {
+ /* Rewrite '(cast_to)ref' as '*(cast_to *)&ref' so
+ that the back-end need not think too hard... */
+ *ref
+ = build_indirect_ref
+ (convert (build_pointer_type (cast_to),
+ build_unary_op
+ (ADDR_EXPR, TREE_OPERAND (r, 0), 0)), 0);
+
+ goto allow_as_lvalue;
+ }
+ }
+ /* (2) Assignment to conditional expressions, as long as both
+ alternatives are already lvalues. */
+ else if (TREE_CODE (r) == COND_EXPR
+ /* APPLE LOCAL non lvalue assign */
+ && lvalue_or_else (&TREE_OPERAND (r, 1), use)
+ /* APPLE LOCAL non lvalue assign */
+ && lvalue_or_else (&TREE_OPERAND (r, 2), use))
+ {
+ /* Rewrite 'cond ? lv1 : lv2' as '*(cond ? &lv1 : &lv2)' to
+ placate the back-end. */
+ *ref
+ = build_indirect_ref
+ (build_conditional_expr
+ (TREE_OPERAND (r, 0),
+ build_unary_op (ADDR_EXPR, TREE_OPERAND (r, 1), 0),
+ build_unary_op (ADDR_EXPR, TREE_OPERAND (r, 2), 0)),
+ 0);
+
+ allow_as_lvalue:
+ win = 1;
+ if (warn_non_lvalue_assign)
+ warning ("%s not really an lvalue; "
+ "this will be a hard error in the future",
+ (use == lv_addressof
+ ? "argument to '&'"
+ : "target of assignment"));
+ }
+ }
+/* APPLE LOCAL end non-lvalue assign */
if (!win)
{
@@ -5721,4 +5970,776 @@ lvalue_or_else (tree ref, enum lvalue_use use)
return win;
}
+/* APPLE LOCAL begin AltiVec */
+/* Convert the incoming expression EXPR into a vector constructor of
+ type VECTOR_TYPE, casting the individual vector elements as appropriate. */
+
+tree
+vector_constructor_from_expr (tree expr, tree vector_type)
+{
+ tree list = NULL_TREE, elttype = TREE_TYPE (vector_type);
+ int index;
+ bool final;
+ int all_constant = TREE_CONSTANT (expr);
+
+ /* If we already have a vector expression, then the user probably
+ wants to convert it to another. */
+ if (TREE_CODE (TREE_TYPE (expr)) == VECTOR_TYPE)
+ return convert (vector_type, expr);
+
+ /* Walk through the compound expression, gathering initializers. */
+ final = false;
+ for (index = 0; !final; ++index)
+ {
+ tree elem;
+
+ if (TREE_CODE (expr) == COMPOUND_EXPR)
+ {
+ elem = TREE_OPERAND (expr, 1);
+ expr = TREE_OPERAND (expr, 0);
+ }
+ else
+ {
+ final = true;
+ elem = expr;
+ }
+
+ while (TREE_CODE (elem) == COMPOUND_EXPR && TREE_CONSTANT (elem))
+ elem = TREE_OPERAND (elem, 1);
+ while (TREE_CODE (elem) == CONVERT_EXPR)
+ elem = TREE_OPERAND (elem, 0);
+
+ list = chainon (list,
+ build_tree_list (NULL_TREE,
+ convert (elttype, fold (elem))));
+ }
+
+ list = nreverse (list);
+
+ list = build_constructor (vector_type, list);
+ if (c_dialect_cxx ())
+ TREE_LANG_FLAG_4 (list) = 1; /* TREE_HAS_CONSTRUCTOR */
+
+ TREE_CONSTANT (list) = all_constant;
+
+ return list;
+}
+/* APPLE LOCAL end AltiVec */
+
+/* APPLE LOCAL begin CW asm blocks */
+/* Perform the default conversion of functions to pointers; simplified
+ version for use with functions mentioned in CW-style asm.
+ Return the result of converting EXP. For any other expression, just
+ return EXP. */
+
+static tree
+cw_asm_default_function_conversion (tree exp)
+{
+ tree type = TREE_TYPE (exp);
+ enum tree_code code = TREE_CODE (type);
+
+ /* Strip NON_LVALUE_EXPRs and no-op conversions, since we aren't using as
+ an lvalue.
+
+ Do not use STRIP_NOPS here! It will remove conversions from pointer
+ to integer and cause infinite recursion. */
+ while (TREE_CODE (exp) == NON_LVALUE_EXPR
+ || (TREE_CODE (exp) == NOP_EXPR
+ && TREE_TYPE (TREE_OPERAND (exp, 0)) == TREE_TYPE (exp)))
+ exp = TREE_OPERAND (exp, 0);
+
+ if (code == FUNCTION_TYPE)
+ return build_unary_op (ADDR_EXPR, exp, 0);
+
+ return exp;
+}
+
+/* The constraints table for CW style assembly. Things not listed are
+ usually considered as "+b", "+v" or "+f" depending upon context. */
+
+struct cw_op_constraint
+{
+ const char *opcode;
+ unsigned argnum;
+ const char *constraint;
+};
+
+/* Comparison function for bsearch to find an opcode/argument number
+ in the opcode constraint table. */
+
+static int
+cw_op_comp (const void *a, const void *b)
+{
+ const struct cw_op_constraint *x = a;
+ const struct cw_op_constraint *y = b;
+ int c = strcmp (x->opcode, y->opcode);
+ if (c)
+ return c;
+ if (x->argnum < y->argnum)
+ return -1;
+ if (x->argnum > y->argnum)
+ return 1;
+ return 0;
+}
+
+/* We lookup the OPCODE and return the constraint for the ARGNUM
+ argument. This is used only for otherwise ambiguous cases. */
+
+static const char*
+cw_constraint_for (const char *opcode, unsigned argnum)
+{
+ /* This table must be sorted. */
+ static struct cw_op_constraint db[] = {
+ { "la", 2, "m" },
+ { "lbz", 2, "m" },
+ { "lbzu", 2, "m" },
+ { "ld", 2, "m" },
+ { "ldu", 2, "m" },
+ { "lfd", 2, "m" },
+ { "lfdu", 2, "m" },
+ { "lfs", 2, "m" },
+ { "lfsu", 2, "m" },
+ { "lha", 2, "m" },
+ { "lhau", 2, "m" },
+ { "lhz", 2, "m" },
+ { "lhzu", 2, "m" },
+ { "lmw", 2, "m" },
+ { "lwa", 2, "m" },
+ { "lwz", 2, "m" },
+ { "lwzu", 2, "m" },
+ { "stb", 2, "m" },
+ { "stbu", 2, "m" },
+ { "std", 2, "m" },
+ { "stdu", 2, "m" },
+ { "stfd", 2, "m" },
+ { "stfdu", 2, "m" },
+ { "stfs", 2, "m" },
+ { "stfsu", 2, "m" },
+ { "sth", 2, "m" },
+ { "sthu", 2, "m" },
+ { "stmw", 2, "m" },
+ { "stw", 2, "m" },
+ { "stwu", 2, "m" },
+ };
+ struct cw_op_constraint key;
+ struct cw_op_constraint *r;
+
+ key.opcode = opcode;
+ key.argnum = argnum;
+ r = bsearch (&key, db, sizeof (db) / sizeof (db[0]), sizeof (db[0]), cw_op_comp);
+
+ /* Any explicitly listed contraint is always used. */
+ if (r)
+ return r->constraint;
+
+ return NULL;
+}
+
+/* Return true iff the opcode wants memory to be stable. We arrange
+ for a memory clobber in these instances. */
+static bool
+cw_memory_clobber (const char *opcode)
+{
+ return strncmp (opcode, "st", 2) == 0
+ || (strncmp (opcode, "l", 1) == 0 && (strcmp (opcode, "la") != 0
+ && strcmp (opcode, "li") != 0
+ && strcmp (opcode, "lis") != 0))
+ || strcmp (opcode, "sc") == 0
+ || strncmp (opcode, "td", 2) == 0
+ || strcmp (opcode, "trap") == 0
+ || strncmp (opcode, "tw", 2) == 0;
+}
+
+/* MUST_BE_REG is true, iff we know the operand must be a register. */
+
+static void
+cw_process_arg (const char *opcodename, tree var, unsigned argnum,
+ bool must_be_reg,
+ tree *outputsp, tree*inputsp)
+{
+ const char *s;
+ bool was_output = true;
+ tree str, one;
+
+ if (must_be_reg)
+ s = "+b";
+ else
+ s = cw_constraint_for (opcodename, argnum);
+
+ if (TREE_CODE (var) == FUNCTION_DECL)
+ {
+ str = build_string (1, "s");
+ was_output = false;
+ }
+ else
+ {
+ /* This is PowerPC-specific. */
+ if (s)
+ {
+ str = build_string (strlen (s), s);
+ was_output = ((s[0] == '=') | (s[0] == '+'));
+ }
+ else if (TREE_CODE (TREE_TYPE (var)) == REAL_TYPE)
+ str = build_string (2, "+f");
+ else
+ if (TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE)
+ str = build_string (2, "+v");
+ else
+ str = build_string (2, "+b");
+ }
+
+ one = build_tree_list (build_tree_list (NULL_TREE, str), var);
+ if (was_output)
+ *outputsp = chainon (*outputsp, one);
+ else
+ *inputsp = chainon (*inputsp, one);
+}
+
+/* CW identifier may include '.', '+' or '-'. Except that an operator
+ can only end in a '.'. This routine creates a new valid operator
+ parsed as a CW identifier. */
+
+static tree
+cw_asm_identifier (tree expr)
+{
+ const char *opcodename = IDENTIFIER_POINTER (expr);
+ int len = IDENTIFIER_LENGTH (expr);
+ int i;
+ for (i = 0; i < len; i++)
+ if (opcodename[i] == '.')
+ break;
+ if (i+1 < len) /* operator. is ok */
+ {
+ char *buf = (char *) alloca (IDENTIFIER_LENGTH (expr) + 1);
+ strncpy (buf, opcodename, i);
+ buf[i] = ' ';
+ strcpy (buf+i+1, opcodename + i);
+ return get_identifier (buf);
+ }
+ return expr;
+}
+
+/* Build an asm statement from CW-syntax bits. */
+tree
+cw_asm_stmt (tree expr, tree args, int lineno)
+{
+ tree sexpr;
+ tree arg, tail;
+ tree inputs, outputs, clobbers;
+ tree stmt;
+ unsigned int n;
+ const char *opcodename;
+
+ cw_asm_in_operands = 0;
+ VARRAY_TREE_INIT (cw_asm_operands, 30, "cw_asm_operands");
+ VARRAY_UINT_INIT (cw_asm_operands_arg, 30, "cw_asm_operands");
+ outputs = NULL_TREE;
+ inputs = NULL_TREE;
+ clobbers = NULL_TREE;
+
+ STRIP_NOPS (expr);
+
+ if (TREE_CODE (expr) == ADDR_EXPR)
+ expr = TREE_OPERAND (expr, 0);
+
+ expr = cw_asm_identifier (expr);
+
+ opcodename = IDENTIFIER_POINTER (expr);
+
+ /* Handle special directives specially. */
+ if (strcmp (opcodename, "entry") == 0)
+ return cw_asm_entry (expr, NULL_TREE, TREE_VALUE (args));
+ else if (strcmp (opcodename, "fralloc") == 0)
+ {
+ /* The correct default size is target-specific, so leave this as
+ a cookie for the backend. */
+ DECL_CW_ASM_FRAME_SIZE (current_function_decl) = -1;
+ if (args)
+ {
+ arg = TREE_VALUE (args);
+ STRIP_NOPS (arg);
+ if (TREE_CODE (arg) == INTEGER_CST)
+ {
+ int intval = tree_low_cst (arg, 0);
+ if (intval >= 0)
+ DECL_CW_ASM_FRAME_SIZE (current_function_decl) = intval;
+ else
+ error ("fralloc argument must be nonnegative");
+ }
+ else
+ error ("fralloc argument is not an integer");
+ }
+ return NULL_TREE;
+ }
+ else if (strcmp (opcodename, "frfree") == 0)
+ {
+ DECL_CW_ASM_NORETURN (current_function_decl) = 1;
+ /* Create a default-size frame retroactively. */
+ if (DECL_CW_ASM_FRAME_SIZE (current_function_decl) == (unsigned int)-2)
+ DECL_CW_ASM_FRAME_SIZE (current_function_decl) = (unsigned int)-1;
+ return NULL_TREE;
+ }
+ else if (strcmp (opcodename, "nofralloc") == 0)
+ {
+ DECL_CW_ASM_NORETURN (current_function_decl) = 1;
+ DECL_CW_ASM_FRAME_SIZE (current_function_decl) = -2;
+ return NULL_TREE;
+ }
+ else if (strcmp (opcodename, "machine") == 0)
+ {
+ return NULL_TREE;
+ }
+ else if (strcmp (opcodename, "opword") == 0)
+ {
+ opcodename = ".long";
+ }
+
+ if (cw_asm_buffer == NULL)
+ cw_asm_buffer = xmalloc (4000);
+
+ /* Build .file "file-name" directive. */
+ sprintf(cw_asm_buffer, "%s \"%s\"", ".file", input_filename);
+ sexpr = build_string (strlen (cw_asm_buffer), cw_asm_buffer);
+ stmt = build_stmt (ASM_EXPR, sexpr, NULL_TREE, NULL_TREE, NULL_TREE);
+ ASM_VOLATILE_P (stmt) = 1;
+ (void)add_stmt (stmt);
+
+ /* Build .line "line-number" directive. */
+ sprintf(cw_asm_buffer, "%s %d", ".line", lineno);
+ sexpr = build_string (strlen (cw_asm_buffer), cw_asm_buffer);
+ stmt = build_stmt (ASM_EXPR, sexpr, NULL_TREE, NULL_TREE, NULL_TREE);
+ ASM_VOLATILE_P (stmt) = 1;
+ (void)add_stmt (stmt);
+
+ cw_asm_buffer[0] = '\0';
+ strncat (cw_asm_buffer, opcodename, IDENTIFIER_LENGTH (expr));
+ strcat (cw_asm_buffer, " ");
+ n = 1;
+ /* Iterate through operands, "printing" each into the asm string. */
+ for (tail = args; tail; tail = TREE_CHAIN (tail))
+ {
+ arg = TREE_VALUE (tail);
+ if (tail != args)
+ strcat (cw_asm_buffer, ",");
+ print_cw_asm_operand (cw_asm_buffer, arg, n, false, false);
+ ++n;
+ }
+
+ sexpr = build_string (strlen (cw_asm_buffer), cw_asm_buffer);
+
+ /* Treat each C function seen as a input, and all parms/locals as
+ both inputs and outputs. */
+ for (n = 0; n < VARRAY_ACTIVE_SIZE (cw_asm_operands); ++n)
+ {
+ tree var = VARRAY_TREE (cw_asm_operands, n);
+ unsigned argnum = VARRAY_UINT (cw_asm_operands_arg, n);
+ bool must_be_reg;
+ must_be_reg = argnum & 1;
+ argnum >>= 1;
+
+ cw_process_arg (opcodename, var, argnum,
+ must_be_reg, &outputs, &inputs);
+ }
+
+ if (cw_memory_clobber (opcodename))
+ {
+ /* To not clobber all of memory, we would need to know what
+ memory locations were accessed; for now, punt. */
+ clobbers = tree_cons (NULL_TREE,
+ build_string (6, "memory"),
+ clobbers);
+ }
+
+ /* Perform default conversions on function inputs.
+ Don't do this for other types as it would screw up operands
+ expected to be in memory. */
+ for (tail = inputs; tail; tail = TREE_CHAIN (tail))
+ TREE_VALUE (tail) = cw_asm_default_function_conversion (TREE_VALUE (tail));
+
+ /* Treat as volatile always. */
+ stmt = build_stmt (ASM_EXPR, sexpr, outputs, inputs, clobbers);
+ ASM_VOLATILE_P (stmt) = 1;
+ stmt = add_stmt (stmt);
+ return stmt;
+}
+
+/* Compute the offset of a field, in bytes. Round down for bit
+ offsets, but that's OK for use in asm code. */
+
+static int
+cw_asm_field_offset (tree arg)
+{
+ return (tree_low_cst (DECL_FIELD_OFFSET (arg), 0)
+ + tree_low_cst (DECL_FIELD_BIT_OFFSET (arg), 0) / BITS_PER_UNIT);
+}
+
+/* Compute the int value for the expression. */
+
+static int
+cw_asm_expr_val (tree arg)
+{
+ if (TREE_CODE (arg) == FIELD_DECL)
+ return cw_asm_field_offset (arg);
+
+ if (TREE_CODE (arg) == INTEGER_CST)
+ return tree_low_cst (arg, 0);
+
+ if (TREE_CODE (arg) == PLUS_EXPR)
+ return cw_asm_expr_val (TREE_OPERAND (arg, 0))
+ + cw_asm_expr_val (TREE_OPERAND (arg, 1));
+
+ if (TREE_CODE (arg) == MINUS_EXPR)
+ return cw_asm_expr_val (TREE_OPERAND (arg, 0))
+ - cw_asm_expr_val (TREE_OPERAND (arg, 1));
+
+ if (TREE_CODE (arg) == NEGATE_EXPR)
+ return - cw_asm_expr_val (TREE_OPERAND (arg, 0));
+
+ error ("invalid operand for arithmetic in assembly block");
+ return 0;
+}
+
+/* Print an operand according to its tree type. MUST_BE_REG is true,
+ iff we know the operand must be a register. MUST_NOT_BE_REG is true,
+ iff we know the operand must not be a register. */
+
+static void
+print_cw_asm_operand (char *buf, tree arg, unsigned argnum,
+ bool must_be_reg, bool must_not_be_reg)
+{
+ int idnum;
+ HOST_WIDE_INT bitsize, bitpos;
+ tree offset;
+ enum machine_mode mode;
+ int unsignedp, volatilep;
+ tree op0;
+
+ STRIP_NOPS (arg);
+
+ switch (TREE_CODE (arg))
+ {
+ case INTEGER_CST:
+ sprintf (buf + strlen (buf), HOST_WIDE_INT_PRINT_DEC, tree_low_cst (arg, 0));
+ break;
+
+ case IDENTIFIER_NODE:
+ strncat (buf, IDENTIFIER_POINTER (arg), IDENTIFIER_LENGTH (arg));
+ break;
+
+ case VAR_DECL:
+ case PARM_DECL:
+ /* Named non-stack variables always refer to the address of that
+ variable. */
+ if (TREE_CODE (arg) == VAR_DECL
+ && TREE_STATIC (arg)
+ && MEM_P (DECL_RTL (arg)))
+ {
+ /* See assemble_name for details. */
+ const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (arg));
+ const char *real_name;
+ tree id;
+
+ mark_referenced (DECL_ASSEMBLER_NAME (arg));
+ real_name = targetm.strip_name_encoding (name);
+ id = maybe_get_identifier (real_name);
+ if (id)
+ mark_referenced (id);
+
+ if (name[0] == '*')
+ strncat (buf, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (arg)) + 1,
+ IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (arg)) - 1);
+ else
+ {
+ sprintf (buf + strlen (buf), "%s", user_label_prefix);
+ strncat (buf, IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (arg)),
+ IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (arg)));
+ }
+
+ mark_decl_referenced (arg);
+ }
+ else if ((idnum = cw_asm_get_register_var (arg, argnum, must_be_reg)) >= 0)
+ {
+ strcat (buf, "%");
+ sprintf (buf + strlen (buf), "%d", idnum);
+ }
+ break;
+
+ case FUNCTION_DECL:
+ if ((idnum = cw_asm_get_register_var (arg, argnum, must_be_reg)) >= 0)
+ {
+ strcat (buf, "%z");
+ sprintf (buf + strlen (buf), "%d", idnum);
+ }
+ break;
+
+ case COMPOUND_EXPR:
+ /* "Compound exprs" are really offset+register constructs. */
+ print_cw_asm_operand (buf, TREE_OPERAND (arg, 0), argnum,
+ false, true);
+ strcat (buf, "(");
+ print_cw_asm_operand (buf, TREE_OPERAND (arg, 1), argnum,
+ ! must_not_be_reg, must_not_be_reg);
+ strcat (buf, ")");
+ break;
+
+ case PLUS_EXPR:
+ case MINUS_EXPR:
+ sprintf (buf + strlen (buf), "%d", cw_asm_expr_val (arg));
+ break;
+
+ case FIELD_DECL:
+ sprintf (buf + strlen (buf), "%d", cw_asm_field_offset (arg));
+ break;
+
+ case COMPONENT_REF:
+ get_inner_reference (arg, &bitsize, &bitpos, &offset, &mode, &unsignedp, &volatilep, false);
+ /* Convert bit pos to byte pos, rounding down (this is asm,
+ after all). */
+ /* APPLE LOCAL 32-bit HOST_WIDE_INT */
+ sprintf (buf + strlen (buf), "%lld", (long long int) (bitpos / BITS_PER_UNIT));
+ strcat (buf, "(");
+ op0 = TREE_OPERAND (arg, 0);
+ /* Catch a couple different flavors of component refs. */
+ if (TREE_CODE (op0) == VAR_DECL)
+ print_cw_asm_operand (buf, op0, argnum, true, false);
+ else
+ print_cw_asm_operand (buf, TREE_OPERAND (op0, 0), argnum, true, false);
+ strcat (buf, ")");
+ break;
+
+ case ARRAY_REF:
+ error ("array references not supported");
+ break;
+
+ default:
+ /* Something is wrong, most likely a user error. */
+ error ("block assembly operand not recognized");
+ break;
+ }
+}
+
+/* Given an identifier name, come up with the index to use for the %0,
+ %1, etc in the asm string. MUST_BE_REG is true, iff we know the
+ operand must be a register. */
+
+static int
+cw_asm_get_register_var (tree var, unsigned argnum, bool must_be_reg)
+{
+ unsigned int n;
+
+ for (n = 0; n < VARRAY_ACTIVE_SIZE (cw_asm_operands); ++n)
+ {
+ if (var == VARRAY_TREE (cw_asm_operands, n))
+ return n;
+ }
+
+ VARRAY_PUSH_TREE (cw_asm_operands, var);
+ VARRAY_PUSH_UINT (cw_asm_operands_arg, (argnum<<1) + must_be_reg);
+ return VARRAY_ACTIVE_SIZE (cw_asm_operands) - 1;
+}
+
+tree
+cw_asm_reg_name (tree id)
+{
+#ifdef CW_ASM_REGISTER_NAME
+ char buf[100];
+ const char *newname = CW_ASM_REGISTER_NAME (IDENTIFIER_POINTER (id), buf);
+ if (newname)
+ return get_identifier (newname);
+#else
+ if (decode_reg_name (IDENTIFIER_POINTER (id)) >= 0)
+ return id;
+#endif
+ return NULL_TREE;
+}
+
+/* Build an asm label from CW-syntax bits. */
+tree
+cw_asm_label (tree labid, int atsign)
+{
+ tree sexpr;
+ tree inputs = NULL_TREE, outputs = NULL_TREE, clobbers = NULL_TREE;
+ tree stmt;
+
+ STRIP_NOPS (labid);
+
+ if (atsign)
+ labid = prepend_char_identifier (labid, '@');
+
+ if (cw_asm_buffer == NULL)
+ cw_asm_buffer = xmalloc (4000);
+
+ cw_asm_buffer[0] = '\0';
+ strcat (cw_asm_buffer, IDENTIFIER_POINTER (get_cw_asm_label (labid)));
+ strcat (cw_asm_buffer, ":");
+
+ sexpr = build_string (strlen (cw_asm_buffer), cw_asm_buffer);
+
+ /* Simple asm statements are treated as volatile. */
+ stmt = build_stmt (ASM_EXPR, sexpr, outputs, inputs, clobbers);
+ ASM_VOLATILE_P (stmt) = 1;
+ stmt = add_stmt (stmt);
+ return stmt;
+}
+
+/* Create a new identifier with an 'ch' stuck on the front. */
+
+tree
+prepend_char_identifier (tree ident, char ch)
+{
+ char *buf = (char *) alloca (IDENTIFIER_LENGTH (ident) + 20);
+ buf[0] = ch;
+ strcpy (buf + 1, IDENTIFIER_POINTER (ident));
+ return get_identifier (buf);
+}
+
+/* In CW assembly, '.', '-' and '+ can follow identifiers, and are
+ part of them. This routine joins a normal C identifier with such a
+ suffix. */
+
+tree
+cw_get_identifier (tree id, const char *str)
+{
+ char *buf;
+ int len = strlen (str);
+ buf = (char *) alloca (IDENTIFIER_LENGTH (id) + len + 1);
+ memcpy (buf, IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
+ memcpy (buf + IDENTIFIER_LENGTH (id), str, len);
+ buf[IDENTIFIER_LENGTH (id) + len] = 0;
+ return get_identifier (buf);
+}
+
+void
+clear_cw_asm_labels (void)
+{
+ if (!cw_asm_labels)
+ VARRAY_TREE_INIT (cw_asm_labels, 40, "cw_asm_labels");
+ if (!cw_asm_labels_uniq)
+ VARRAY_TREE_INIT (cw_asm_labels_uniq, 40, "cw_asm_labels_uniq");
+ VARRAY_POP_ALL (cw_asm_labels);
+ VARRAY_POP_ALL (cw_asm_labels_uniq);
+}
+
+static GTY(()) tree cw_ha16;
+static GTY(()) tree cw_hi16;
+static GTY(()) tree cw_lo16;
+
+/* Given a label identifier and a flag indicating whether it had an @
+ preceding it, return a synthetic and unique label that the
+ assembler will like. */
+
+tree
+get_cw_asm_label (tree labid)
+{
+ unsigned int n;
+ const char *labname;
+ char *buf;
+ tree newid;
+
+ if (!cw_ha16)
+ {
+ cw_ha16 = get_identifier ("ha16");
+ cw_hi16 = get_identifier ("hi16");
+ cw_lo16 = get_identifier ("lo16");
+ }
+
+ /* lo16(), ha16() and hi16() should be left unmolested. */
+ if (labid == cw_lo16 || labid == cw_ha16 || labid == cw_hi16)
+ return labid;
+
+ for (n = 0; n < VARRAY_ACTIVE_SIZE (cw_asm_labels); ++n)
+ {
+ if (labid == VARRAY_TREE (cw_asm_labels, n))
+ return VARRAY_TREE (cw_asm_labels_uniq, n);
+ }
+ /* Not already seen, make up a label. */
+ VARRAY_PUSH_TREE (cw_asm_labels, labid);
+ buf = (char *) alloca (IDENTIFIER_LENGTH (labid) + 20);
+ sprintf (buf, "LASM%d$", cw_asm_labelno++);
+ /* Assembler won't like a leading @-sign, so make it into a $ if
+ seen. */
+ labname = IDENTIFIER_POINTER (labid);
+ if (*labname == '@')
+ {
+ strcat (buf, "$");
+ ++labname;
+ }
+ strcat (buf, labname);
+ newid = get_identifier (buf);
+ VARRAY_PUSH_TREE (cw_asm_labels_uniq, newid);
+ return newid;
+}
+
+/* The "offset(reg)" in assembly doesn't have an appropriate tree
+ node, so borrow COMPOUND_EXPR and just detect it when emitting the
+ assembly statement. */
+
+tree
+cw_asm_build_register_offset (tree offset, tree regname)
+{
+ tree t;
+
+ t = make_node (COMPOUND_EXPR);
+ /* No type is associated with this construct. */
+ TREE_TYPE (t) = NULL_TREE;
+ TREE_OPERAND (t, 0) = offset;
+ TREE_OPERAND (t, 1) = regname;
+ return t;
+}
+
+/* Given some bits of info from the parser, determine if this is a
+ valid entry statement, and then generate traditional asm statements
+ to create the label. The entry may be either static or extern. */
+tree
+cw_asm_entry (tree keyword, tree scspec, tree fn)
+{
+ int externify = 0;
+ tree stmt, inputs, str, one, strlab;
+
+ /* Validate all the arguments. The keyword arg should be "entry",
+ but we don't make it a reserved word and parse as a plain old
+ identifier, so need to check it here. */
+ if (strcmp (IDENTIFIER_POINTER (keyword), "entry") != 0)
+ {
+ error ("invalid asm entry statement syntax");
+ return error_mark_node;
+ }
+ if (scspec == NULL || strcmp (IDENTIFIER_POINTER (scspec), "extern") == 0)
+ externify = 1;
+ else if (strcmp (IDENTIFIER_POINTER (scspec), "static") == 0)
+ /* accept, but do nothing special */ ;
+ else
+ {
+ error ("entry point storage class much be `static' or `extern'");
+ return error_mark_node;
+ }
+ if (fn == NULL_TREE || TREE_CODE (fn) != FUNCTION_DECL)
+ {
+ error ("entry point not recognized as a function");
+ return error_mark_node;
+ }
+
+ fn = cw_asm_default_function_conversion (fn);
+ str = build_string (1, "s");
+ one = build_tree_list (build_tree_list (NULL_TREE, str), fn);
+ inputs = chainon (NULL_TREE, one);
+
+ if (externify)
+ {
+ strlab = build_string (9, ".globl %0");
+ /* Treat as volatile always. */
+ stmt = build_stmt (ASM_EXPR, strlab, NULL_TREE, inputs, NULL_TREE);
+ ASM_VOLATILE_P (stmt) = 1;
+ stmt = add_stmt (stmt);
+ }
+
+ strlab = build_string (3, "%0:");
+ /* Treat as volatile always. */
+ stmt = build_stmt (ASM_EXPR, strlab, NULL_TREE, inputs, NULL_TREE);
+ ASM_VOLATILE_P (stmt) = 1;
+ stmt = add_stmt (stmt);
+ return stmt;
+}
+/* APPLE LOCAL end CW asm blocks */
+
#include "gt-c-common.h"
diff --git a/gcc/c-common.h b/gcc/c-common.h
index 13377f167fa..b991732bc14 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -26,6 +26,26 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "cpplib.h"
#include "ggc.h"
+/* APPLE LOCAL begin CW asm blocks */
+/* We use a small state machine to inform the lexer when to start
+ returning tokens marking the beginning of each asm line. */
+enum cw_asm_states {
+ /* Normal code. */
+ cw_asm_none,
+ /* '{' of asm block seen, decls may appear. */
+ cw_asm_decls,
+ /* No more decls, in asm block proper, '}' not seen yet. */
+ cw_asm_asm
+};
+
+extern enum cw_asm_states cw_asm_state;
+extern int cw_asm_in_decl;
+extern int cw_asm_block;
+extern int cw_asm_at_bol;
+extern int cw_asm_in_operands;
+extern int cw_asm_labelno;
+/* APPLE LOCAL end CW asm blocks */
+
/* Usage of TREE_LANG_FLAG_?:
0: TREE_NEGATED_INT (in INTEGER_CST).
IDENTIFIER_MARKED (used by search routines).
@@ -56,6 +76,8 @@ enum rid
/* C extensions */
RID_COMPLEX, RID_THREAD,
+ /* APPLE LOCAL private extern */
+ RID_PRIVATE_EXTERN,
/* C++ */
RID_FRIEND, RID_VIRTUAL, RID_EXPLICIT, RID_EXPORT, RID_MUTABLE,
@@ -140,6 +162,8 @@ enum c_tree_index
CTI_WIDEST_UINT_LIT_TYPE,
CTI_CHAR_ARRAY_TYPE,
+ /* APPLE LOCAL pascal strings */
+ CTI_PASCAL_STRING_TYPE, /* for Pascal strings */
CTI_WCHAR_ARRAY_TYPE,
CTI_INT_ARRAY_TYPE,
CTI_STRING_TYPE,
@@ -189,6 +213,8 @@ struct c_common_identifier GTY(())
#define truthvalue_false_node c_global_trees[CTI_TRUTHVALUE_FALSE]
#define char_array_type_node c_global_trees[CTI_CHAR_ARRAY_TYPE]
+/* APPLE LOCAL pascal strings */
+#define pascal_string_type_node c_global_trees[CTI_PASCAL_STRING_TYPE]
#define wchar_array_type_node c_global_trees[CTI_WCHAR_ARRAY_TYPE]
#define int_array_type_node c_global_trees[CTI_INT_ARRAY_TYPE]
#define string_type_node c_global_trees[CTI_STRING_TYPE]
@@ -386,6 +412,13 @@ extern int flag_short_double;
extern int flag_short_wchar;
+/* APPLE LOCAL begin lvalue cast */
+/* Nonzero means allow assignment, increment or decrement of casts of
+ lvalues (e.g., '((foo *)p)++') if both the lvalue and its cast are
+ of POD type with identical size and alignment. */
+extern int flag_lvalue_cast_assign;
+/* APPLE LOCAL end lvalue cast */
+
/* Nonzero means allow Microsoft extensions without warnings or errors. */
extern int flag_ms_extensions;
@@ -393,6 +426,12 @@ extern int flag_ms_extensions;
extern int flag_no_asm;
+/* APPLE LOCAL begin CW asm blocks */
+/* Nonzero means that CodeWarrior-style inline assembler is to be parsed. */
+
+extern int flag_cw_asm_blocks;
+/* APPLE LOCAL end CW asm blocks */
+
/* Nonzero means give string constants the type `const char *', as mandated
by the standard. */
@@ -416,6 +455,12 @@ extern int warn_unknown_pragmas; /* Tri state variable. */
extern int warn_format;
+/* APPLE LOCAL begin disable_typechecking_for_spec_flag */
+/* This makes type conflicts a warning, instead of an error,
+ to work around some problems with SPEC. */
+
+extern int disable_typechecking_for_spec_flag;
+/* APPLE LOCAL end disable_typechecking_for_spec_flag */
/* C/ObjC language option variables. */
@@ -454,6 +499,13 @@ extern int flag_gen_declaration;
extern int flag_next_runtime;
+/* APPLE LOCAL begin ObjC C++ ivars */
+/* Generate special '- .cxx_construct' and '- .cxx_destruct' methods
+ to initialize any non-POD ivars in ObjC++ classes. */
+
+extern int flag_objc_call_cxx_cdtors;
+/* APPLE LOCAL end ObjC C++ ivars */
+
/* Tells the compiler that this is a special run. Do not perform any
compiling, instead we are to test some platform dependent features
and output a C header file with appropriate definitions. */
@@ -566,6 +618,26 @@ extern int flag_permissive;
extern int flag_enforce_eh_specs;
+/* APPLE LOCAL KEXT */
+extern int flag_apple_kext;
+
+/* APPLE LOCAL begin structor thunks */
+/* Nonzero if we prefer to clone con/de/structors.
+ Alternative is to gen multiple tiny thunk-esque things that
+ call/jump to a unified con/de/structor. This is a classic
+ size/speed tradeoff. */
+extern int flag_clone_structors;
+/* APPLE LOCAL end structor thunks */
+
+/* APPLE LOCAL begin private extern Radar 2872481 --ilr */
+/* Nonzero if -fpreprocessed specified. This is needed by init_reswords()
+ so that it can make __private_extern__ have the same rid code as extern
+ when -fpreprocessed is specified. Normally there is a -D on the command
+ line for this. But if -fpreprocessed was specified then macros aren't
+ expanded. So we fake the token value out using the rid code. */
+extern int flag_preprocessed;
+/* APPLE LOCAL end private extern Radar 2872481 --ilr */
+
/* Nonzero (the default) means to generate thread-safe code for
initializing local statics. */
@@ -689,6 +761,10 @@ extern int self_promoting_args_p (tree);
extern tree strip_array_types (tree);
extern tree strip_pointer_operator (tree);
+/* APPLE LOCAL begin IMA built-in decl merging fix (radar 3645899) */
+extern bool builtin_function_disabled_p (const char *);
+/* APPLE LOCAL end */
+
/* This is the basic parsing function. */
extern void c_parse_file (void);
/* This is misnamed, it actually performs end-of-compilation processing. */
@@ -885,7 +961,8 @@ enum lvalue_use {
lv_asm
};
-extern int lvalue_or_else (tree, enum lvalue_use);
+/* APPLE LOCAL non-lvalue assign */
+extern int lvalue_or_else (tree *, enum lvalue_use);
/* In c-gimplify.c */
extern void c_genericize (tree);
@@ -951,13 +1028,17 @@ extern void objc_add_instance_variable (tree);
extern tree objc_build_keyword_decl (tree, tree, tree);
extern tree objc_build_throw_stmt (tree);
extern void objc_begin_try_stmt (location_t, tree);
-extern void objc_finish_try_stmt (void);
+/* APPLE LOCAL Objective-C++ */
+extern tree objc_finish_try_stmt (void);
extern void objc_begin_catch_clause (tree);
extern void objc_finish_catch_clause (void);
extern void objc_build_finally_clause (location_t, tree);
-extern void objc_build_synchronized (location_t, tree, tree);
+/* APPLE LOCAL Objective-C++ */
+extern tree objc_build_synchronized (location_t, tree, tree);
extern int objc_static_init_needed_p (void);
extern tree objc_generate_static_init_call (tree);
+/* APPLE LOCAL ObjC GC */
+extern tree objc_generate_write_barrier (tree, enum tree_code, tree);
/* The following are provided by the C and C++ front-ends, and called by
ObjC/ObjC++. */
@@ -970,4 +1051,24 @@ extern void preprocess_file (cpp_reader *);
extern void pp_file_change (const struct line_map *);
extern void pp_dir_change (cpp_reader *, const char *);
+/* APPLE LOCAL begin CW asm blocks */
+extern tree cw_asm_stmt (tree, tree, int);
+extern tree cw_asm_build_register_offset (tree, tree);
+extern tree cw_asm_label (tree, int);
+extern tree prepend_char_identifier (tree, char);
+extern void clear_cw_asm_labels (void);
+extern tree cw_asm_reg_name (tree);
+extern tree get_cw_asm_label (tree);
+extern tree cw_asm_entry (tree, tree, tree);
+extern int cw_asm_typename_or_reserved (tree);
+extern tree cw_asm_c_build_component_ref (tree, tree);
+extern tree cw_get_identifier (tree, const char *);
+/* APPLE LOCAL end CW asm blocks */
+
+/* APPLE LOCAL begin AltiVec */
+/* The following function will convert expressions into
+ vector initializers. */
+extern tree vector_constructor_from_expr (tree, tree);
+/* APPLE LOCAL end AltiVec */
+
#endif /* ! GCC_C_COMMON_H */
diff --git a/gcc/c-convert.c b/gcc/c-convert.c
index 3067137c372..2d422679d5b 100644
--- a/gcc/c-convert.c
+++ b/gcc/c-convert.c
@@ -33,6 +33,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "flags.h"
#include "convert.h"
#include "c-common.h"
+/* APPLE LOCAL begin IMA aggregate types */
+#include "c-tree.h"
+/* APPLE LOCAL end IMA aggregate types */
#include "langhooks.h"
#include "toplev.h"
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 06904dbb5e5..54a44f390af 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -294,6 +294,32 @@ define__GNUC__ (void)
builtin_define_with_value_n ("__GNUC_PATCHLEVEL__", "0", 1);
gcc_assert (!*v || *v == ' ' || *v == '-');
+
+ /* APPLE LOCAL begin Apple version */
+ {
+ /* This chunk of code defines __APPLE_CC__ from the version
+ string. It expects to see a substring of the version string of
+ the form "build NNNN)", where each N is a digit, and the first
+ N is nonzero (there can be 4 or 5 digits). It will abort() if
+ these conditions are not met, since that usually means that
+ someone's broken the version string. */
+ const char *vt;
+
+ vt = strstr (version_string, "build ");
+ if (vt == NULL)
+ abort ();
+ vt += strlen ("build ");
+ if (! ISDIGIT (*vt))
+ abort ();
+ for (q = vt; *q != 0 && ISDIGIT (*q); q++)
+ ;
+ if (q == vt || *q != ')')
+ abort ();
+ if ((q - vt != 4 && q - vt != 5) || *vt == '0')
+ abort ();
+ builtin_define_with_value_n ("__APPLE_CC__", vt, q - vt);
+ }
+ /* APPLE LOCAL end Apple version */
}
/* Define macros used by <stdint.h>. Currently only defines limits
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 0b7b97ede23..a126039325d 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -225,17 +225,8 @@ struct c_binding GTY((chain_next ("%h.prev")))
#define I_LABEL_DECL(node) \
(I_LABEL_BINDING(node) ? I_LABEL_BINDING(node)->decl : 0)
-/* Each C symbol points to three linked lists of c_binding structures.
- These describe the values of the identifier in the three different
- namespaces defined by the language. */
-
-struct lang_identifier GTY(())
-{
- struct c_common_identifier common_id;
- struct c_binding *symbol_binding; /* vars, funcs, constants, typedefs */
- struct c_binding *tag_binding; /* struct/union/enum tags */
- struct c_binding *label_binding; /* labels */
-};
+/* APPLE LOCAL objc speedup --dpatel */
+/* Definition of 'struct lang_identifier' moved to c-tree.h. */
/* Validate c-lang.c's assumptions. */
extern char C_SIZEOF_STRUCT_LANG_IDENTIFIER_isnt_accurate
@@ -414,10 +405,17 @@ static void layout_array_type (tree);
with __attribute__((deprecated)). An object declared as
__attribute__((deprecated)) suppresses warnings of uses of other
deprecated items. */
+/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+/* Also add an __attribute__((unavailable)). An object declared as
+ __attribute__((unavailable)) suppresses any reports of being
+ declared with unavailable or deprecated items. */
+/* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
enum deprecated_states {
DEPRECATED_NORMAL,
DEPRECATED_SUPPRESS
+ /* APPLE LOCAL "unavailable" attribute (radar 2809697) */
+ , DEPRECATED_UNAVAILABLE_SUPPRESS
};
static enum deprecated_states deprecated_state = DEPRECATED_NORMAL;
@@ -1228,12 +1226,68 @@ diagnose_mismatched_decls (tree newdecl, tree olddecl,
}
else
{
+ /* APPLE LOCAL begin disable typechecking for SPEC --dbj */
+ /* Accept incompatible function declarations, and incompatible
+ global variables provided they are in different files.
+ (Would be nice to check this for functions also, but
+ context is not set for them.) */
+ void (*err) (const char*, ...);
+ if (disable_typechecking_for_spec_flag
+ && TREE_PUBLIC (olddecl)
+ && TREE_PUBLIC (newdecl)
+ && ((TREE_CODE (olddecl) == VAR_DECL
+ && TREE_CODE (newdecl) == VAR_DECL
+ && !same_translation_unit_p (olddecl, newdecl))
+ || (TREE_CODE (olddecl) == FUNCTION_DECL
+ && TREE_CODE (newdecl) == FUNCTION_DECL)))
+ err = warning;
+ else
+ err = error;
if (TYPE_QUALS (newtype) != TYPE_QUALS (oldtype))
- error ("%J conflicting type qualifiers for %qD", newdecl, newdecl);
+ err ("%J conflicting type qualifiers for %qD", newdecl, newdecl);
else
- error ("%Jconflicting types for %qD", newdecl, newdecl);
+ err ("%Jconflicting types for %qD", newdecl, newdecl);
diagnose_arglist_conflict (newdecl, olddecl, newtype, oldtype);
- locate_old_decl (olddecl, error);
+ locate_old_decl (olddecl, *err);
+ /* In the case where we're being lenient, two trees will
+ continue to exist, which represent the same variable.
+ These are currently never used in the same function, but
+ watch out for inlining. */
+ if (err == warning
+ && TREE_CODE (olddecl) == VAR_DECL)
+ {
+ HOST_WIDE_INT newalias;
+ /* To prevent aliasing problems,
+ make both of them have the same alias class right now. */
+ if (TYPE_ALIAS_SET_KNOWN_P (oldtype))
+ {
+ newalias = TYPE_ALIAS_SET (oldtype);
+ if (TYPE_ALIAS_SET_KNOWN_P (newtype)
+ && newalias != TYPE_ALIAS_SET (oldtype))
+ internal_error ("%Jalias set conflict for '%D'",
+ newdecl, newdecl);
+ }
+ else if (TYPE_ALIAS_SET_KNOWN_P (newtype))
+ newalias = TYPE_ALIAS_SET (newtype);
+ else
+ newalias = new_alias_set ();
+ TYPE_ALIAS_SET (oldtype) = newalias;
+ TYPE_ALIAS_SET (newtype) = newalias;
+ /* Set a marker bit so that only one of them gets emitted
+ to the output file. I think this only matters if the
+ sizes are different, in which case we must emit the larger.
+ If a size is unknown, we can mark that one. */
+ if (!DECL_SIZE (newdecl))
+ DECL_DUPLICATE_DECL (newdecl) = 1;
+ else if (!DECL_SIZE (olddecl))
+ DECL_DUPLICATE_DECL (olddecl) = 1;
+ else if (tree_int_cst_lt (DECL_SIZE (newdecl),
+ DECL_SIZE (olddecl)))
+ DECL_DUPLICATE_DECL (newdecl) = 1;
+ else
+ DECL_DUPLICATE_DECL (olddecl) = 1;
+ }
+ /* APPLE LOCAL end disable typechecking for SPEC --dbj */
return false;
}
}
@@ -1646,6 +1700,12 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
if (TREE_DEPRECATED (newdecl))
TREE_DEPRECATED (olddecl) = 1;
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ /* Merge unavailableness. */
+ if (TREE_UNAVAILABLE (newdecl))
+ TREE_UNAVAILABLE (olddecl) = 1;
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
+
/* Keep source location of definition rather than declaration. */
if (DECL_INITIAL (newdecl) == 0 && DECL_INITIAL (olddecl) != 0)
DECL_SOURCE_LOCATION (newdecl) = DECL_SOURCE_LOCATION (olddecl);
@@ -2252,7 +2312,8 @@ implicitly_declare (tree functionid)
implicit_decl_warning (functionid, decl);
C_DECL_IMPLICIT (decl) = 1;
}
- if (DECL_BUILT_IN (decl))
+ /* APPLE LOCAL disable typechecking for SPEC --dbj */
+ if (DECL_BUILT_IN (decl) || disable_typechecking_for_spec_flag)
{
newtype = build_type_attribute_variant (newtype,
TYPE_ATTRIBUTES
@@ -2703,7 +2764,17 @@ builtin_function (const char *name, tree type, int function_code,
/* Builtins in the implementation namespace are made visible without
needing to be explicitly declared. See push_file_scope. */
- if (name[0] == '_' && (name[1] == '_' || ISUPPER (name[1])))
+ /* APPLE LOCAL begin AltiVec */
+ if ((name[0] == '_' && (name[1] == '_' || ISUPPER (name[1])))
+#ifdef TARGET_POWERPC
+ /* AltiVec PIM builtins, even though they do not begin with
+ underscores, need not be declared either. */
+ || (cl == BUILT_IN_MD
+ && function_code >= ALTIVEC_PIM__FIRST
+ && function_code <= ALTIVEC_PIM__LAST)
+#endif /* TARGET_POWERPC */
+ )
+ /* APPLE LOCAL end AltiVec */
{
TREE_CHAIN (decl) = visible_builtins;
visible_builtins = decl;
@@ -2990,8 +3061,37 @@ start_decl (struct c_declarator *declarator, struct c_declspecs *declspecs,
/* An object declared as __attribute__((deprecated)) suppresses
warnings of uses of other deprecated items. */
+
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ /* An object declared as __attribute__((unavailable)) suppresses
+ any reports of being declared with unavailable or deprecated
+ items. An object declared as __attribute__((deprecated))
+ suppresses warnings of uses of other deprecated items. */
+#ifdef A_LESS_INEFFICENT_WAY /* which I really don't want to do! */
if (lookup_attribute ("deprecated", attributes))
deprecated_state = DEPRECATED_SUPPRESS;
+ else if (lookup_attribute ("unavailable", attributes))
+ deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS;
+#else /* a more efficient way doing what lookup_attribute would do */
+ tree a;
+
+ for (a = attributes; a; a = TREE_CHAIN (a))
+ {
+ tree name = TREE_PURPOSE (a);
+ if (TREE_CODE (name) == IDENTIFIER_NODE)
+ if (is_attribute_p ("deprecated", name))
+ {
+ deprecated_state = DEPRECATED_SUPPRESS;
+ break;
+ }
+ if (is_attribute_p ("unavailable", name))
+ {
+ deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS;
+ break;
+ }
+ }
+#endif
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
decl = grokdeclarator (declarator, declspecs,
NORMAL, initialized, NULL);
@@ -3816,6 +3916,11 @@ grokdeclarator (const struct c_declarator *declarator,
if (decl_context == NORMAL && !funcdef_flag && current_scope->parm_flag)
decl_context = PARM;
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ if (declspecs->unavailable_p)
+ warn_unavailable_use (declspecs->type);
+ else
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
if (declspecs->deprecated_p && deprecated_state != DEPRECATED_SUPPRESS)
warn_deprecated_use (declspecs->type);
@@ -3922,6 +4027,8 @@ grokdeclarator (const struct c_declarator *declarator,
}
else if (storage_class == csc_extern
&& initialized
+ /* APPLE LOCAL private extern */
+ && !declspecs->private_extern_p
&& !funcdef_flag)
{
/* 'extern' with initialization is invalid if not at file scope. */
@@ -4528,6 +4635,14 @@ grokdeclarator (const struct c_declarator *declarator,
if (declspecs->default_int_p)
C_FUNCTION_IMPLICIT_INT (decl) = 1;
+ /* APPLE LOCAL begin private extern */
+ if (declspecs->private_extern_p)
+ {
+ DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
+ DECL_VISIBILITY_SPECIFIED (decl) = 1;
+ }
+ /* APPLE LOCAL end private extern */
+
/* Record presence of `inline', if it is reasonable. */
if (flag_hosted && MAIN_NAME_P (declarator->u.id))
{
@@ -4595,6 +4710,14 @@ grokdeclarator (const struct c_declarator *declarator,
reset later in start_decl. */
DECL_EXTERNAL (decl) = (storage_class == csc_extern);
+ /* APPLE LOCAL begin private extern */
+ if (declspecs->private_extern_p)
+ {
+ DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
+ DECL_VISIBILITY_SPECIFIED (decl) = 1;
+ }
+ /* APPLE LOCAL end private extern */
+
/* At file scope, the presence of a `static' or `register' storage
class specifier, or the absence of all storage class specifiers
makes this declaration a definition (perhaps tentative). Also,
@@ -4632,6 +4755,21 @@ grokdeclarator (const struct c_declarator *declarator,
DECL_REGISTER (decl) = 1;
}
+ /* APPLE LOCAL begin CW asm blocks */
+ if (declspecs->cw_asm_specbit)
+ {
+ /* Record that this is a decl of a CW-style asm function. */
+ if (flag_cw_asm_blocks)
+ {
+ DECL_CW_ASM_FUNCTION (decl) = 1;
+ DECL_CW_ASM_NORETURN (decl) = 0;
+ DECL_CW_ASM_FRAME_SIZE (decl) = -2;
+ }
+ else
+ error ("asm functions not enabled, use `-fasm-blocks'");
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
/* Record constancy and volatility. */
c_apply_type_quals_to_decl (type_quals, decl);
@@ -5909,6 +6047,16 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
DECL_IGNORED_P (resdecl) = 1;
DECL_RESULT (current_function_decl) = resdecl;
+ /* APPLE LOCAL begin CW asm blocks */
+ /* If this was a function declared as an assembly function, change
+ the state to expect to see C decls, possibly followed by assembly
+ code. */
+ if (DECL_CW_ASM_FUNCTION (current_function_decl))
+ {
+ cw_asm_state = cw_asm_decls;
+ cw_asm_in_decl = 0;
+ }
+ /* APPLE LOCAL end CW asm blocks */
start_fname_decls ();
return 1;
@@ -6751,6 +6899,8 @@ build_null_declspecs (void)
ret->tag_defined_p = false;
ret->explicit_signed_p = false;
ret->deprecated_p = false;
+ /* APPLE LOCAL "unavailable" attribute (radar 2809697) */
+ ret->unavailable_p = false;
ret->default_int_p = false;
ret->long_p = false;
ret->long_long_p = false;
@@ -6763,6 +6913,10 @@ build_null_declspecs (void)
ret->const_p = false;
ret->volatile_p = false;
ret->restrict_p = false;
+ /* APPLE LOCAL CW asm blocks */
+ ret->cw_asm_specbit = false;
+ /* APPLE LOCAL private extern */
+ ret->private_extern_p = false;
return ret;
}
@@ -6811,6 +6965,11 @@ declspecs_add_type (struct c_declspecs *specs, struct c_typespec spec)
if (TREE_DEPRECATED (type))
specs->deprecated_p = true;
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ if (TREE_UNAVAILABLE (type))
+ specs->unavailable_p = true;
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
+
/* Handle type specifier keywords. */
if (TREE_CODE (type) == IDENTIFIER_NODE && C_IS_RESERVED_WORD (type))
{
@@ -7110,6 +7269,12 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec)
IDENTIFIER_POINTER (scspec));
switch (i)
{
+ /* APPLE LOCAL begin CW asm blocks */
+ case RID_ASM:
+ dupe = specs->cw_asm_specbit;
+ specs->cw_asm_specbit = true;
+ break;
+ /* APPLE LOCAL end CW asm blocks */
case RID_INLINE:
/* C99 permits duplicate inline. Although of doubtful utility,
it seems simplest to permit it in gnu89 mode as well, as
@@ -7138,6 +7303,15 @@ declspecs_add_scspec (struct c_declspecs *specs, tree scspec)
if (specs->thread_p)
error ("%<__thread%> before %<extern%>");
break;
+ /* APPLE LOCAL begin private extern */
+ case RID_PRIVATE_EXTERN:
+ specs->private_extern_p = true;
+ n = csc_extern;
+ /* Diagnose "__thread extern". */
+ if (specs->thread_p)
+ error ("%<__thread%> before %<private_extern%>");
+ break;
+ /* APPLE LOCAL end private extern */
case RID_REGISTER:
n = csc_register;
break;
@@ -7415,4 +7589,21 @@ c_write_global_declarations (void)
cgraph_optimize ();
}
+/* APPLE LOCAL begin CW asm blocks */
+/* Look for a struct or union tag, but quietly; don't complain if neither
+ is found, and don't autocreate. Used to identify struct/union tags
+ mentioned in CW asm operands. */
+tree
+lookup_struct_or_union_tag (tree typename)
+{
+ tree rslt = lookup_tag (RECORD_TYPE, typename, 0);
+
+ pending_invalid_xref = 0;
+ if (!rslt)
+ rslt = lookup_tag (UNION_TYPE, typename, 0);
+ pending_invalid_xref = 0;
+ return rslt;
+}
+/* APPLE LOCAL end CW asm blocks */
+
#include "gt-c-decl.h"
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c
index 62680bda14a..5896349f679 100644
--- a/gcc/c-incpath.c
+++ b/gcc/c-incpath.c
@@ -29,6 +29,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "intl.h"
#include "c-incpath.h"
#include "cppdefault.h"
+/* APPLE LOCAL headermaps 3871393 */
+#include "errors.h"
/* Windows does not natively support inodes, and neither does MSDOS.
Cygwin's emulation can generate non-unique inodes, so don't use it.
@@ -165,6 +167,168 @@ add_standard_paths (const char *sysroot, const char *iprefix, int cxx_stdinc)
}
}
+
+/* APPLE LOCAL begin headermaps 3871393 */
+/* Private function that hashes the contents of the null-terminated
+ string in a case-insensitive way. For use by headermaps only. */
+
+static inline
+uint32 hmap_hash_string (const char *str)
+{
+ const char *sp;
+ unsigned hash_code = 0;
+
+ for (sp = str; *sp; sp++)
+ hash_code += TOLOWER (*(const unsigned char *)sp) * 13;
+ return hash_code;
+}
+
+/* Private function that case-insensitively compares the null-
+ terminated string STR1 with the null-terminated string STR2.
+ Returns 1 if equal, 0 if not. For use by headermaps only. */
+
+static inline unsigned
+hmap_compare_strings (const char *str1, const char *str2)
+{
+ const char *s1p;
+ const char *s2p;
+
+ for (s1p = str1, s2p = str2; *s1p && *s2p; s1p++, s2p++)
+ {
+ if (TOLOWER (*s1p) != TOLOWER (*s2p))
+ return 0;
+ }
+ return (*s1p == '\0' && *s2p == '\0');
+}
+
+/* Attempts to load a headermap from the file at path FILEPATH, and
+ returns a pointer to the loaded data. Returns NULL if for any
+ reason the headermap cannot be loaded. This function is silent if
+ the given file does not appear to be a headermap; this is useful
+ for checking whether or not it in fact is. */
+
+static struct hmap_header_map *
+hmap_load_header_map (const char *filepath)
+{
+ struct hmap_header_map *headermap = NULL;
+
+ if (filepath != NULL && filepath[0] != '\0')
+ {
+ FILE * f;
+ struct stat f_info;
+
+ /* Try to open the file for reading. */
+ f = fopen (filepath, "rb");
+ if (f != NULL)
+ {
+ /* If it is a regular file and if it is large enough to be a header-
+ map, see if it really is one. */
+ if (fstat (fileno (f), &f_info) == 0 && S_ISREG(f_info.st_mode)
+ && f_info.st_size >= sizeof(struct hmap_header_map))
+ {
+ unsigned headermap_size = f_info.st_size;
+
+ headermap = (struct hmap_header_map *) xmalloc (headermap_size);
+ if (fread (headermap, 1, headermap_size, f) != headermap_size)
+ {
+ /* For some reason we could not read the entire file. */
+ fprintf (stderr,
+ "warning: could not read \"%s\" (%s)\n",
+ filepath, xstrerror (errno));
+ free (headermap);
+ headermap = NULL;
+ }
+ if (headermap->version == 1 && headermap->_reserved == 0)
+ {
+ /* It might be a headermap. */
+ if (headermap->magic == HMAP_OPPOSITE_ENDIANNESS_MAGIC)
+ {
+ /* It's a headermap, but has the wrong endianness. */
+ fprintf (stderr,
+ "warning: headermap \"%s\" has incompatible endianness\n",
+ filepath);
+ free (headermap);
+ headermap = NULL;
+ }
+ else if (headermap->magic != HMAP_SAME_ENDIANNESS_MAGIC)
+ {
+ /* It's not a headermap after all. */
+ free (headermap);
+ headermap = NULL;
+ }
+ }
+ else
+ {
+ /* It's not a headermap after all. */
+ free (headermap);
+ headermap = NULL;
+ }
+ }
+ fclose (f);
+ }
+ }
+ return headermap;
+}
+
+/* Returns a pointer to a malloced string that contains the real pathname
+ to the file, given the DIR that represents the headermap and given the
+ name to be looked up. This function looks in the headermap associated
+ with DIR, if any. If there is no headermap associated with DIR, or if
+ it does not contain FILENAME, this function returns NULL. The CONSTRUCT
+ field of a cpp_dir that represents a headermap points to this function. */
+
+static char *
+hmap_construct_pathname (const char *filename, cpp_dir *dir)
+{
+ if (dir->header_map)
+ {
+ struct hmap_header_map *headermap;
+ const char *strings;
+ struct hmap_bucket *buckets;
+ uint32 bucket_mask;
+ uint32 i;
+ uint32 key_offset;
+
+ headermap = (struct hmap_header_map *)dir->header_map;
+ strings = ((const char *)headermap) + headermap->strings_offset;
+ buckets = headermap->buckets;
+ bucket_mask = headermap->capacity-1;
+ i = hmap_hash_string (filename) & bucket_mask;
+ while ((key_offset = buckets[i].key) != HMAP_NOT_A_KEY)
+ {
+ if (hmap_compare_strings (filename, strings+key_offset))
+ {
+ char *result_path;
+ unsigned prefix_length;
+ unsigned suffix_length;
+
+ if (strcmp (filename, strings+key_offset) != 0)
+ warning ("mismatched case in filenames, wanted \"%s\" but found \"%s\"",
+ filename, strings+key_offset);
+
+ prefix_length = strlen(strings + buckets[i].value.prefix);
+ suffix_length = strlen(strings + buckets[i].value.suffix);
+ result_path = xmalloc(prefix_length + suffix_length + 1);
+ memcpy(result_path,
+ strings + buckets[i].value.prefix,
+ prefix_length);
+ memcpy(result_path + prefix_length,
+ strings + buckets[i].value.suffix,
+ suffix_length);
+ result_path[prefix_length + suffix_length] = '\0';
+ return result_path;
+ }
+ i = (i + 1) & bucket_mask;
+ }
+ /* didn't find header in header map -- return NULL. */
+ return NULL;
+ }
+ else
+ return NULL;
+}
+/* APPLE LOCAL end headermaps 3871393 */
+
+
/* For each duplicate path in chain HEAD, keep just the first one.
Remove each path in chain HEAD that also exists in chain SYSTEM.
Set the NEXT pointer of the last path in the resulting chain to
@@ -201,8 +365,35 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
}
}
else if (!S_ISDIR (st.st_mode))
- cpp_error_with_line (pfile, CPP_DL_ERROR, 0, 0,
- "%s: not a directory", cur->name);
+ /* APPLE LOCAL begin headermaps 3871393 */
+ {
+ /* Only check for headermap if this is a regular file and if there
+ is no path-constructor function in CUR. */
+ if (S_ISREG (st.st_mode) && !cur->construct)
+ {
+ /* Try to load the file as a headermap. We will get back NULL
+ if this fails, and there won't be any warnings/errors emitted
+ unless the load function is fairly sure it's dealing with a
+ headermap file that is malformed. */
+ struct hmap_header_map *header_map;
+
+ header_map = hmap_load_header_map (cur->name);
+ if (header_map)
+ {
+ /* Successfully loaded a headermap. Store a pointer to it
+ and set up the construct function pointer in cur. */
+ cur->header_map = header_map;
+ cur->construct = hmap_construct_pathname;
+ pcur = &cur->next;
+ continue;
+ }
+ }
+
+ /* If we fall through to here, it's some other kind of file. */
+ cpp_error_with_line (pfile, CPP_DL_ERROR, 0, 0,
+ "%s: not a directory", cur->name);
+ }
+ /* APPLE LOCAL end headermaps 3871393 */
else
{
INO_T_COPY (cur->ino, st.st_ino);
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index f5425ce49e9..e1c23f1e9bd 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -40,6 +40,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm_p.h"
#include "splay-tree.h"
#include "debug.h"
+/* APPLE LOCAL AltiVec */
+#include "../libcpp/internal.h"
/* We may keep statistics about how long which files took to compile. */
static int header_time, body_time;
@@ -64,6 +66,18 @@ int c_lex_string_translate = 1;
unmolested (no concatenation, no translation). */
bool c_lex_return_raw_strings = false;
+/* APPLE LOCAL begin CW asm blocks */
+/* This points to the token that we're going to save briefly while
+ returning EOL/BOL tokens. (This is global but static instead
+ static in c_lex() so as to avoid pointless init in non-asm
+ case.) */
+static const cpp_token *cw_asm_saved_token = NULL;
+/* This tracks recursion in c_lex calls. Lexer recursion can happen
+ in pragma processing for instance, but we don't any of the asm
+ special handling to be active then. */
+static int c_lex_depth;
+/* APPLE LOCAL end CW asm blocks */
+
static tree interpret_integer (const cpp_token *, unsigned int);
static tree interpret_float (const cpp_token *, unsigned int);
static enum integer_type_kind narrowest_unsigned_type
@@ -188,7 +202,8 @@ cb_ident (cpp_reader * ARG_UNUSED (pfile),
{
/* Convert escapes in the string. */
cpp_string cstr = { 0, 0 };
- if (cpp_interpret_string (pfile, str, 1, &cstr, false))
+ /* APPLE LOCAL pascal strings */
+ if (cpp_interpret_string (pfile, str, 1, &cstr, false, false))
{
ASM_OUTPUT_IDENT (asm_out_file, (const char *) cstr.text);
free ((void *) cstr.text);
@@ -337,12 +352,101 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
static bool no_more_pch;
const cpp_token *tok;
enum cpp_ttype type;
+ /* APPLE LOCAL CW asm blocks C++ */
+ const cpp_token *lasttok;
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Make a local copy of the flag for efficiency, since the compiler can't
+ figure that it won't change during a compilation. */
+ int flag_cw_asm_blocks_local = flag_cw_asm_blocks;
+ if (flag_cw_asm_blocks_local)
+ ++c_lex_depth;
+ /* APPLE LOCAL end CW asm blocks */
timevar_push (TV_CPP);
retry:
+ /* APPLE LOCAL begin CW asm blocks */
+ if (cw_asm_at_bol)
+ {
+ cw_asm_at_bol = 0;
+ --c_lex_depth;
+ timevar_pop (TV_CPP);
+ return CPP_BOL;
+ }
+ /* If there's a token we saved while returning the special BOL
+ token, return it now. */
+ if (cw_asm_saved_token)
+ {
+ tok = cw_asm_saved_token;
+ type = tok->type;
+ cw_asm_saved_token = NULL;
+ goto bypass;
+ }
+ /* APPLE LOCAL end CW asm blocks */
tok = cpp_get_token (parse_in);
type = tok->type;
+ /* APPLE LOCAL begin CW asm blocks */
+ /* This test should be as efficient as possible, because it affects
+ all lexing with or without CW asm enabled. */
+ if (flag_cw_asm_blocks_local && cw_asm_state != cw_asm_none && c_lex_depth == 1
+ && type != CPP_PADDING)
+ {
+ /* "}" switches us out of our special mode. */
+ if (tok->type == CPP_CLOSE_BRACE && cw_asm_state >= cw_asm_decls)
+ {
+ cw_asm_state = cw_asm_none;
+ cw_asm_saved_token = tok;
+ cw_asm_at_bol = 0;
+ --c_lex_depth;
+ timevar_pop (TV_CPP);
+ return CPP_EOL;
+ }
+
+ /* This is tricky. We're only ready to start parsing assembly
+ instructions if we're in the asm block, we're not in the
+ middle of parsing a C decl, and the next token is plausibly
+ the beginning of an asm line. This works because if we have
+ a "typedef int nop", a nop at the beginning of a line should
+ be taken as an instruction rather than a declaration of type
+ nop. (Doesn't have to go this way, but it's how CW works.)
+ We're not quite as good as CW yet, because CW knows about the
+ complete list of valid opcodes, and will try to take anything
+ as a decl that is not in the opcode list. */
+ if (cw_asm_state == cw_asm_decls
+ && !cw_asm_in_decl)
+ {
+ if ((tok->flags & BOL)
+ && (tok->type == CPP_ATSIGN
+ || tok->type == CPP_DOT
+ || (tok->type == CPP_NAME
+ && (*value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node)))
+ && !cw_asm_typename_or_reserved (*value))))
+ {
+ cw_asm_state = cw_asm_asm;
+ cw_asm_block = 1;
+ cw_asm_at_bol = 1;
+ clear_cw_asm_labels ();
+ }
+ else
+ {
+ cw_asm_in_decl = 1;
+ }
+ }
+ /* If we're in the asm block, save the token at the beginning of the
+ line and return a beginning-of-line token instead. */
+ if (cw_asm_state == cw_asm_asm && (tok->flags & BOL))
+ {
+ cw_asm_saved_token = tok;
+ cw_asm_at_bol = !cw_asm_at_bol;
+ --c_lex_depth;
+ /* In between lines, return first the EOL. */
+ timevar_pop (TV_CPP);
+ return (cw_asm_at_bol ? CPP_EOL : CPP_BOL);
+ }
+ }
+ bypass:
+ /* APPLE LOCAL end CW asm blocks */
+
retry_after_at:
switch (type)
{
@@ -379,6 +483,16 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
break;
case CPP_ATSIGN:
+ /* APPLE LOCAL begin CW asm blocks */
+ if (cw_asm_state >= cw_asm_decls)
+ {
+ /* Return the @-sign verbatim. */
+ *value = NULL_TREE;
+ break;
+ }
+ lasttok = tok;
+ /* APPLE LOCAL end CW asm blocks */
+
/* An @ may give the next token special significance in Objective-C. */
if (c_dialect_objc ())
{
@@ -394,6 +508,10 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
case CPP_STRING:
case CPP_WSTRING:
+ /* APPLE LOCAL begin CW asm blocks */
+ if (flag_cw_asm_blocks_local)
+ --c_lex_depth;
+ /* APPLE LOCAL end CW asm blocks */
type = lex_string (tok, value, true);
break;
@@ -401,19 +519,51 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
*value = HT_IDENT_TO_GCC_IDENT (HT_NODE (tok->val.node));
if (objc_is_reserved_word (*value))
{
+ /* APPLE LOCAL begin CW asm blocks */
+ if (flag_cw_asm_blocks_local)
+ --c_lex_depth;
+ /* APPLE LOCAL end CW asm blocks */
type = CPP_AT_NAME;
break;
}
/* FALLTHROUGH */
default:
+ /* APPLE LOCAL begin CW asm blocks C++ */
+ if (flag_cw_asm_blocks_local)
+ {
+ /* This is necessary for C++, as we don't have the tight
+ integration between the lexer and the parser... */
+ cw_asm_saved_token = tok;
+ /* Return the @-sign verbatim. */
+ *value = NULL;
+ tok = lasttok;
+ break;
+ }
+ /* APPLE LOCAL end CW asm blocks C++ */
+
/* ... or not. */
error ("%Hstray %<@%> in program", &atloc);
goto retry_after_at;
}
break;
}
-
+ /* APPLE LOCAL begin CW asm blocks C++ */
+ if (flag_cw_asm_blocks_local)
+ {
+ do
+ tok = cpp_get_token (parse_in);
+ while (tok->type == CPP_PADDING);
+ /* This is necessary for C++, as we don't have the tight
+ integration between the lexer and the parser... */
+ cw_asm_saved_token = tok;
+ /* Return the @-sign verbatim. */
+ *value = NULL;
+ tok = lasttok;
+ break;
+ }
+ /* APPLE LOCAL end CW asm blocks C++ */
+
/* FALLTHROUGH */
case CPP_HASH:
case CPP_PASTE:
@@ -449,6 +599,10 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
case CPP_WSTRING:
if (!c_lex_return_raw_strings)
{
+ /* APPLE LOCAL begin CW asm blocks */
+ if (flag_cw_asm_blocks_local)
+ --c_lex_depth;
+ /* APPLE LOCAL end CW asm blocks */
type = lex_string (tok, value, false);
break;
}
@@ -473,6 +627,11 @@ c_lex_with_flags (tree *value, unsigned char *cpp_flags)
if (cpp_flags)
*cpp_flags = tok->flags;
+ /* APPLE LOCAL begin CW asm blocks */
+ if (flag_cw_asm_blocks_local)
+ --c_lex_depth;
+ /* APPLE LOCAL end CW asm blocks */
+
if (!no_more_pch)
{
no_more_pch = true;
@@ -713,6 +872,8 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
tree value;
bool wide = false;
size_t concats = 0;
+ /* APPLE LOCAL pascal strings */
+ bool pascal_p = false;
struct obstack str_ob;
cpp_string istr;
@@ -723,6 +884,11 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
if (tok->type == CPP_WSTRING)
wide = true;
+ /* APPLE LOCAL begin pascal strings */
+ else if (CPP_OPTION (parse_in, pascal_strings)
+ && str.text[1] == '\\' && str.text[2] == 'p')
+ pascal_p = true;
+ /* APPLE LOCAL end pascal strings */
retry:
tok = cpp_get_token (parse_in);
@@ -762,12 +928,18 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
if (concats)
strs = (cpp_string *) obstack_finish (&str_ob);
+ /* APPLE LOCAL begin pascal strings */
+ if (wide || objc_string)
+ pascal_p = false;
+ /* APPLE LOCAL end pascal strings */
+
if (concats && !objc_string && warn_traditional && !in_system_header)
warning ("traditional C rejects string constant concatenation");
if ((c_lex_string_translate
? cpp_interpret_string : cpp_interpret_string_notranslate)
- (parse_in, strs, concats + 1, &istr, wide))
+ /* APPLE LOCAL pascal strings */
+ (parse_in, strs, concats + 1, &istr, wide, pascal_p))
{
value = build_string (istr.len, (char *) istr.text);
free ((void *) istr.text);
@@ -776,7 +948,8 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
{
int xlated = cpp_interpret_string_notranslate (parse_in, strs,
concats + 1,
- &istr, wide);
+ /* APPLE LOCAL pascal strings */
+ &istr, wide, false);
/* Assume that, if we managed to translate the string above,
then the untranslated parsing will always succeed. */
gcc_assert (xlated);
@@ -808,7 +981,11 @@ lex_string (const cpp_token *tok, tree *valp, bool objc_string)
value = build_string (1, "");
}
- TREE_TYPE (value) = wide ? wchar_array_type_node : char_array_type_node;
+ /* APPLE LOCAL begin pascal strings */
+ TREE_TYPE (value) = wide ? wchar_array_type_node
+ : pascal_p ? pascal_string_type_node
+ : char_array_type_node;
+ /* APPLE LOCAL end pascal strings */
*valp = fix_string_type (value);
if (concats)
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index 89fb409878e..8a12d21837e 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -61,7 +61,8 @@ c_disregard_inline_limits (tree fn)
return 1;
return (!flag_really_no_inline && DECL_DECLARED_INLINE_P (fn)
- && DECL_EXTERNAL (fn));
+ /* APPLE LOCAL obey inline */
+ && (DECL_EXTERNAL (fn) || flag_obey_inline));
}
int
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index 36c3f5bd68e..26da39e6cc4 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -219,6 +219,13 @@ c_common_init_options (unsigned int argc, const char **argv)
before passing on command-line options to cpplib. */
cpp_opts->warn_dollars = 0;
+ /* APPLE LOCAL begin -Wfour-char-constants */
+#ifdef WARN_FOUR_CHAR_CONSTANTS
+ /* Warn about 4-char constants everywhere except on Macs. */
+ cpp_opts->warn_four_char_constants = WARN_FOUR_CHAR_CONSTANTS;
+#endif
+ /* APPLE LOCAL end -Wfour-char-constants */
+
flag_const_strings = c_dialect_cxx ();
flag_exceptions = c_dialect_cxx ();
warn_pointer_arith = c_dialect_cxx ();
@@ -349,6 +356,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_no_line_commands = 1;
break;
+ /* APPLE LOCAL begin -Wno-#warnings */
+ case OPT_W_warnings:
+ cpp_opts->no_pound_warnings = !value;
+ break;
+ /* APPLE LOCAL end -Wno-#warnings */
+
case OPT_fworking_directory:
flag_working_directory = value;
break;
@@ -358,12 +371,17 @@ c_common_handle_option (size_t scode, const char *arg, int value)
break;
case OPT_Wall:
+ /* APPLE LOCAL -Wmost */
+ case OPT_Wmost:
set_Wunused (value);
set_Wformat (value);
set_Wimplicit (value);
warn_char_subscripts = value;
warn_missing_braces = value;
- warn_parentheses = value;
+ /* APPLE LOCAL begin -Wmost --dpatel */
+ if (code != OPT_Wmost)
+ warn_parentheses = value;
+ /* APPLE LOCAL end -Wmost --dpatel */
warn_return_type = value;
warn_sequence_point = value; /* Was C only. */
if (c_dialect_cxx ())
@@ -421,6 +439,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
global_dc->warning_as_error_requested = value;
break;
+ /* APPLE LOCAL begin -Wextra-tokens */
+ case OPT_Wextra_tokens:
+ cpp_opts->warn_extra_tokens = value;
+ break;
+ /* APPLE LOCAL end -Wextra-tokens */
+
case OPT_Werror_implicit_function_declaration:
mesg_implicit_function_declaration = 2;
break;
@@ -433,6 +457,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
set_Wformat (atoi (arg));
break;
+ /* APPLE LOCAL begin -Wfour-char-constants */
+ case OPT_Wfour_char_constants:
+ cpp_opts->warn_four_char_constants = value;
+ break;
+ /* APPLE LOCAL end -Wfour-char-constants */
+
case OPT_Wimplicit:
set_Wimplicit (value);
break;
@@ -460,6 +490,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
cpp_opts->warn_multichar = value;
break;
+ /* APPLE LOCAL begin -Wnewline-eof */
+ case OPT_Wnewline_eof:
+ cpp_opts->warn_newline_at_eof = value;
+ break;
+ /* APPLE LOCAL end -Wnewline-eof */
+
case OPT_Wreturn_type:
warn_return_type = value;
break;
@@ -508,6 +544,11 @@ c_common_handle_option (size_t scode, const char *arg, int value)
set_std_cxx98 (true);
break;
+ /* APPLE LOCAL begin fat builds */
+ case OPT_arch:
+ break;
+ /* APPLE LOCAL end fat builds */
+
case OPT_d:
handle_OPT_d (arg);
break;
@@ -548,6 +589,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_no_asm = !value;
break;
+ /* APPLE LOCAL begin CW asm blocks */
+ case OPT_fasm_blocks:
+ flag_cw_asm_blocks = value;
+ break;
+ /* APPLE LOCAL end CW asm blocks */
+
case OPT_fbuiltin:
flag_no_builtin = !value;
break;
@@ -559,6 +606,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
disable_builtin_function (arg);
break;
+ /* APPLE LOCAL begin disable_typechecking_for_spec_flag */
+ case OPT_fdisable_typechecking_for_spec:
+ disable_typechecking_for_spec_flag = value;
+ break;
+ /* APPLE LOCAL end disable_typechecking_for_spec_flag */
+
case OPT_fdollars_in_identifiers:
cpp_opts->dollars_in_ident = value;
break;
@@ -602,6 +655,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_signed_char = !value;
break;
+ /* APPLE LOCAL begin structor decloning */
+ case OPT_fclone_structors:
+ flag_clone_structors = value;
+ break;
+ /* APPLE LOCAL end structor decloning */
+
case OPT_fcheck_new:
flag_check_new = value;
break;
@@ -682,6 +741,12 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_no_nonansi_builtin = !value;
break;
+ /* APPLE LOCAL begin ObjC C++ ivars */
+ case OPT_fobjc_call_cxx_cdtors:
+ flag_objc_call_cxx_cdtors = value;
+ break;
+ /* APPLE LOCAL end ObjC C++ ivars */
+
case OPT_fobjc_exceptions:
flag_objc_exceptions = value;
break;
@@ -712,6 +777,8 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_fpreprocessed:
cpp_opts->preprocessed = value;
+ /* APPLE LOCAL private extern Radar 2872481 --ilr */
+ flag_preprocessed = value;
break;
case OPT_freplace_objc_classes:
@@ -904,6 +971,13 @@ c_common_handle_option (size_t scode, const char *arg, int value)
case OPT_v:
verbose = true;
break;
+
+ /* APPLE LOCAL begin -fast or -fastf or -fastcp */
+ case OPT_fast:
+ case OPT_fastcp:
+ case OPT_fastf:
+ break;
+ /* APPLE LOCAL end -fast or -fastf or -fastcp */
}
return result;
@@ -921,6 +995,12 @@ c_common_post_options (const char **pfilename)
in_fnames = XNEWVEC (const char *, 1);
in_fnames[0] = "";
}
+ /* APPLE LOCAL begin predictive compilation */
+ else if (predictive_compilation >= 0)
+ {
+ set_stdin_option(parse_in, predictive_compilation);
+ }
+ /* APPLE LOCAL end predictive compilation */
else if (strcmp (in_fnames[0], "-") == 0)
in_fnames[0] = "";
@@ -1386,12 +1466,18 @@ static void
set_std_c89 (int c94, int iso)
{
cpp_set_lang (parse_in, c94 ? CLK_STDC94: iso ? CLK_STDC89: CLK_GNUC89);
+ /* APPLE LOCAL begin preprocess .s files (radar #3191171) */
+ /* Do not override CLK_ASM if set */
+ if (cpp_opts->lang != CLK_ASM)
+ /* APPLE LOCAL end */
flag_iso = iso;
flag_no_asm = iso;
flag_no_gnu_keywords = iso;
flag_no_nonansi_builtin = iso;
flag_isoc94 = c94;
flag_isoc99 = 0;
+ /* APPLE LOCAL fwritable strings */
+ flag_writable_strings = 0;
}
/* Set the C 99 standard (without GNU extensions if ISO). */
@@ -1404,6 +1490,8 @@ set_std_c99 (int iso)
flag_iso = iso;
flag_isoc99 = 1;
flag_isoc94 = 1;
+ /* APPLE LOCAL fwritable strings */
+ flag_writable_strings = 0;
}
/* Set the C++ 98 standard (without GNU extensions if ISO). */
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index fe0d51709eb..d1c8e2fa5fb 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -150,6 +150,14 @@ do { \
%token REALPART IMAGPART VA_ARG CHOOSE_EXPR TYPES_COMPATIBLE_P
%token FUNC_NAME OFFSETOF
+/* APPLE LOCAL begin CW asm blocks */
+/* This token is a pseudo-storage-class. */
+%token CW_ASM_KEYWORD
+%type <ttype> CW_ASM_KEYWORD
+/* These tokens indicate beginning and end of each asm line. */
+%token CW_ASM_BOL CW_ASM_EOL
+/* APPLE LOCAL end CW asm blocks */
+
/* Add precedence rules to solve dangling else s/r conflict */
%nonassoc IF
%nonassoc ELSE
@@ -242,6 +250,17 @@ do { \
%type <arginfotype> parmlist_or_identifiers parmlist_or_identifiers_1
%type <ttype> identifiers_or_typenames
+/* APPLE LOCAL begin CW asm blocks */
+%type <ttype> cw_identifier
+%type <exprtype> cw_asm_expr_no_commas cw_asm_unary_expr
+%type <exprtype> cw_asm_primary
+%type <ttype> cw_asm_operands cw_nonnull_asm_operands
+%type <exprtype> cw_asm_operand
+%type <ttype> cw_asm_stmt single_cw_asm_stmt
+%type <ttype> cw_asm_compstmt cw_asm_compstmt_start
+/*cw_asm_compstmt_nostart */
+/* APPLE LOCAL end CW asm blocks */
+
%type <itype> setspecs setspecs_fp extension
%type <location> save_location
@@ -358,6 +377,8 @@ static int yylexname (void);
static inline int _yylex (void);
static int yylex (void);
static void init_reswords (void);
+/* APPLE LOCAL CW asm blocks */
+static int cw_asm_lineno = 0;
/* Initialization routine for this file. */
void
@@ -683,7 +704,8 @@ primary:
finish_init ();
maybe_warn_string_init (type, init);
- if (pedantic && !flag_isoc99)
+ /* APPLE LOCAL AltiVec */
+ if (pedantic && TREE_CODE (type) != VECTOR_TYPE && !flag_isoc99)
pedwarn ("ISO C90 forbids compound literals");
$$.value = build_compound_literal (type, constructor);
$$.original_code = ERROR_MARK;
@@ -845,7 +867,8 @@ datadecl:
where statement labels are allowed. */
lineno_decl:
save_location decl
- { }
+ /* APPLE LOCAL CW asm blocks */
+ { if (flag_cw_asm_blocks) cw_asm_in_decl = 0; }
;
/* records the type and storage class specs to use for processing
@@ -1419,6 +1442,8 @@ any_word:
scspec:
STATIC
+ /* APPLE LOCAL CW asm blocks */
+ | CW_ASM_KEYWORD
| SCSPEC
;
@@ -2028,6 +2053,11 @@ compstmt_start: '{' { $$ = c_begin_compound_stmt (true); }
compstmt_nostart: '}'
| maybe_label_decls compstmt_contents_nonempty '}'
+ /* APPLE LOCAL begin CW asm blocks */
+ {
+ if (flag_cw_asm_blocks) cw_asm_block = 0;
+ }
+ /* APPLE LOCAL end CW asm blocks */
;
compstmt_contents_nonempty:
@@ -2051,6 +2081,126 @@ compstmt: compstmt_start compstmt_nostart
{ $$ = c_end_compound_stmt ($1, true); }
;
+/* APPLE LOCAL begin CW asm blocks */
+/* A CW-style asm statement is recognized by having a BOL token preceding it. */
+cw_asm_stmt: CW_ASM_BOL save_location cw_asm_stmt_list CW_ASM_EOL
+
+{ $$ = NULL_TREE; }
+ ;
+
+/* A single line may have multiple statements separated by ';'. */
+cw_asm_stmt_list:
+ /* empty */
+ | single_cw_asm_stmt
+ {}
+ | cw_asm_stmt_list ';' single_cw_asm_stmt
+ | cw_asm_stmt_list ';'
+ ;
+
+cw_identifier:
+ identifier
+ | cw_identifier '.'
+ { $$ = cw_get_identifier ($1, "."); }
+ | cw_identifier '+'
+ { $$ = cw_get_identifier ($1, "+"); }
+ | cw_identifier '-'
+ { $$ = cw_get_identifier ($1, "-"); }
+ | '.' identifier
+ { $$ = prepend_char_identifier ($2, '.'); }
+ ;
+
+/* A single statement consists of one or more labels (identified by a
+ leading '@' and/or a trailing ':'), optionally followed by opcode
+ and operands. */
+single_cw_asm_stmt:
+ cw_identifier
+ { cw_asm_lineno = input_line; cw_asm_in_operands = 1; }
+ cw_asm_operands
+ { $$ = cw_asm_stmt ($1, $3, cw_asm_lineno); }
+ | identifier STATIC cw_asm_operand
+ { $$ = cw_asm_entry ($1, $2, $3.value); }
+ | identifier SCSPEC cw_asm_operand
+ { $$ = cw_asm_entry ($1, $2, $3.value); }
+ | cw_asm_label
+ {}
+ | cw_asm_label single_cw_asm_stmt
+ {}
+ ;
+
+cw_asm_label:
+ identifier ':'
+ { cw_asm_label ($1, 0); }
+ | '@' identifier
+ { cw_asm_label ($2, 1); }
+ | '@' identifier ':'
+ { cw_asm_label ($2, 1); }
+ ;
+
+cw_asm_stmts:
+ stmt
+ {}
+ | cw_asm_stmts stmt
+ {}
+ ;
+
+/* An asm block within a function is simpler than asm functions; no
+ declarations are possible, so we switch to the block interior state
+ immediately. */
+cw_asm_compstmt_start: ASM_KEYWORD '{'
+ {
+ if (flag_cw_asm_blocks)
+ {
+ cw_asm_state = cw_asm_asm;
+ cw_asm_block = 1;
+ cw_asm_at_bol = 1;
+ clear_cw_asm_labels ();
+ }
+ else
+ /* This will probably choke badly... */
+ error ("asm blocks not enabled, use `-fasm-blocks'");
+ $$ = c_begin_compound_stmt (true);
+ }
+ ;
+
+cw_asm_compstmt_nostart:
+ '}'
+ | cw_asm_compstmt_contents_nonempty '}'
+ { cw_asm_block = 0; }
+ ;
+
+cw_asm_compstmt_contents_nonempty:
+ cw_asm_stmts
+ | error
+ ;
+
+cw_asm_compstmt: cw_asm_compstmt_start cw_asm_compstmt_nostart
+ { $$ = c_end_compound_stmt ($1, true); }
+ ;
+
+cw_asm_operands:
+ /* empty */
+ { $$ = NULL_TREE; }
+ | cw_nonnull_asm_operands
+ ;
+
+cw_nonnull_asm_operands:
+ cw_asm_operand
+ { $$ = build_tree_list (NULL_TREE, $1.value); }
+ | cw_nonnull_asm_operands ',' cw_asm_operand
+ { $$ = chainon ($1, build_tree_list (NULL_TREE, $3.value)); }
+ ;
+
+/* Alternatively this could go to the regular expr_no_commas, but then
+ all the semantic actions would need to be tweaked to handle the
+ possibility of CW asm coming through. For example, "offset(reg)"
+ would be handled by function call code (bleah). */
+cw_asm_operand: cw_asm_expr_no_commas
+ | cw_asm_operand '(' cw_asm_expr_no_commas ')'
+ { $$.value = cw_asm_build_register_offset ($1.value, $3.value);
+ $$.original_code = ERROR_MARK; }
+ ;
+/* APPLE LOCAL end CW asm blocks */
+
/* The forced readahead in here is because we might be at the end of a
line, and the line and file won't be bumped until yylex absorbs the
first token on the next line. */
@@ -2233,6 +2383,12 @@ stmt_nocomp:
{ $$ = NULL_TREE; }
| switch_statement
{ $$ = NULL_TREE; }
+ /* APPLE LOCAL begin CW asm blocks */
+ | cw_asm_compstmt
+ { $$ = c_finish_expr_stmt ($1); }
+ | cw_asm_stmt
+ { $$ = c_finish_expr_stmt ($1); }
+ /* APPLE LOCAL end CW asm blocks */
| BREAK ';'
{ $$ = c_finish_bc_stmt (&c_break_label, true); }
| CONTINUE ';'
@@ -2441,6 +2597,139 @@ start_string_translation:
{ c_lex_string_translate = 1; }
;
+/* APPLE LOCAL begin CW asm blocks */
+cw_asm_expr_no_commas:
+ cw_asm_unary_expr
+ | cw_asm_expr_no_commas '+' cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas '-' cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas '*' cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas '/' cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas '%' cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas LSHIFT cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas RSHIFT cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas ARITHCOMPARE cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas EQCOMPARE cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas '&' cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas '|' cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas '^' cw_asm_expr_no_commas
+ { $$ = parser_build_binary_op ($2, $1, $3); }
+ | cw_asm_expr_no_commas ANDAND
+ { $1.value = c_common_truthvalue_conversion
+ (default_conversion ($1.value));
+ skip_evaluation += $1.value == boolean_false_node; }
+ cw_asm_expr_no_commas
+ { skip_evaluation -= $1.value == boolean_false_node;
+ $$ = parser_build_binary_op (TRUTH_ANDIF_EXPR, $1, $4); }
+ | cw_asm_expr_no_commas OROR
+ { $1.value = c_common_truthvalue_conversion
+ (default_conversion ($1.value));
+ skip_evaluation += $1.value == boolean_true_node; }
+ cw_asm_expr_no_commas
+ { skip_evaluation -= $1.value == boolean_true_node;
+ $$ = parser_build_binary_op (TRUTH_ORIF_EXPR, $1, $4); }
+ ;
+
+cw_asm_unary_expr:
+ cw_asm_primary
+ | '*' cw_asm_unary_expr %prec UNARY
+ { $$.value = build_indirect_ref ($2.value, "unary *");
+ $$.original_code = ERROR_MARK; }
+ | unop cw_asm_unary_expr %prec UNARY
+ {
+ if (TREE_CODE ($2.value) == COMPOUND_EXPR)
+ {
+ tree neg = build_unary_op ($1, TREE_OPERAND ($2.value, 0), 0);
+ tree reg = TREE_OPERAND ($2.value, 1);
+ $$.value = cw_asm_build_register_offset (neg, reg);
+ }
+ else
+ {
+ $$.value = build_unary_op ($1, $2.value, 0);
+ overflow_warning ($$.value);
+ }
+ $$.original_code = ERROR_MARK;
+ }
+ | sizeof cw_asm_unary_expr %prec UNARY
+ { skip_evaluation--;
+ if (TREE_CODE ($2.value) == COMPONENT_REF
+ && DECL_C_BIT_FIELD (TREE_OPERAND ($2.value, 1)))
+ error ("`sizeof' applied to a bit-field");
+ else if (TREE_CODE ($2.value) == IDENTIFIER_NODE)
+ {
+ undeclared_variable ($2.value);
+ $2.value = error_mark_node;
+ }
+ $$.value = c_sizeof (TREE_TYPE ($2.value));
+ $$.original_code = ERROR_MARK; }
+ | sizeof '(' typename ')' %prec HYPERUNARY
+ { skip_evaluation--;
+ $$.value = c_sizeof (groktypename ($3));
+ $$.original_code = ERROR_MARK; }
+ | alignof cw_asm_unary_expr %prec UNARY
+ { skip_evaluation--;
+ $$.value = c_alignof_expr ($2.value);
+ $$.original_code = ERROR_MARK; }
+ | alignof '(' typename ')' %prec HYPERUNARY
+ { skip_evaluation--;
+ $$.value = c_alignof (groktypename ($3));
+ $$.original_code = ERROR_MARK; }
+ ;
+
+cw_asm_primary:
+ IDENTIFIER
+ {
+ if (yychar == YYEMPTY)
+ yychar = YYLEX;
+ $$.value = build_external_ref ($1, yychar == '(');
+ $$.original_code = ERROR_MARK;
+ }
+ | '@' IDENTIFIER
+ {
+ tree atsignid = prepend_char_identifier ($2, '@');
+ if (yychar == YYEMPTY)
+ yychar = YYLEX;
+ $$.value = build_external_ref (atsignid, yychar == '(');
+ $$.original_code = ERROR_MARK;
+ }
+ | CONSTANT
+ { $$.value = $1; $$.original_code = ERROR_MARK; }
+ | STRING
+ { $$.value = $1; $$.original_code = STRING_CST; }
+ | '(' cw_asm_expr_no_commas ')'
+ { char class = TREE_CODE_CLASS (TREE_CODE ($2.value));
+ if (IS_EXPR_CODE_CLASS (class))
+ $2.original_code = ERROR_MARK;
+ $$ = $2; }
+ | '(' error ')'
+ { $$.value = error_mark_node; $$.original_code = ERROR_MARK; }
+ | cw_asm_primary '[' cw_asm_expr_no_commas ']' %prec '.'
+ { $$.value = build_array_ref ($1.value, $3.value);
+ $$.original_code = ERROR_MARK; }
+ | TYPENAME '.' identifier
+ { $$.value = cw_asm_c_build_component_ref ($1, $3);
+ $$.original_code = ERROR_MARK; }
+ | cw_asm_primary '.' identifier
+ { $$.value = cw_asm_c_build_component_ref ($1.value, $3);
+ $$.original_code = ERROR_MARK; }
+ | cw_asm_primary POINTSAT identifier
+ {
+ tree expr = build_indirect_ref ($1.value, "->");
+ $$.value = build_component_ref (expr, $3);
+ $$.original_code = ERROR_MARK;
+ }
+ ;
+/* APPLE LOCAL end CW asm blocks */
/* This is what appears inside the parens in a function declarator.
Its value is a list of ..._TYPE nodes. Attributes must appear here
@@ -3110,6 +3399,8 @@ static const struct resword reswords[] =
{ "__inline", RID_INLINE, 0 },
{ "__inline__", RID_INLINE, 0 },
{ "__label__", RID_LABEL, 0 },
+ /* APPLE LOCAL private extern */
+ { "__private_extern__", RID_PRIVATE_EXTERN, 0 },
{ "__real", RID_REALPART, 0 },
{ "__real__", RID_REALPART, 0 },
{ "__restrict", RID_RESTRICT, 0 },
@@ -3191,9 +3482,12 @@ static const struct resword reswords[] =
};
#define N_reswords (sizeof reswords / sizeof (struct resword))
+/* APPLE LOCAL begin keep tables in sync comment */
/* Table mapping from RID_* constants to yacc token numbers.
Unfortunately we have to have entries for all the keywords in all
- three languages. */
+ three languages (AND THEY MUST BE KEPT IN PARALLEL - see also
+ cp/lex.c). */
+/* APPLE LOCAL end keep tables in sync comment */
static const short rid_to_yy[RID_MAX] =
{
/* RID_STATIC */ STATIC,
@@ -3213,6 +3507,8 @@ static const short rid_to_yy[RID_MAX] =
/* C extensions */
/* RID_COMPLEX */ TYPESPEC,
/* RID_THREAD */ SCSPEC,
+ /* APPLE LOCAL private extern */
+ /* RID_PRIVATE_EXTERN */ SCSPEC,
/* C++ */
/* RID_FRIEND */ 0,
@@ -3373,8 +3669,30 @@ yylexname (void)
&& (!OBJC_IS_PQ_KEYWORD (rid_code) || objc_pq_context))
@@end_ifobjc
{
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Outside of function bodies, "asm" either indicates a CW asm
+ function, or a GNU asm statement, which must be immediately
+ followed by '(', so sniff the next token to see which kind
+ must be meant, and change the CW keyword to a different
+ token type so we don't have grammar problems. */
+ int yycode = rid_to_yy[(int) rid_code];
+ if (yycode == ASM_KEYWORD && current_function_decl == NULL)
+ {
+ tree next_tok;
+ /* Take a sneak peek at the next token in the stream. */
+ enum cpp_ttype next_tok_type = c_lex (&next_tok);
+ /* Now put it back. */
+ _cpp_backup_tokens (parse_in, 1);
+ /* Change the code. No need to change the name though,
+ won't matter to parser. */
+ if (next_tok_type != CPP_OPEN_PAREN)
+ yycode = CW_ASM_KEYWORD;
+ }
+ /* APPLE LOCAL end CW asm blocks */
/* Return the canonical spelling for this keyword. */
yylval.ttype = ridpointers[(int) rid_code];
+ /* APPLE LOCAL CW asm blocks */
+ return yycode;
return rid_to_yy[(int) rid_code];
}
}
@@ -3465,6 +3783,14 @@ _yylex (void)
case CPP_CLOSE_PAREN: OBJC_NEED_RAW_IDENTIFIER (0); return ')';
case CPP_SEMICOLON: OBJC_NEED_RAW_IDENTIFIER (0); return ';';
+ /* APPLE LOCAL begin CW asm blocks */
+ case CPP_ATSIGN:
+ /* If we're doing CW assembly, return this as a regular token
+ (indicates labels). */
+ if (cw_asm_state >= cw_asm_decls)
+ return '@';
+ /* APPLE LOCAL end CW asm blocks */
+
case CPP_EOF:
return 0;
@@ -3484,6 +3810,15 @@ _yylex (void)
case CPP_WSTRING:
return STRING;
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Convert a lexer-returned beginning-of-line token into a
+ parser token. */
+ case CPP_BOL:
+ return CW_ASM_BOL;
+ case CPP_EOL:
+ return CW_ASM_EOL;
+ /* APPLE LOCAL end CW asm blocks */
+
case CPP_OBJC_STRING:
return OBJC_STRING;
diff --git a/gcc/c-pch.c b/gcc/c-pch.c
index 5c71ad107b3..58be5521468 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -45,6 +45,8 @@ static const struct c_pch_matching
const char *flag_name;
} pch_matching[] = {
{ &flag_exceptions, "-fexceptions" },
+ /* APPLE LOCAL Altivec 3837840 */
+ { &flag_faltivec, "-faltivec" },
{ &flag_unit_at_a_time, "-funit-at-a-time" }
};
@@ -465,6 +467,10 @@ c_common_no_more_pch (void)
}
}
+/* APPLE LOCAL begin distcc pch indirection --mrs */
+const char *indirect_file PARAMS ((const char *, int));
+/* APPLE LOCAL end distcc pch indirection --mrs */
+
/* Handle #pragma GCC pch_preprocess, to load in the PCH file. */
#ifndef O_BINARY
@@ -493,6 +499,10 @@ c_common_pch_pragma (cpp_reader *pfile)
name = TREE_STRING_POINTER (name_t);
+ /* APPLE LOCAL begin distcc pch indirection --mrs */
+ name = indirect_file (name, 0);
+ /* APPLE LOCAL end distcc pch indirection --mrs */
+
fd = open (name, O_RDONLY | O_BINARY, 0666);
if (fd == -1)
fatal_error ("%s: couldn%'t open PCH file: %m\n", name);
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index cc1dd280359..7893082905b 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -48,193 +48,8 @@ typedef struct align_stack GTY(())
static GTY(()) struct align_stack * alignment_stack;
-#ifdef HANDLE_PRAGMA_PACK
-static void handle_pragma_pack (cpp_reader *);
-
-#ifdef HANDLE_PRAGMA_PACK_PUSH_POP
-/* If we have a "global" #pragma pack(<n>) in effect when the first
- #pragma pack(push,<n>) is encountered, this stores the value of
- maximum_field_alignment in effect. When the final pop_alignment()
- happens, we restore the value to this, not to a value of 0 for
- maximum_field_alignment. Value is in bits. */
-static int default_alignment;
-#define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = *(alignment_stack == NULL \
- ? &default_alignment \
- : &alignment_stack->alignment) = (ALIGN))
-
-static void push_alignment (int, tree);
-static void pop_alignment (tree);
-
-/* Push an alignment value onto the stack. */
-static void
-push_alignment (int alignment, tree id)
-{
- align_stack * entry;
-
- entry = ggc_alloc (sizeof (* entry));
-
- entry->alignment = alignment;
- entry->id = id;
- entry->prev = alignment_stack;
-
- /* The current value of maximum_field_alignment is not necessarily
- 0 since there may be a #pragma pack(<n>) in effect; remember it
- so that we can restore it after the final #pragma pop(). */
- if (alignment_stack == NULL)
- default_alignment = maximum_field_alignment;
-
- alignment_stack = entry;
-
- maximum_field_alignment = alignment;
-}
-
-/* Undo a push of an alignment onto the stack. */
-static void
-pop_alignment (tree id)
-{
- align_stack * entry;
-
- if (alignment_stack == NULL)
- GCC_BAD ("#pragma pack (pop) encountered without matching #pragma pack (push)");
-
- /* If we got an identifier, strip away everything above the target
- entry so that the next step will restore the state just below it. */
- if (id)
- {
- for (entry = alignment_stack; entry; entry = entry->prev)
- if (entry->id == id)
- {
- alignment_stack = entry;
- break;
- }
- if (entry == NULL)
- warning ("\
-#pragma pack(pop, %s) encountered without matching #pragma pack(push, %s)"
- , IDENTIFIER_POINTER (id), IDENTIFIER_POINTER (id));
- }
-
- entry = alignment_stack->prev;
-
- maximum_field_alignment = entry ? entry->alignment : default_alignment;
-
- alignment_stack = entry;
-}
-#else /* not HANDLE_PRAGMA_PACK_PUSH_POP */
-#define SET_GLOBAL_ALIGNMENT(ALIGN) (maximum_field_alignment = (ALIGN))
-#define push_alignment(ID, N) \
- GCC_BAD ("#pragma pack(push[, id], <n>) is not supported on this target")
-#define pop_alignment(ID) \
- GCC_BAD ("#pragma pack(pop[, id], <n>) is not supported on this target")
-#endif /* HANDLE_PRAGMA_PACK_PUSH_POP */
-
-/* #pragma pack ()
- #pragma pack (N)
-
- #pragma pack (push)
- #pragma pack (push, N)
- #pragma pack (push, ID)
- #pragma pack (push, ID, N)
- #pragma pack (pop)
- #pragma pack (pop, ID) */
-static void
-handle_pragma_pack (cpp_reader * ARG_UNUSED (dummy))
-{
- tree x, id = 0;
- int align = -1;
- enum cpp_ttype token;
- enum { set, push, pop } action;
-
- if (c_lex (&x) != CPP_OPEN_PAREN)
- GCC_BAD ("missing %<(%> after %<#pragma pack%> - ignored");
-
- token = c_lex (&x);
- if (token == CPP_CLOSE_PAREN)
- {
- action = set;
- align = initial_max_fld_align;
- }
- else if (token == CPP_NUMBER)
- {
- align = TREE_INT_CST_LOW (x);
- action = set;
- if (c_lex (&x) != CPP_CLOSE_PAREN)
- GCC_BAD ("malformed %<#pragma pack%> - ignored");
- }
- else if (token == CPP_NAME)
- {
-#define GCC_BAD_ACTION do { if (action != pop) \
- GCC_BAD ("malformed %<#pragma pack(push[, id][, <n>])%> - ignored"); \
- else \
- GCC_BAD ("malformed %<#pragma pack(pop[, id])%> - ignored"); \
- } while (0)
-
- const char *op = IDENTIFIER_POINTER (x);
- if (!strcmp (op, "push"))
- action = push;
- else if (!strcmp (op, "pop"))
- action = pop;
- else
- GCC_BAD2 ("unknown action %qs for %<#pragma pack%> - ignored", op);
-
- while ((token = c_lex (&x)) == CPP_COMMA)
- {
- token = c_lex (&x);
- if (token == CPP_NAME && id == 0)
- {
- id = x;
- }
- else if (token == CPP_NUMBER && action == push && align == -1)
- {
- align = TREE_INT_CST_LOW (x);
- if (align == -1)
- action = set;
- }
- else
- GCC_BAD_ACTION;
- }
-
- if (token != CPP_CLOSE_PAREN)
- GCC_BAD_ACTION;
-#undef GCC_BAD_ACTION
- }
- else
- GCC_BAD ("malformed %<#pragma pack%> - ignored");
-
- if (c_lex (&x) != CPP_EOF)
- warning ("junk at end of %<#pragma pack%>");
-
- if (flag_pack_struct)
- GCC_BAD ("#pragma pack has no effect with -fpack-struct - ignored");
-
- if (action != pop)
- switch (align)
- {
- case 0:
- case 1:
- case 2:
- case 4:
- case 8:
- case 16:
- align *= BITS_PER_UNIT;
- break;
- case -1:
- if (action == push)
- {
- align = maximum_field_alignment;
- break;
- }
- default:
- GCC_BAD2 ("alignment must be a small power of two, not %d", align);
- }
-
- switch (action)
- {
- case set: SET_GLOBAL_ALIGNMENT (align); break;
- case push: push_alignment (align, id); break;
- case pop: pop_alignment (id); break;
- }
-}
-#endif /* HANDLE_PRAGMA_PACK */
+/* APPLE LOCAL Macintosh alignment */
+/* Lots of stuff deleted here. */
static GTY(()) tree pending_weaks;
@@ -679,13 +494,10 @@ c_register_pragma_with_expansion (const char *space, const char *name,
void
init_pragma (void)
{
-#ifdef HANDLE_PRAGMA_PACK
-#ifdef HANDLE_PRAGMA_PACK_WITH_EXPANSION
- c_register_pragma_with_expansion (0, "pack", handle_pragma_pack);
-#else
- c_register_pragma (0, "pack", handle_pragma_pack);
-#endif
-#endif
+/* APPLE LOCAL begin Macintosh alignment 2002-1-22 --ff
+ Remove the handling of pragma pack here because it is handled
+ in config/darwin-c.c.
+ APPLE LOCAL end Macintosh alignment 2002-1-22 --ff */
#ifdef HANDLE_PRAGMA_WEAK
c_register_pragma (0, "weak", handle_pragma_weak);
#endif
@@ -696,6 +508,13 @@ init_pragma (void)
c_register_pragma (0, "redefine_extname", handle_pragma_redefine_extname);
c_register_pragma (0, "extern_prefix", handle_pragma_extern_prefix);
+ /* APPLE LOCAL begin OS pragma hook */
+ /* Allow registration of OS-specific but arch-independent pragmas. */
+#ifdef REGISTER_OS_PRAGMAS
+ REGISTER_OS_PRAGMAS ();
+#endif
+ /* APPLE LOCAL end OS pragma hook */
+
c_register_pragma ("GCC", "pch_preprocess", c_common_pch_pragma);
#ifdef REGISTER_TARGET_PRAGMAS
diff --git a/gcc/c-pragma.h b/gcc/c-pragma.h
index f7f609c407f..20cab17ccc7 100644
--- a/gcc/c-pragma.h
+++ b/gcc/c-pragma.h
@@ -65,6 +65,10 @@ extern tree maybe_apply_renaming_pragma (tree, tree);
extern void add_to_renaming_pragma_list (tree, tree);
extern enum cpp_ttype c_lex (tree *);
+/* APPLE LOCAL begin AltiVec */
+extern const struct cpp_token *c_lex_peek (int);
+extern void c_lex_prepend (const struct cpp_token *, int);
+/* APPLE LOCAL end AltiVec */
extern enum cpp_ttype c_lex_with_flags (tree *, unsigned char *);
/* If 1, then lex strings into the execution character set.
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 1cde4828348..7eaec29fed8 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -25,10 +25,29 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "c-common.h"
#include "diagnostic.h"
+/* APPLE LOCAL begin objc speedup --dpatel */
+/* Definition of 'struct lang_identifier' has been moved here from c-decl.c.
+ so that ObjC can see it. */
+
+/* Each C symbol points to three linked lists of c_binding structures.
+ These describe the values of the identifier in the three different
+ namespaces defined by the language. */
+
+struct lang_identifier GTY(())
+{
+ struct c_common_identifier common_id;
+ struct c_binding *symbol_binding; /* vars, funcs, constants, typedefs */
+ struct c_binding *tag_binding; /* struct/union/enum tags */
+ struct c_binding *label_binding; /* labels */
+ tree interface_value; /* ObjC interface, if any */
+};
+/* APPLE LOCAL end objc speedup --dpatel */
+
/* struct lang_identifier is private to c-decl.c, but langhooks.c needs to
know how big it is. This is sanity-checked in c-decl.c. */
#define C_SIZEOF_STRUCT_LANG_IDENTIFIER \
- (sizeof (struct c_common_identifier) + 3 * sizeof (void *))
+ /* APPLE LOCAL objc speedup --dpatel */ \
+ (sizeof (struct c_common_identifier) + 4 * sizeof (void *))
/* For gc purposes, return the most likely link for the longest chain. */
#define C_LANG_TREE_NODE_CHAIN_NEXT(T) \
@@ -223,6 +242,16 @@ struct c_declspecs {
BOOL_BITFIELD explicit_signed_p : 1;
/* Whether the specifiers include a deprecated typedef. */
BOOL_BITFIELD deprecated_p : 1;
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ /* Whether the specifiers include a unavailable typedef. */
+ BOOL_BITFIELD unavailable_p : 1;
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
+ /* APPLE LOCAL begin private extern */
+ /* Whether the specifiers include __private_extern. */
+ BOOL_BITFIELD private_extern_p : 1;
+ /* APPLE LOCAL end private extern */
+ /* APPLE LOCAL CW asm blocks */
+ BOOL_BITFIELD cw_asm_specbit : 1;
/* Whether the type defaulted to "int" because there were no type
specifiers. */
BOOL_BITFIELD default_int_p;
@@ -502,6 +531,11 @@ extern tree c_finish_bc_stmt (tree *, bool);
extern tree c_finish_goto_label (tree);
extern tree c_finish_goto_ptr (tree);
+/* APPLE LOCAL begin CW asm blocks */
+extern tree get_structure_offset (tree, tree);
+extern tree lookup_struct_or_union_tag (tree);
+/* APPLE LOCAL end CW asm blocks */
+
/* Set to 0 at beginning of a function definition, set to 1 if
a return statement that specifies a return value is seen. */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 3a202929e9f..f267d3e319e 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -827,6 +827,10 @@ struct tagged_tu_seen {
const struct tagged_tu_seen * next;
tree t1;
tree t2;
+ /* APPLE LOCAL begin IMA speed up */
+ int isEnum;
+ int enumMatched;
+ /* APPLE LOCAL end IMA speed up */
};
/* Can they be compatible with each other? We choose to break the
@@ -877,45 +881,72 @@ tagged_types_tu_compatible_p (tree t1, tree t2)
const struct tagged_tu_seen * tts_i;
for (tts_i = tagged_tu_seen_base; tts_i != NULL; tts_i = tts_i->next)
if (tts_i->t1 == t1 && tts_i->t2 == t2)
- return 1;
+ /* APPLE LOCAL IMA speed up */
+ return tts_i->isEnum ? tts_i->enumMatched : 1;
}
switch (TREE_CODE (t1))
{
case ENUMERAL_TYPE:
{
-
- /* Speed up the case where the type values are in the same order. */
- tree tv1 = TYPE_VALUES (t1);
- tree tv2 = TYPE_VALUES (t2);
-
- if (tv1 == tv2)
- return 1;
-
+ /* APPLE LOCAL begin IMA speed up */
+ struct tagged_tu_seen *tts;
+ int res;
+ bool done;
+ /* Speed up the case where the type values are in the same order. */
+ tree tv1 = TYPE_VALUES (t1);
+ tree tv2 = TYPE_VALUES (t2);
+ if (tv1 == tv2)
+ return 1;
+
+ res = 0;
+ done = false;
for (;tv1 && tv2; tv1 = TREE_CHAIN (tv1), tv2 = TREE_CHAIN (tv2))
{
if (TREE_PURPOSE (tv1) != TREE_PURPOSE (tv2))
break;
if (simple_cst_equal (TREE_VALUE (tv1), TREE_VALUE (tv2)) != 1)
- return 0;
+ {
+ res = 0;
+ done = true;
+ break;
+ }
}
+
+ if (!done)
+ {
+ if (tv1 == NULL_TREE && tv2 == NULL_TREE)
+ res = 1, done = true;
+ else if (tv1 == NULL_TREE || tv2 == NULL_TREE)
+ res = 0, done = true;
+ }
- if (tv1 == NULL_TREE && tv2 == NULL_TREE)
- return 1;
- if (tv1 == NULL_TREE || tv2 == NULL_TREE)
- return 0;
-
- if (list_length (TYPE_VALUES (t1)) != list_length (TYPE_VALUES (t2)))
- return 0;
-
- for (s1 = TYPE_VALUES (t1); s1; s1 = TREE_CHAIN (s1))
+ if (!done && list_length (TYPE_VALUES (t1)) == list_length (TYPE_VALUES (t2)))
+ {
+ res = 1;
+ for (s1 = TYPE_VALUES (t1); s1; s1 = TREE_CHAIN (s1))
{
s2 = purpose_member (TREE_PURPOSE (s1), TYPE_VALUES (t2));
if (s2 == NULL
|| simple_cst_equal (TREE_VALUE (s1), TREE_VALUE (s2)) != 1)
- return 0;
+ {
+ res = 0;
+ break;
+ }
}
- return 1;
+ }
+ if (tagged_tu_seen_base)
+ {
+ tts = xmalloc(sizeof (struct tagged_tu_seen));
+ tts->next = tagged_tu_seen_base;
+ tts->t1 = t1;
+ tts->t2 = t2;
+ tts->isEnum = 1;
+ tts->enumMatched = res;
+ tagged_tu_seen_base = tts;
+ }
+ return res;
+ /* APPLE LOCAL end IMA speed up */
}
case UNION_TYPE:
@@ -927,10 +958,14 @@ tagged_types_tu_compatible_p (tree t1, tree t2)
{
bool ok = false;
struct tagged_tu_seen tts;
+ /* APPLE LOCAL IMA speed up */
+ const struct tagged_tu_seen * tts_i;
tts.next = tagged_tu_seen_base;
tts.t1 = t1;
tts.t2 = t2;
+ /* APPLE LOCAL IMA speed up */
+ tts.isEnum = 0;
tagged_tu_seen_base = &tts;
if (DECL_NAME (s1) != NULL)
@@ -952,6 +987,15 @@ tagged_types_tu_compatible_p (tree t1, tree t2)
ok = true;
break;
}
+ /* APPLE LOCAL begin IMA speed up */
+ tts_i = tagged_tu_seen_base;
+ while (tts_i->isEnum)
+ {
+ const struct tagged_tu_seen* p = tts_i->next;
+ free((struct tagged_tu_seen*)tts_i);
+ tts_i = p;
+ }
+ /* APPLE LOCAL end IMA speed up */
tagged_tu_seen_base = tts.next;
if (!ok)
return 0;
@@ -962,10 +1006,14 @@ tagged_types_tu_compatible_p (tree t1, tree t2)
case RECORD_TYPE:
{
struct tagged_tu_seen tts;
+ /* APPLE LOCAL IMA speedup */
+ const struct tagged_tu_seen * tts_i;
tts.next = tagged_tu_seen_base;
tts.t1 = t1;
tts.t2 = t2;
+ /* APPLE LOCAL IMA speedup */
+ tts.isEnum = 0;
tagged_tu_seen_base = &tts;
for (s1 = TYPE_FIELDS (t1), s2 = TYPE_FIELDS (t2);
@@ -987,6 +1035,16 @@ tagged_types_tu_compatible_p (tree t1, tree t2)
DECL_FIELD_BIT_OFFSET (s2)) != 1)
break;
}
+
+ /* APPLE LOCAL begin IMA speed up */
+ tts_i = tagged_tu_seen_base;
+ while (tts_i->isEnum)
+ {
+ const struct tagged_tu_seen* p = tts_i->next;
+ free((struct tagged_tu_seen*)tts_i);
+ tts_i = p;
+ }
+ /* APPLE LOCAL end IMA speed up */
tagged_tu_seen_base = tts.next;
if (s1 && s2)
return 0;
@@ -1549,6 +1607,11 @@ build_component_ref (tree datum, tree component)
if (TREE_DEPRECATED (subdatum))
warn_deprecated_use (subdatum);
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ if (TREE_UNAVAILABLE (subdatum))
+ warn_unavailable_use (subdatum);
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
+
datum = ref;
field = TREE_CHAIN (field);
@@ -1760,6 +1823,34 @@ build_external_ref (tree id, int fun)
tree ref;
tree decl = lookup_name (id);
+ /* APPLE LOCAL begin CW asm blocks */
+ /* CW assembly has automagical handling of register names. It's
+ also handy to assume undeclared names as labels, although it
+ would be better to have a second pass and complain about names in
+ the block that are not labels. */
+ if (cw_asm_block)
+ {
+ if (decl)
+ {
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ TREE_USED (decl) = 1;
+ /* Locals and parms just need to be left alone for now. */
+ }
+ else
+ {
+ tree newid;
+ if ((newid = cw_asm_reg_name (id)))
+ return newid;
+#ifdef CW_ASM_SPECIAL_LABEL
+ if ((newid = CW_ASM_SPECIAL_LABEL (id)))
+ return newid;
+#endif
+ /* Assume undeclared symbols are labels. */
+ return get_cw_asm_label (id);
+ }
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
/* In Objective-C, an instance variable (ivar) may be preferred to
whatever lookup_name() found. */
decl = objc_lookup_ivar (decl, id);
@@ -1785,6 +1876,11 @@ build_external_ref (tree id, int fun)
if (TREE_DEPRECATED (ref))
warn_deprecated_use (ref);
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ if (TREE_UNAVAILABLE (ref))
+ warn_unavailable_use (ref);
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
+
if (!skip_evaluation)
assemble_external (ref);
TREE_USED (ref) = 1;
@@ -2270,6 +2366,17 @@ parser_build_binary_op (enum tree_code code, struct c_expr arg1,
enum tree_code code1 = arg1.original_code;
enum tree_code code2 = arg2.original_code;
+ /* APPLE LOCAL begin CW asm blocks */
+ if (cw_asm_block
+ && (TREE_CODE (arg1.value) == IDENTIFIER_NODE
+ || TREE_CODE (arg2.value) == IDENTIFIER_NODE))
+ {
+ result.value = error_mark_node;
+ result.original_code = code;
+ return result;
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
result.value = build_binary_op (code, arg1.value, arg2.value, 1);
result.original_code = code;
@@ -2619,10 +2726,12 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
inc = convert (argtype, inc);
/* Complain about anything else that is not a true lvalue. */
- if (!lvalue_or_else (arg, ((code == PREINCREMENT_EXPR
- || code == POSTINCREMENT_EXPR)
- ? lv_increment
- : lv_decrement)))
+ /* APPLE LOCAL begin non lvalue assign */
+ if (!lvalue_or_else (&arg, ((code == PREINCREMENT_EXPR
+ || code == POSTINCREMENT_EXPR)
+ ? lv_increment
+ : lv_decrement)))
+ /* APPLE LOCAL end non lvalue assign */
return error_mark_node;
/* Report a read-only lvalue. */
@@ -2667,7 +2776,8 @@ build_unary_op (enum tree_code code, tree xarg, int flag)
/* Anything not already handled and not a true memory reference
or a non-lvalue array is an error. */
else if (typecode != FUNCTION_TYPE && !flag
- && !lvalue_or_else (arg, lv_addressof))
+ /* APPLE LOCAL non lvalue assign */
+ && !lvalue_or_else (&arg, lv_addressof))
return error_mark_node;
/* Ordinary case; arg is a COMPONENT_REF or a decl. */
@@ -2751,6 +2861,7 @@ lvalue_p (tree ref)
return 0;
}
}
+
/* Give an error for storing in something that is 'const'. */
@@ -3031,6 +3142,11 @@ build_compound_expr (tree expr1, tree expr2)
/* Convert arrays and functions to pointers. */
expr2 = default_function_array_conversion (expr2);
+ /* APPLE LOCAL begin AltiVec */
+ if (targetm.cast_expr_as_vector_init)
+ ;
+ else
+ /* APPLE LOCAL end AltiVec */
if (!TREE_SIDE_EFFECTS (expr1))
{
/* The left-hand operand of a comma expression is like an expression
@@ -3062,6 +3178,13 @@ build_c_cast (tree type, tree expr)
if (type == error_mark_node || expr == error_mark_node)
return error_mark_node;
+ /* APPLE LOCAL begin AltiVec */
+ /* If we are casting to a vector type, treat the expression as a vector
+ initializer if this target supports it. */
+ if (TREE_CODE (type) == VECTOR_TYPE && targetm.cast_expr_as_vector_init)
+ return vector_constructor_from_expr (expr, type);
+ /* APPLE LOCAL end AltiVec */
+
/* The ObjC front-end uses TYPE_MAIN_VARIANT to tie together types differing
only in <protocol> qualifications. But when constructing cast expressions,
the protocols do matter and must be kept around. */
@@ -3251,6 +3374,13 @@ build_c_cast (tree type, tree expr)
pedwarn ("ISO C forbids conversion of object pointer to function pointer type");
ovalue = value;
+ /* APPLE LOCAL begin don't sign-extend pointers cast to integers */
+ if (TREE_CODE (type) == INTEGER_TYPE
+ && TREE_CODE (otype) == POINTER_TYPE
+ && TYPE_PRECISION (type) > TYPE_PRECISION (otype)
+ && TYPE_UNSIGNED (type))
+ value = convert (c_common_type_for_size (POINTER_SIZE, 1), value);
+ /* APPLE LOCAL end don't sign-extend pointers cast to integers */
value = convert (type, value);
/* Ignore any integer overflow caused by the cast. */
@@ -3332,7 +3462,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
newrhs = build_binary_op (modifycode, lhs, rhs, 1);
}
- if (!lvalue_or_else (lhs, lv_assign))
+ /* APPLE LOCAL non lvalue assign */
+ if (!lvalue_or_else (&lhs, lv_assign))
return error_mark_node;
/* Give an error for storing in something that is 'const'. */
@@ -3371,6 +3502,16 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
if (TREE_CODE (newrhs) == ERROR_MARK)
return error_mark_node;
+ /* APPLE LOCAL begin ObjC GC */
+ /* Emit ObjC write barrier, if necessary. */
+ if (c_dialect_objc () && flag_objc_gc)
+ {
+ result = objc_generate_write_barrier (lhs, modifycode, newrhs);
+ if (result)
+ return result;
+ }
+ /* APPLE LOCAL end ObjC GC */
+
/* Scan operands. */
result = build2 (MODIFY_EXPR, lhstype, lhs, newrhs);
@@ -4146,6 +4287,8 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
{
struct c_expr expr;
bool char_string;
+ /* APPLE LOCAL pascal strings */
+ bool pascal_string;
expr.value = inside_init;
expr.original_code = (strict_string ? STRING_CST : ERROR_MARK);
maybe_warn_string_init (type, expr);
@@ -4154,16 +4297,24 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
= (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (inside_init)))
== char_type_node);
+ /* APPLE LOCAL begin pascal strings */
+ pascal_string
+ = (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (inside_init)))
+ == unsigned_char_type_node);
+ /* APPLE LOCAL end pascal strings */
+
if (comptypes (TYPE_MAIN_VARIANT (TREE_TYPE (inside_init)),
TYPE_MAIN_VARIANT (type)))
return inside_init;
- if (!wchar_array && !char_string)
+ /* APPLE LOCAL pascal strings */
+ if (!wchar_array && !pascal_string && !char_string)
{
error_init ("char-array initialized from wide string");
return error_mark_node;
}
- if (char_string && !char_array)
+ /* APPLE LOCAL pascal strings */
+ if ((char_string || pascal_string) && !char_array)
{
error_init ("wchar_t-array initialized from non-wide string");
return error_mark_node;
@@ -4296,6 +4447,34 @@ digest_init (tree type, tree init, bool strict_string, int require_constant)
if (flag_pedantic_errors)
inside_init = error_mark_node;
}
+ /* APPLE LOCAL begin AltiVec */
+ /* This test catches a Motorola-syntax Altivec vector
+ represented as a constructor of vector type. This tree
+ is not constant but can be initializer to a const vector. */
+ else if (require_constant
+ && (code == VECTOR_TYPE && TREE_CODE (init) == CONSTRUCTOR))
+ return inside_init;
+ else if (require_constant
+ && (code == VECTOR_TYPE && TREE_CODE (init) == NOP_EXPR))
+ {
+ /* User is using FSF style vector const. It must be converted to
+ VECTOR_CST so it is generated at assebly time. */
+ while (TREE_CODE (init) == NOP_EXPR)
+ init = TREE_OPERAND (init, 0);
+ if (TREE_CODE (init) == COMPOUND_LITERAL_EXPR)
+ {
+ init = COMPOUND_LITERAL_EXPR_DECL (init);
+ if (TREE_CODE (init) == VAR_DECL && DECL_INITIAL (init))
+ {
+ init = DECL_INITIAL (init);
+ if (TREE_CODE (init) == VECTOR_CST)
+ return convert (type, init);
+ }
+ }
+ error_init ("initializer element is not constant");
+ inside_init = error_mark_node;
+ }
+ /* APPLE LOCAL end AltiVec */
else if (require_constant
&& !initializer_constant_valid_p (inside_init,
TREE_TYPE (inside_init)))
@@ -6372,7 +6551,8 @@ build_asm_expr (tree string, tree outputs, tree inputs, tree clobbers,
get an error. Gross, but ... */
STRIP_NOPS (output);
- if (!lvalue_or_else (output, lv_asm))
+ /* APPLE LOCAL non lvalue assign */
+ if (!lvalue_or_else (&output, lv_asm))
output = error_mark_node;
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (tail)));
@@ -6460,6 +6640,120 @@ c_finish_goto_ptr (tree expr)
return add_stmt (build1 (GOTO_EXPR, void_type_node, expr));
}
+/* APPLE LOCAL begin CW asm blocks */
+int
+cw_asm_typename_or_reserved (tree value)
+{
+ return (C_IS_RESERVED_WORD (value));
+}
+
+/* Given a typename and a component, collect the component's offset.
+ Do this by creating a fake decl with that type and walking it
+ through the usual process. */
+
+tree
+cw_asm_c_build_component_ref (tree typename, tree component)
+{
+ tree val, type, fake_datum;
+ enum tree_code code;
+ tree field = NULL;
+ tree ref;
+
+ /* Intercept variables here and make a component ref instead. */
+ if (TREE_CODE (typename) == VAR_DECL)
+ {
+ return build_component_ref (typename, component);
+ }
+
+ val = lookup_name (typename);
+ if (val)
+ {
+ type = TREE_TYPE (val);
+ }
+ else
+ {
+ /* A structure tag will have been assumed to be a label; pick
+ out the original name. */
+ if (strncmp ("LASM", IDENTIFIER_POINTER (typename), 4) == 0)
+ {
+ char *pos = strchr (IDENTIFIER_POINTER (typename), '$');
+ typename = get_identifier (pos + 1);
+ }
+ type = lookup_struct_or_union_tag (typename);
+ if (!type)
+ {
+ error ("no structure or union tag named `%s'", IDENTIFIER_POINTER (typename));
+ return error_mark_node;
+ }
+ }
+
+ fake_datum = make_node (VAR_DECL);
+ TREE_TYPE (fake_datum) = type;
+
+ code = TREE_CODE (type);
+
+ /* See if there is a field or component with name COMPONENT. */
+
+ if (code == RECORD_TYPE || code == UNION_TYPE)
+ {
+ if (!COMPLETE_TYPE_P (type))
+ {
+ c_incomplete_type_error (NULL_TREE, type);
+ return error_mark_node;
+ }
+
+ field = lookup_field (fake_datum, component);
+
+ if (!field)
+ {
+ error ("%s has no member named `%s'",
+ code == RECORD_TYPE ? "structure" : "union",
+ IDENTIFIER_POINTER (component));
+ return error_mark_node;
+ }
+
+ /* Chain the COMPONENT_REFs if necessary down to the FIELD.
+ This might be better solved in future the way the C++ front
+ end does it - by giving the anonymous entities each a
+ separate name and type, and then have build_component_ref
+ recursively call itself. We can't do that here. */
+ for (; field; field = TREE_CHAIN (field))
+ {
+ tree subdatum = TREE_VALUE (field);
+
+ if (TREE_TYPE (subdatum) == error_mark_node)
+ return error_mark_node;
+
+ ref = build3 (COMPONENT_REF, TREE_TYPE (subdatum), fake_datum,
+ subdatum, NULL_TREE);
+
+ if (TREE_READONLY (fake_datum) || TREE_READONLY (subdatum))
+ TREE_READONLY (ref) = 1;
+ if (TREE_THIS_VOLATILE (fake_datum) || TREE_THIS_VOLATILE (subdatum))
+ TREE_THIS_VOLATILE (ref) = 1;
+
+ if (TREE_DEPRECATED (subdatum))
+ warn_deprecated_use (subdatum);
+
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ if (TREE_UNAVAILABLE (subdatum))
+ warn_unavailable_use (subdatum);
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
+
+ fake_datum = ref;
+ }
+
+ /* Return the field decl by itself. */
+ return TREE_OPERAND (ref, 1);
+ }
+ else if (code != ERROR_MARK)
+ error ("request for member `%s' in something not a structure or union",
+ IDENTIFIER_POINTER (component));
+
+ return error_mark_node;
+}
+/* APPLE LOCAL end CW asm blocks */
+
/* Generate a C `return' statement. RETVAL is the expression for what
to return, or a null pointer for `return;' with no value. */
diff --git a/gcc/c.opt b/gcc/c.opt
index 8267e0ee497..2c954c793e4 100644
--- a/gcc/c.opt
+++ b/gcc/c.opt
@@ -156,6 +156,12 @@ U
C ObjC C++ ObjC++ Joined Separate
-U<macro> Undefine <macro>
+; APPLE LOCAL begin -Wno-#warnings
+W#warnings
+C ObjC C++ ObjC++
+Enable #warning
+; APPLE LOCAL end -Wno-#warnings
+
Wabi
C++ ObjC++ Var(warn_abi)
Warn about things that will change when compiling with an ABI-compliant compiler
@@ -164,6 +170,12 @@ Wall
C ObjC C++ ObjC++
Enable most warning messages
+; APPLE LOCAL begin ObjC GC
+Wassign-intercept
+ObjC ObjC++ Var(warn_assign_intercept)
+Warn whenever an ObjC assignment is being intercepted by the garbage collector
+; APPLE LOCAL end ObjC GC
+
Wbad-function-cast
C ObjC Var(warn_bad_function_cast)
Warn about casting functions to incompatible types
@@ -188,6 +200,12 @@ Wconversion
C ObjC C++ ObjC++ Var(warn_conversion)
Warn about possibly confusing type conversions
+; APPLE LOCAL begin 64bit shorten warning 3865314
+Wshorten-64-to-32
+C ObjC C++ ObjC++ Var(warn_shorten_64_to_32)
+Warn if a value is implicitly converted from a 64 bit type to a 32 bit type
+; APPLE LOCAL end 64bit shorten warning 3865314
+
Wctor-dtor-privacy
C++ ObjC++ Var(warn_ctor_dtor_privacy)
Warn when all constructors and destructors are private
@@ -220,6 +238,12 @@ Werror-implicit-function-declaration
C ObjC RejectNegative
Make implicit function declarations an error
+; APPLE LOCAL begin -Wextra-tokens
+Wextra-tokens
+C ObjC C++ ObjC++
+Warn about extra tokens at the end of prepreprocessor directives
+; APPLE LOCAL end -Wextra-tokens
+
Wfloat-equal
C ObjC C++ ObjC++ Var(warn_float_equal)
Warn if testing floating point numbers for equality
@@ -251,6 +275,12 @@ Warn about zero-length formats
Wformat=
C ObjC C++ ObjC++ Joined
+; APPLE LOCAL begin -Wfour-char-constants
+Wfour-char-constants
+C ObjC C++ ObjC++
+Warn about multicharacter constants containing exactly four characters
+; APPLE LOCAL end -Wfour-char-constants
+
Winit-self
C ObjC C++ ObjC++ Var(warn_init_self)
Warn about variables which are initialized to themselves.
@@ -278,6 +308,12 @@ Winvalid-pch
C ObjC C++ ObjC++
Warn about PCH files that are found but not used
+; APPLE LOCAL begin -Wlong-double
+Wlong-double
+C ObjC C++ ObjC++
+Warn about \"long double\"
+; APPLE LOCAL end -Wlong-double
+
Wlong-long
C ObjC C++ ObjC++ Var(warn_long_long) Init(1)
Do not warn about using \"long long\" when -pedantic
@@ -310,6 +346,12 @@ Wmissing-prototypes
C ObjC Var(warn_missing_prototypes)
Warn about global functions without prototypes
+; APPLE LOCAL begin -Wmost
+Wmost
+C ObjC C++ ObjC++
+Like -Wall but without -Wparentheses
+; APPLE LOCAL end -Wmost
+
Wmultichar
C ObjC C++ ObjC++
Warn about use of multi-character character constants
@@ -318,6 +360,18 @@ Wnested-externs
C ObjC Var(warn_nested_externs)
Warn about \"extern\" declarations not at file scope
+; APPLE LOCAL begin -Wnewline-eof
+Wnewline-eof
+C ObjC C++ ObjC++
+Warn about files missing a newline at the end of the file
+; APPLE LOCAL end -Wnewline-eof
+
+; APPLE LOCAL begin non lvalue assign
+Wnon-lvalue-assign
+C ObjC C++ ObjC++ Var(warn_non_lvalue_assign) Init(1)
+Warn about assignment to casts and conditional expressions of lvalues
+; APPLE LOCAL end non lvalue assign
+
Wnon-template-friend
C++ ObjC++ Var(warn_nontemplate_friend) Init(1)
Warn when non-templatized friend functions are declared within a template
@@ -390,6 +444,12 @@ Wstrict-prototypes
C ObjC Var(warn_strict_prototypes)
Warn about unprototyped function declarations
+; APPLE LOCAL begin Objective-C
+Wstrict-selector-match
+ObjC ObjC++ Var(warn_strict_selector_match)
+Warn if type signatures of candidate methods do not match exactly
+; APPLE LOCAL end Objective-C
+
Wsynth
C++ ObjC++ Var(warn_synth)
Warn when synthesis behavior differs from Cfront
@@ -438,6 +498,12 @@ ansi
C ObjC C++ ObjC++
A synonym for -std=c89. In a future version of GCC it will become synonymous with -std=c99 instead
+; APPLE LOCAL begin fat builds
+arch
+C ObjC C++ ObjC++ Separate
+The architecture to build for.
+; APPLE LOCAL end fat builds
+
d
C ObjC C++ ObjC++ Joined
; Documented in common.opt. FIXME - what about -dI, -dD, -dN and -dD?
@@ -453,10 +519,36 @@ falt-external-templates
C++ ObjC++
Change when template instances are emitted
+; APPLE LOCAL begin Altivec 3837840
+faltivec
+C ObjC C++ ObjC++ Var(flag_faltivec)
+Enable Altivec
+; APPLE LOCAL end Altivec 3837840
+
fasm
C ObjC C++ ObjC++
Recognize the \"asm\" keyword
+; APPLE LOCAL begin CW asm blocks
+fasm-blocks
+C ObjC C++ ObjC++
+Handle CW-style assembly blocks
+; APPLE LOCAL end CW asm blocks
+
+; APPLE LOCAL begin -fast or -fastf or -fastcp
+fast
+C C++
+Used for c or c++ optimization
+
+fastcp
+C++
+Used when C++ specific optimization is needed
+
+fastf
+C
+Used when c is generated from NAG fortran
+; APPLE LOCAL end -fast or -fastf or -fastcp
+
fbuiltin
C ObjC C++ ObjC++
Recognize built-in functions
@@ -468,6 +560,12 @@ fcheck-new
C++ ObjC++
Check the return value of new
+; APPLE LOCAL begin structor decloning
+fclone-structors
+C++ ObjC++
+Factor out certain duplicate code in constructors and destructors
+; APPLE LOCAL end structor decloning
+
fcond-mismatch
C ObjC C++ ObjC++
Allow the arguments of the '?' operator to have different types
@@ -488,6 +586,12 @@ fdefault-inline
C++ ObjC++
Inline member functions by default
+; APPLE LOCAL begin disable_typechecking_for_spec_flag
+fdisable-typechecking-for-spec
+C C++
+Make crossfile type mismatches warnings not errors (for SPEC)
+; APPLE LOCAL end disable_typechecking_for_spec_flag
+
fdollars-in-identifiers
C ObjC C++ ObjC++
Permit '$' as an identifier character
@@ -586,16 +690,40 @@ fnil-receivers
ObjC ObjC++
Assume that receivers of Objective-C messages may be nil
+; APPLE LOCAL begin non lvalue assign
+fnon-lvalue-assign
+C ObjC C++ ObjC++ Var(flag_non_lvalue_assign) Init(1)
+Allow assignment to casts and conditional expressions of lvalues
+; APPLE LOCAL end non lvalue assign
+
fnonansi-builtins
C++ ObjC++
fnonnull-objects
C++ ObjC++
+; APPLE LOCAL begin ObjC C++ ivars
+fobjc-call-cxx-cdtors
+ObjC++
+Generate special ObjC methods to initialize/destroy non-POD C++ ivars, if needed
+; APPLE LOCAL end ObjC C++ ivars
+
+; APPLE LOCAL begin ObjC direct dispatch
+fobjc-direct-dispatch
+ObjC ObjC++ Var(flag_objc_direct_dispatch)
+Allow fast jumps (via comm page) to the message dispatcher
+; APPLE LOCAL end ObjC direct dispatch
+
fobjc-exceptions
ObjC ObjC++
Enable Objective-C exception and synchronization syntax
+; APPLE LOCAL begin ObjC GC
+fobjc-gc
+ObjC ObjC++ Var(flag_objc_gc)
+Enable garbage collection (GC) in ObjC/ObjC++ programs
+; APPLE LOCAL end ObjC GC
+
fobjc-sjlj-exceptions
ObjC ObjC++
Enable Objective-C setjmp exception handling runtime
diff --git a/gcc/calls.c b/gcc/calls.c
index 291f88cb835..ed001324830 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -135,7 +135,8 @@ static void initialize_argument_information (int, struct arg_data *,
struct args_size *, int, tree,
tree, CUMULATIVE_ARGS *, int,
rtx *, int *, int *, int *,
- bool *, bool);
+ /* APPLE LOCAL Altivec */
+ bool *, bool, tree);
static void compute_argument_addresses (struct arg_data *, rtx, int);
static rtx rtx_for_function_call (tree, tree);
static void load_register_parameters (struct arg_data *, int, rtx *, int,
@@ -262,7 +263,15 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
and we don't want to load it into a register as an optimization,
because prepare_call_address already did it if it should be done. */
if (GET_CODE (funexp) != SYMBOL_REF)
+/* APPLE LOCAL begin use R12 as register for indirect calls */
+/* This improves codegen (computation of value will be into R12) and
+ makes indirect sibcalls possible by ensuring a volatile reg is used. */
+#ifdef MAGIC_INDIRECT_CALL_REG
+ funexp = gen_rtx_REG (Pmode, MAGIC_INDIRECT_CALL_REG);
+#else
funexp = memory_address (FUNCTION_MODE, funexp);
+#endif
+/* APPLE LOCAL end use R12 as register for indirect calls */
#if defined (HAVE_sibcall_pop) && defined (HAVE_sibcall_value_pop)
if ((ecf_flags & ECF_SIBCALL)
@@ -408,6 +417,23 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED,
SIBLING_CALL_P (call_insn) = ((ecf_flags & ECF_SIBCALL) != 0);
+ /* APPLE LOCAL begin ObjC direct dispatch */
+ /* Annotate calls to functions with fixed addresses. */
+ if (fndecl && TREE_CODE (fndecl) == FUNCTION_DECL)
+ {
+ tree t = lookup_attribute ("hard_coded_address",
+ DECL_ATTRIBUTES (fndecl));
+ if (t)
+ /* The constant address stored here has only 32 bits. This
+ is not a limitation, because the bla instruction has an
+ architectural limit of 26 bits. */
+ REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_ABSCALL,
+ gen_rtx_CONST_INT (FUNCTION_MODE,
+ tree_low_cst (TREE_VALUE (t), 0)),
+ REG_NOTES (call_insn));
+ }
+ /* APPLE LOCAL end ObjC direct dispatch */
+
/* Restore this now, so that we do defer pops for this call's args
if the context of the call as a whole permits. */
inhibit_defer_pop = old_inhibit_defer_pop;
@@ -930,7 +956,10 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
int reg_parm_stack_space,
rtx *old_stack_level, int *old_pending_adj,
int *must_preallocate, int *ecf_flags,
- bool *may_tailcall, bool call_from_thunk_p)
+ /* APPLE LOCAL begin Altivec */
+ bool *may_tailcall, bool call_from_thunk_p,
+ tree type_arg_types)
+ /* APPLE LOCAL end Altivec */
{
/* 1 if scanning parms front to back, -1 if scanning back to front. */
int inc;
@@ -941,6 +970,12 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
int i;
tree p;
+ /* APPLE LOCAL begin Altivec */
+ int pass, last_pass;
+ int save_i, save_inc;
+ int stdarg;
+ /* APPLE LOCAL end Altivec */
+
args_size->constant = 0;
args_size->var = 0;
@@ -959,13 +994,31 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
i = 0, inc = 1;
}
- /* I counts args in order (to be) pushed; ARGPOS counts in order written. */
- for (p = actparms, argpos = 0; p; p = TREE_CHAIN (p), i += inc, argpos++)
+ /* APPLE LOCAL begin Altivec */
+ stdarg = (type_arg_types != 0
+ && TREE_VALUE (tree_last (type_arg_types)) != void_type_node);
+ last_pass = 1;
+ save_i = i;
+ save_inc = inc;
+ for (pass = 1; pass <= last_pass; pass++)
+ {
+ i = save_i;
+ inc = save_inc;
+ /* I counts args in order (to be) pushed; ARGPOS counts in order written. */
+ for (p = actparms, argpos = 0; p; p = TREE_CHAIN (p), i += inc, argpos++)
+ /* APPLE LOCAL end Altivec */
{
tree type = TREE_TYPE (TREE_VALUE (p));
int unsignedp;
enum machine_mode mode;
+ /* APPLE LOCAL begin Altivec */
+ /* In 1st iteration over actual arguments, only consider non-vectors.
+ During 2nd iteration, finish off with vector parameters. */
+ if (!stdarg && targetm.calls.skip_vec_args (type, pass, &last_pass))
+ continue;
+ /* APPLE LOCAL end Altivec */
+
args[i].tree_value = TREE_VALUE (p);
/* Replace erroneous argument with constant zero. */
@@ -1148,6 +1201,9 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
FUNCTION_ARG_ADVANCE (*args_so_far, TYPE_MODE (type), type,
argpos < n_named_args);
}
+ /* APPLE LOCAL begin Altivec */
+ }
+ /* APPLE LOCAL end Altivec */
}
/* Update ARGS_SIZE to contain the total size for the argument block.
@@ -1545,6 +1601,8 @@ load_register_parameters (struct arg_data *args, int num_actuals,
&& args[i].locate.where_pad == downward
#else
&& BYTES_BIG_ENDIAN
+ /* APPLE LOCAL fix to regression caused by PR 14262 */
+ && !args[i].pass_on_stack
#endif
)
{
@@ -1802,12 +1860,20 @@ expand_call (tree exp, rtx target, int ignore)
tree actparms = TREE_OPERAND (exp, 1);
/* RTX for the function to be called. */
rtx funexp;
+ /* APPLE LOCAL begin use R12 as register for indirect calls */
+ /* A single rtx to be shared among multiple chains for indirect sibcalls */
+ rtx funexp_keep = NULL_RTX;
+ /* APPLE LOCAL end use R12 as register for indirect calls */
/* Sequence of insns to perform a normal "call". */
rtx normal_call_insns = NULL_RTX;
/* Sequence of insns to perform a tail "call". */
rtx tail_call_insns = NULL_RTX;
/* Data type of the function. */
tree funtype;
+ /* APPLE LOCAL begin objc stret methods */
+ /* Return type of the function. */
+ tree saved_return_type;
+ /* APPLE LOCAL end objc stret methods */
tree type_arg_types;
/* Declaration of the function being called,
or 0 if the function is computed (not known by name). */
@@ -2025,6 +2091,17 @@ expand_call (tree exp, rtx target, int ignore)
gcc_assert (POINTER_TYPE_P (funtype));
funtype = TREE_TYPE (funtype);
+ /* APPLE LOCAL begin objc stret methods */
+ /* Set the return type of the function to the type of the call expression,
+ in case that's different from the function declaration.
+ (This is the case when calling _objc_msgSend_stret, for example,
+ which is declared to return id, but actually returns a struct.)
+ But save the original return type first, so it can be restored later
+ in case it's needed. */
+ saved_return_type = TREE_TYPE (funtype);
+ TREE_TYPE (funtype) = TREE_TYPE (exp);
+ /* APPLE LOCAL end objc stret methods */
+
/* Munge the tree to split complex arguments into their imaginary
and real parts. */
if (targetm.calls.split_complex_arg)
@@ -2127,7 +2204,10 @@ expand_call (tree exp, rtx target, int ignore)
&args_so_far, reg_parm_stack_space,
&old_stack_level, &old_pending_adj,
&must_preallocate, &flags,
- &try_tail_call, CALL_FROM_THUNK_P (exp));
+ /* APPLE LOCAL begin Altivec */
+ &try_tail_call, CALL_FROM_THUNK_P (exp),
+ type_arg_types);
+ /* APPLE LOCAL end Altivec */
if (args_size.var)
{
@@ -2181,6 +2261,20 @@ expand_call (tree exp, rtx target, int ignore)
It does not seem worth the effort since few optimizable
sibling calls will return a structure. */
|| structure_value_addr != NULL_RTX
+/* APPLE LOCAL begin indirect sibcalls */
+#ifndef MAGIC_INDIRECT_CALL_REG
+/* The register holding the address is now always R12, so
+ we can consider indirect calls as sibcall candidates on ppc. */
+ /* If the register holding the address is a callee saved
+ register, then we lose. We have no way to prevent that,
+ so we only allow calls to named functions. */
+ /* ??? This could be done by having the insn constraints
+ use a register class that is all call-clobbered. Any
+ reload insns generated to fix things up would appear
+ before the sibcall_epilogue. */
+ || fndecl == NULL_TREE
+#endif
+/* APPLE LOCAL end indirect sibcalls */
/* Check whether the target is able to optimize the call
into a sibcall. */
|| !targetm.function_ok_for_sibcall (fndecl, exp)
@@ -2215,6 +2309,15 @@ expand_call (tree exp, rtx target, int ignore)
preferred_unit_stack_boundary = preferred_stack_boundary / BITS_PER_UNIT;
+ /* APPLE LOCAL begin indirect sibcalls */
+ /* Do this before creating the chains, to avoid a branch within them.
+ The paired chains both branch to the same label, but only one
+ chain has a definition of that label, because of the way the
+ infrastructure works. */
+ if ( !fndecl )
+ funexp_keep = rtx_for_function_call (fndecl, addr);
+ /* APPLE LOCAL end indirect sibcalls */
+
/* We want to make two insn chains; one for a sibling call, the other
for a normal call. We will select one of the two chains after
initial RTL generation is complete. */
@@ -2524,7 +2627,12 @@ expand_call (tree exp, rtx target, int ignore)
be deferred during the evaluation of the arguments. */
NO_DEFER_POP;
- funexp = rtx_for_function_call (fndecl, addr);
+ /* APPLE LOCAL begin indirect sibcalls */
+ if ( !fndecl )
+ funexp = funexp_keep;
+ else
+ funexp = rtx_for_function_call (fndecl, addr);
+ /* APPLE LOCAL end indirect sibcalls */
/* Figure out the register where the value, if any, will come back. */
valreg = 0;
@@ -2659,6 +2767,24 @@ expand_call (tree exp, rtx target, int ignore)
next_arg_reg = FUNCTION_ARG (args_so_far, VOIDmode,
void_type_node, 1);
+ /* APPLE LOCAL begin indirect calls in R12 */
+#ifdef MAGIC_INDIRECT_CALL_REG
+ /* For indirect calls, put the callee address in R12. This is necessary
+ for ObjC methods. This could be handled by patterns in rs6000.md,
+ as in 2.95, but it is better to put this copy in the RTL so the
+ optimizer can see it, and sometimes get rid of it, and the scheduler
+ can move it around. Right now none of these good things seems to
+ happen, but this should be fixable. (But note FSF won't like
+ putting it here.) */
+ if (!fndecl)
+ {
+ rtx magic_reg = gen_rtx_REG (Pmode, MAGIC_INDIRECT_CALL_REG);
+ emit_move_insn (magic_reg, funexp);
+ use_reg (&call_fusage, magic_reg);
+ }
+#endif
+ /* APPLE LOCAL end indirect calls in R12 */
+
/* All arguments and registers used for the call must be set up by
now! */
@@ -2686,6 +2812,12 @@ expand_call (tree exp, rtx target, int ignore)
valreg = gen_rtx_REG (TYPE_MODE (TREE_TYPE (exp)), REGNO (valreg));
}
+ /* APPLE LOCAL begin objc stret methods */
+ /* Restore the function's original return type
+ in case it's needed later on. */
+ TREE_TYPE (funtype) = saved_return_type;
+ /* APPLE LOCAL end objc stret methods */
+
/* If call is cse'able, make appropriate pair of reg-notes around it.
Test valreg so we don't crash; may safely ignore `const'
if return type is void. Disable for PARALLEL return values, because
@@ -3002,6 +3134,24 @@ expand_call (tree exp, rtx target, int ignore)
== stack_pointer_delta - pending_stack_adjust));
}
+ /* APPLE LOCAL begin sibcall optimization stomped CW frames (radar 3007352) */
+ /* GCC for PPC on Darwin has always rounded 'current_function_args_size' up to a multiple of 16.
+ CodeWarrior doesn't.
+ A father() that passes, say, 40 bytes of parameters to daughter() will have eight bytes of
+ padding if compiled with GCC, and zero bytes of padding if compiled with CW.
+ If a GCC-compiled daughter() in turn sibcalls to granddaughter() with, say, 44 bytes of parameters,
+ GCC will generate a store of that extra parameter into padding of the father() parameter area.
+ Alas, if father() was compild by CW, father() will not have the parameter area padding,
+ and something in the father() stackframe will be stomped.
+ Parameter areas are guaranteed to be a minimum of 32 bytes. See Radar 3007352. */
+ if ( ( ! sibcall_failure)
+ && args_size.constant > 32
+ && args_size.constant > cfun->unrounded_args_size)
+ {
+ sibcall_failure = 1;
+ }
+ /* APPLE LOCAL end sibcall optimization stomped CW frames (radar 3007352) */
+
/* If something prevents making this a sibling call,
zero out the sequence. */
if (sibcall_failure)
diff --git a/gcc/cfghooks.c b/gcc/cfghooks.c
index 0f0c230fb80..12ffdc87263 100644
--- a/gcc/cfghooks.c
+++ b/gcc/cfghooks.c
@@ -320,6 +320,10 @@ edge
split_block (basic_block bb, void *i)
{
basic_block new_bb;
+ /* APPLE LOCAL begin lno */
+ bool irr = (bb->flags & BB_IRREDUCIBLE_LOOP) != 0;
+ int flags = EDGE_FALLTHRU;
+ /* APPLE LOCAL end lno */
if (!cfg_hooks->split_block)
internal_error ("%s does not support split_block.", cfg_hooks->name);
@@ -331,7 +335,14 @@ split_block (basic_block bb, void *i)
new_bb->count = bb->count;
new_bb->frequency = bb->frequency;
new_bb->loop_depth = bb->loop_depth;
-
+ /* APPLE LOCAL begin lno */
+ if (irr)
+ {
+ new_bb->flags |= BB_IRREDUCIBLE_LOOP;
+ flags |= EDGE_IRREDUCIBLE_LOOP;
+ }
+ /* APPLE LOCAL end lno */
+
if (dom_info_available_p (CDI_DOMINATORS))
{
redirect_immediate_dominators (CDI_DOMINATORS, bb, new_bb);
@@ -451,6 +462,15 @@ split_edge (edge e)
}
};
+ /* APPLE LOCAL begin lno */
+ if (irr)
+ {
+ ret->flags |= BB_IRREDUCIBLE_LOOP;
+ EDGE_PRED (ret, 0)->flags |= EDGE_IRREDUCIBLE_LOOP;
+ EDGE_SUCC (ret, 0)->flags |= EDGE_IRREDUCIBLE_LOOP;
+ }
+ /* APPLE LOCAL end lno */
+
return ret;
}
@@ -570,6 +590,8 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
edge e, fallthru;
edge_iterator ei;
basic_block dummy, jump;
+ /* APPLE LOCAL lno */
+ bool fst_irr = false;
if (!cfg_hooks->make_forwarder_block)
internal_error ("%s does not support make_forwarder_block.",
@@ -584,6 +606,8 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
{
if (redirect_edge_p (e))
{
+ /* APPLE LOCAL lno */
+ fst_irr |= (e->flags & EDGE_IRREDUCIBLE_LOOP) != 0;
ei_next (&ei);
continue;
}
@@ -603,6 +627,14 @@ make_forwarder_block (basic_block bb, bool (*redirect_edge_p) (edge),
new_bb_cbk (jump);
}
+ /* APPLE LOCAL begin lno */
+ if (!fst_irr)
+ {
+ dummy->flags &= ~BB_IRREDUCIBLE_LOOP;
+ fallthru->flags &= ~EDGE_IRREDUCIBLE_LOOP;
+ }
+ /* APPLE LOCAL end lno */
+
if (dom_info_available_p (CDI_DOMINATORS))
{
basic_block doms_to_fix[2];
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 241e97628e3..444cb60b2c7 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -1072,6 +1072,8 @@ duplicate_insn_chain (rtx from, rtx to)
code. */
extern basic_block cfg_layout_duplicate_bb (basic_block);
+/* APPLE LOCAL lno */
+extern basic_block cfg_layout_duplicate_bb (basic_block);
basic_block
cfg_layout_duplicate_bb (basic_block bb)
{
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 26a9cdee898..e6a41a76be4 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -960,7 +960,13 @@ flow_loops_find (struct loops *loops, int flags)
loops->num = num_loops;
initialize_loops_parallel_p (loops);
+/* APPLE LOCAL begin lno */
}
+ else
+ {
+ free_dominance_info (CDI_DOMINATORS);
+ }
+/* APPLE LOCAL end lno */
sbitmap_free (headers);
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index 8de76449941..8eef27d66c8 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -2303,6 +2303,14 @@ purge_dead_edges (basic_block bb)
{
if (can_throw_internal (BB_END (bb)))
{
+ /* APPLE LOCAL begin lno */
+ /* If the call was removed/moved somewhere else, cleanup the
+ EDGE_ABNORMAL_CALL flag. */
+ if ((e->flags & EDGE_ABNORMAL_CALL)
+ && GET_CODE (BB_END (bb)) != CALL_INSN)
+ e->flags &= ~EDGE_ABNORMAL_CALL;
+ /* APPLE LOCAL end lno */
+
ei_next (&ei);
continue;
}
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 7d1cca20df1..f280d2e3986 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -95,6 +95,8 @@ The varpool data structure:
#include "varray.h"
#include "output.h"
#include "intl.h"
+/* APPLE LOCAL Selective inlining of functions that use Altivec 3837835 */
+#include "function.h"
/* Hash table used to convert declarations into nodes. */
static GTY((param_is (struct cgraph_node))) htab_t cgraph_hash;
@@ -511,6 +513,10 @@ dump_cgraph_node (FILE *f, struct cgraph_node *node)
fprintf (f, " inlinable");
if (TREE_ASM_WRITTEN (node->decl))
fprintf (f, " asm_written");
+ /* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+ if (DECL_STRUCT_FUNCTION (node->decl) && DECL_STRUCT_FUNCTION (node->decl)->uses_vector)
+ fprintf (f, " uses_vector");
+ /* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
fprintf (f, "\n called by: ");
for (edge = node->callers; edge; edge = edge->next_caller)
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 22b33816caa..9ecf22b66f1 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -200,6 +200,10 @@ static void cgraph_mark_local_functions (void);
static bool cgraph_default_inline_p (struct cgraph_node *n);
static void cgraph_analyze_function (struct cgraph_node *node);
static void cgraph_decide_inlining_incrementally (struct cgraph_node *);
+/* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+static bool altivec_infection (struct cgraph_edge *);
+static bool fndecl_uses_vector_p (tree);
+/* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
/* Statistics we collect about inlining algorithm. */
static int ncalls_inlined;
@@ -398,6 +402,35 @@ cgraph_finalize_function (tree decl, bool nested)
do_warn_unused_parameter (decl);
}
+/* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+static bool
+fndecl_uses_vector_p (tree fndecl)
+{
+ tree arg, vars, var;
+ struct function *my_cfun = DECL_STRUCT_FUNCTION (fndecl);
+
+ if (TREE_CODE (TREE_TYPE (fndecl)) == VECTOR_TYPE)
+ return true;
+
+ arg = DECL_ARGUMENTS (fndecl);
+ while (arg)
+ {
+ if (TREE_CODE (TREE_TYPE (arg)) == VECTOR_TYPE)
+ return true;
+ arg = TREE_CHAIN (arg);
+ }
+
+ for (vars = my_cfun->unexpanded_var_list; vars; vars = TREE_CHAIN (vars))
+ {
+ var = TREE_VALUE (vars);
+ if (TREE_CODE (TREE_TYPE (var)) == VECTOR_TYPE)
+ return true;
+ }
+ /* Treewalk part folded into record_call_1 below. */
+ return false;
+}
+/* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
+
/* Walk tree and record all calls. Called via walk_tree. */
static tree
record_call_1 (tree *tp, int *walk_subtrees, void *data)
@@ -407,6 +440,15 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data)
switch (TREE_CODE (t))
{
case VAR_DECL:
+ /* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+ {
+ struct cgraph_node *node = (struct cgraph_node *)data;
+ struct function *my_cfun = DECL_STRUCT_FUNCTION (node->decl);
+
+ if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
+ my_cfun->uses_vector = 1;
+ }
+ /* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
/* ??? Really, we should mark this decl as *potentially* referenced
by this function and re-examine whether the decl is actually used
after rtl has been generated. */
@@ -473,6 +515,11 @@ record_call_1 (tree *tp, int *walk_subtrees, void *data)
void
cgraph_create_edges (struct cgraph_node *node, tree body)
{
+ /* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+ if (!DECL_STRUCT_FUNCTION (node->decl)->uses_vector)
+ DECL_STRUCT_FUNCTION (node->decl)->uses_vector = fndecl_uses_vector_p (node->decl);
+ /* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
+
/* The nodes we're interested in are never shared, so walk
the tree ignoring duplicates. */
visited_nodes = pointer_set_create ();
@@ -1085,6 +1132,32 @@ cgraph_clone_inlined_nodes (struct cgraph_edge *e, bool duplicate)
cgraph_clone_inlined_nodes (e, duplicate);
}
+/* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+/* Return TRUE if the given edge represents a CALL from a
+ non-Altivec-using function to another that does. We must not
+ inline these CALLs, lest we infect a virgin G3-executable function
+ with AltiVec codes (e.g. prolog & epilog). Only active if
+ -faltivec and not -maltivec. */
+static bool
+altivec_infection (struct cgraph_edge *edge)
+{
+ if (flag_disable_opts_for_faltivec
+ && edge
+ && edge->caller
+ && !DECL_STRUCT_FUNCTION (edge->caller->decl)->uses_vector
+ && edge->callee
+ && DECL_STRUCT_FUNCTION (edge->callee->decl)
+ && DECL_STRUCT_FUNCTION (edge->callee->decl)->uses_vector)
+ {
+ edge->inline_failed = N_(" -faltivec on, callee has AltiVec(tm), caller doesn't; not inlined. Use -maltivec to allow.\n");
+ return true;
+ }
+ else
+ return false;
+}
+/* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
+
+
/* Mark edge E as inlined and update callgraph accordingly. */
void
@@ -1419,6 +1492,8 @@ cgraph_decide_inlining_of_small_functions (void)
if (cgraph_recursive_inlining_p (e->caller, e->callee,
&e->inline_failed)
+ /* APPLE LOCAL Selective inlining of functions that use Altivec 3837835 */
+ || altivec_infection (e)
|| !cgraph_check_inline_limits (e->caller, e->callee,
&e->inline_failed))
{
@@ -1565,6 +1640,14 @@ cgraph_decide_inlining (void)
node->callers->caller->global.insns);
old_insns = overall_insns;
+ /* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+ if (altivec_infection (node->callers))
+ {
+ if (cgraph_dump_file)
+ fprintf (cgraph_dump_file, node->callers->inline_failed);
+ continue;
+ }
+ /* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
if (cgraph_check_inline_limits (node->callers->caller, node,
NULL))
@@ -1613,6 +1696,11 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node)
/* First of all look for always inline functions. */
for (e = node->callees; e; e = e->next_callee)
+ /* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+ if (altivec_infection (e))
+ continue;
+ else
+ /* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
if (e->callee->local.disregard_inline_limits
&& e->inline_failed
&& !cgraph_recursive_inlining_p (node, e->callee, &e->inline_failed)
@@ -1631,6 +1719,10 @@ cgraph_decide_inlining_incrementally (struct cgraph_node *node)
&& cgraph_check_inline_limits (node, e->callee, &e->inline_failed)
&& DECL_SAVED_TREE (e->callee->decl))
{
+ /* APPLE LOCAL begin Selective inlining of functions that use Altivec 3837835 */
+ if (altivec_infection (e))
+ continue;
+ /* APPLE LOCAL end Selective inlining of functions that use Altivec 3837835 */
if (cgraph_default_inline_p (e->callee))
cgraph_mark_inline (e);
else
@@ -1842,7 +1934,8 @@ cgraph_build_static_cdtor (char which, tree body, int priority)
TREE_STATIC (decl) = 1;
TREE_USED (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
- DECL_IGNORED_P (decl) = 1;
+ /* APPLE LOCAL Radar 3939078 */
+ /* Delete DECL_IGNORED_P (decl) = 1; */
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (decl) = 1;
DECL_SAVED_TREE (decl) = body;
TREE_PUBLIC (decl) = ! targetm.have_ctors_dtors;
diff --git a/gcc/common.opt b/gcc/common.opt
index 10d157ede7d..d66003eeedf 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -161,6 +161,11 @@ Wunused-variable
Common Var(warn_unused_variable)
Warn when a variable is unused
+; APPLE LOCAL begin fat builds
+arch
+Common Separate
+; APPLE LOCAL end fat builds
+
aux-info
Common Separate
-aux-info <file> Emit declaration information into <file>
@@ -224,6 +229,15 @@ Align the start of loops
falign-loops=
Common RejectNegative Joined UInteger
+; APPLE LOCAL begin predictive compilation
+fpredictive-compilation
+Common
+Predictive Compilation
+
+fpredictive-compilation=
+Common RejectNegative Joined UInteger
+; APPLE LOCAL end predictive compilation
+
; This flag is only tested if alias checking is enabled.
; 0 if pointer arguments may alias each other. True in C.
; 1 if pointer arguments may not alias each other but may alias
@@ -298,6 +312,12 @@ fcprop-registers
Common Report Var(flag_cprop_registers)
Perform a register copy-propagation optimization pass
+; APPLE LOCAL begin new profiling flag
+fcreate-profile
+Common
+Enable common options for generating profile info for profile feedback directed optimizations
+; APPLE LOCAL end new profiling flag
+
fcrossjumping
Common Report Var(flag_crossjumping)
Perform cross-jumping optimization
@@ -496,6 +516,12 @@ floop-optimize2
Common Report Var(flag_loop_optimize2)
Perform loop optimizations using the new loop optimizer
+; APPLE LOCAL begin lno
+floop-test
+Common Report Var(flag_tree_ssa_loop_test)
+Run loop optimizer tests
+; APPLE LOCAL end lno
+
fmath-errno
Common Report Var(flag_errno_math) Init(1)
Set errno after built-in math functions
@@ -547,6 +573,12 @@ fnon-call-exceptions
Common Report Var(flag_non_call_exceptions)
Support synchronous non-call exceptions
+; APPLE LOCAL begin -fobey-inline
+fobey-inline
+Common Report Var(flag_obey_inline) VarExists
+Obey 'inline' keyword and always inline, regardless of size
+; APPLE LOCAL end -fobey-inline
+
fomit-frame-pointer
Common Report Var(flag_omit_frame_pointer)
When possible do not generate stack frames
@@ -563,6 +595,12 @@ fpack-struct
Common Report Var(flag_pack_struct)
Pack structure members together without holes
+; APPLE LOCAL begin pascal strings
+fpascal-strings
+Common
+Allow Pascal-style string literals
+; APPLE LOCAL end pascal strings
+
fpack-struct=
Common RejectNegative Joined UInteger
-fpack-struct=<number> Set initial maximum structure member alignment
@@ -599,6 +637,12 @@ fpie
Common Report Var(flag_pie,1) VarExists
Generate position-independent code for executables if possible (small mode)
+; APPLE LOCAL begin -ffppc 2001-08-01 --sts
+fppc
+Common Var(flag_fppc) VarExists
+Perform floating-point precision-control pass
+; APPLE LOCAL end -ffppc 2001-08-01 --sts
+
fprefetch-loop-arrays
Common Report Var(flag_prefetch_loop_arrays)
Generate prefetch instructions, if available, for arrays in loops
@@ -860,6 +904,12 @@ ftree-loop-ivcanon
Common Report Var(flag_tree_loop_ivcanon) Init(1)
Create canonical induction variables in loops
+; APPLE LOCAL begin loops-to-memset
+ftree-loop-memset
+Common Report Var(flag_tree_loop_memset) Init(0)
+Transform appropriate loops to memset calls
+; APPLE LOCAL end loops-to-memset
+
ftree-loop-optimize
Common Report Var(flag_tree_loop_optimize) Init(1)
Enable loop optimizations on tree level
@@ -908,6 +958,12 @@ funwind-tables
Common Report Var(flag_unwind_tables)
Just generate unwind tables for exception handling
+; APPLE LOCAL begin new profiling flag
+fuse-profile
+Common
+Enable common options for performing profile feedback directed optimizations
+; APPLE LOCAL end new profiling flag
+
fvar-tracking
Common Report Var(flag_var_tracking) VarExists
Perform variable tracking
@@ -947,6 +1003,18 @@ fwrapv
Common Report Var(flag_wrapv)
Assume signed arithmetic overflow wraps around
+; APPLE LOCAL begin fwritable strings
+fwritable-strings
+Common Report Var(flag_writable_strings) VarExists
+Store strings in writable data section
+; APPLE LOCAL end fwritable strings
+
+; APPLE LOCAL begin KEXT
+fapple-kext
+C++ Report Var(flag_apple_kext)
+Generate code for darwin loadable kernel extentions
+; APPLE LOCAL end KEXT
+
fzero-initialized-in-bss
Common Report Var(flag_zero_initialized_in_bss) Init(1)
Put zero initialized data in the bss section
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 51300e25e5b..7553a3f2b9a 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1546,9 +1546,16 @@ powerpc-*-beos*)
extra_headers=
use_fixproto=yes
;;
-powerpc-*-darwin*)
+# APPLE LOCAL begin mainline
+powerpc-*-darwin[0-9]*)
tm_file="${tm_file} rs6000/darwin.h"
tmake_file="${tmake_file} rs6000/t-darwin"
+ case ${target} in
+ *-darwin1[0-9]*) tmake_file="${tmake_file} rs6000/t-darwin8" ;;
+ *-darwin[0-7]*) ;;
+ *-darwin[8-9]*) tmake_file="${tmake_file} rs6000/t-darwin8" ;;
+ esac
+# APPLE LOCAL end mainline
extra_headers=altivec.h
;;
powerpc*-*-freebsd*)
diff --git a/gcc/config/darwin-c.c b/gcc/config/darwin-c.c
index feb26f185d2..320dd5d2b64 100644
--- a/gcc/config/darwin-c.c
+++ b/gcc/config/darwin-c.c
@@ -32,42 +32,83 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "cppdefault.h"
#include "prefix.h"
+/* APPLE LOCAL include options.h */
+#include "options.h"
/* Pragmas. */
#define BAD(msgid) do { warning (msgid); return; } while (0)
+/* APPLE LOCAL Macintosh alignment 2002-1-22 --ff */
+#define BAD2(msgid, arg) do { warning (msgid, arg); return; } while (0)
static bool using_frameworks = false;
+/* APPLE LOCAL begin CALL_ON_LOAD/CALL_ON_UNLOAD pragmas 20020202 --turly */
+static void directive_with_named_function (const char *, void (*sec_f)(void));
+/* APPLE LOCAL end CALL_ON_LOAD/CALL_ON_UNLOAD pragmas 20020202 --turly */
+
/* Maintain a small stack of alignments. This is similar to pragma
pack's stack, but simpler. */
-static void push_field_alignment (int);
+/* APPLE LOCAL begin Macintosh alignment 2001-12-17 --ff */
+static void push_field_alignment (int, int, int);
+/* APPLE LOCAL end Macintosh alignment 2001-12-17 --ff */
static void pop_field_alignment (void);
static const char *find_subframework_file (const char *, const char *);
static void add_system_framework_path (char *);
static const char *find_subframework_header (cpp_reader *pfile, const char *header,
cpp_dir **dirp);
+/* APPLE LOCAL begin Macintosh alignment 2002-1-22 --ff */
+/* There are four alignment modes supported on the Apple Macintosh
+ platform: power, mac68k, natural, and packed. These modes are
+ identified as follows:
+ if maximum_field_alignment != 0
+ mode = packed
+ else if TARGET_ALIGN_NATURAL
+ mode = natural
+ else if TARGET_ALIGN_MAC68K
+ mode
+ else
+ mode = power
+ These modes are saved on the alignment stack by saving the values
+ of maximum_field_alignment, TARGET_ALIGN_MAC68K, and
+ TARGET_ALIGN_NATURAL. */
typedef struct align_stack
{
int alignment;
+ unsigned long mac68k;
+ unsigned long natural;
struct align_stack * prev;
} align_stack;
+/* APPLE LOCAL end Macintosh alignment 2002-1-22 --ff */
static struct align_stack * field_align_stack = NULL;
+/* APPLE LOCAL begin Macintosh alignment 2001-12-17 --ff */
static void
-push_field_alignment (int bit_alignment)
+push_field_alignment (int bit_alignment,
+ int mac68k_alignment, int natural_alignment)
{
align_stack *entry = (align_stack *) xmalloc (sizeof (align_stack));
entry->alignment = maximum_field_alignment;
+ entry->mac68k = TARGET_ALIGN_MAC68K;
+ entry->natural = TARGET_ALIGN_NATURAL;
entry->prev = field_align_stack;
field_align_stack = entry;
maximum_field_alignment = bit_alignment;
+ if (mac68k_alignment)
+ rs6000_alignment_flags |= MASK_ALIGN_MAC68K;
+ else
+ rs6000_alignment_flags &= ~MASK_ALIGN_MAC68K;
+ if (natural_alignment)
+ rs6000_alignment_flags |= MASK_ALIGN_NATURAL;
+ else
+ rs6000_alignment_flags &= ~MASK_ALIGN_NATURAL;
}
+/* APPLE LOCAL end Macintosh alignment 2001-12-17 --ff */
static void
pop_field_alignment (void)
@@ -77,6 +118,16 @@ pop_field_alignment (void)
align_stack *entry = field_align_stack;
maximum_field_alignment = entry->alignment;
+/* APPLE LOCAL begin Macintosh alignment 2001-12-17 --ff */
+ if (entry->mac68k)
+ rs6000_alignment_flags |= MASK_ALIGN_MAC68K;
+ else
+ rs6000_alignment_flags &= ~MASK_ALIGN_MAC68K;
+ if (entry->natural)
+ rs6000_alignment_flags |= MASK_ALIGN_NATURAL;
+ else
+ rs6000_alignment_flags &= ~MASK_ALIGN_NATURAL;
+/* APPLE LOCAL end Macintosh alignment 2001-12-17 --ff */
field_align_stack = entry->prev;
free (entry);
}
@@ -92,6 +143,20 @@ darwin_pragma_ignore (cpp_reader *pfile ATTRIBUTE_UNUSED)
/* Do nothing. */
}
+/* APPLE LOCAL begin pragma fenv */
+/* #pragma GCC fenv
+ This is kept in <fenv.h>. The point is to allow trapping
+ math to default to off. According to C99, any program
+ that requires trapping math must include <fenv.h>, so
+ we enable trapping math when that gets included. */
+
+void
+darwin_pragma_fenv (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ flag_trapping_math = 1;
+}
+/* APPLE LOCAL end pragma fenv */
+
/* #pragma options align={mac68k|power|reset} */
void
@@ -114,16 +179,89 @@ darwin_pragma_options (cpp_reader *pfile ATTRIBUTE_UNUSED)
warning ("junk at end of '#pragma options'");
arg = IDENTIFIER_POINTER (t);
+/* APPLE LOCAL begin Macintosh alignment 2002-1-22 --ff */
if (!strcmp (arg, "mac68k"))
- push_field_alignment (16);
+ {
+ if (POINTER_SIZE == 64)
+ warning ("mac68k alignment pragma is deprecated for 64-bit Darwin");
+ push_field_alignment (0, 1, 0);
+ }
+ else if (!strcmp (arg, "native")) /* equivalent to power on PowerPC */
+ push_field_alignment (0, 0, 0);
+ else if (!strcmp (arg, "natural"))
+ push_field_alignment (0, 0, 1);
+ else if (!strcmp (arg, "packed"))
+ push_field_alignment (8, 0, 0);
else if (!strcmp (arg, "power"))
- push_field_alignment (0);
+ push_field_alignment (0, 0, 0);
else if (!strcmp (arg, "reset"))
pop_field_alignment ();
else
- warning ("malformed '#pragma options align={mac68k|power|reset}', ignoring");
+ warning ("malformed '#pragma options align={mac68k|power|natural|reset}', ignoring");
+/* APPLE LOCAL end Macintosh alignment 2002-1-22 --ff */
}
+/* APPLE LOCAL begin Macintosh alignment 2002-1-22 --ff */
+/* #pragma pack ()
+ #pragma pack (N)
+
+ We have a problem handling the semantics of these directives since,
+ to play well with the Macintosh alignment directives, we want the
+ usual pack(N) form to do a push of the previous alignment state.
+ Do we want pack() to do another push or a pop? */
+
+void
+darwin_pragma_pack (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ tree x;
+ int align = -1;
+ enum cpp_ttype token;
+ enum { set, push, pop } action;
+
+ if (c_lex (&x) != CPP_OPEN_PAREN)
+ BAD ("missing '(' after '#pragma pack' - ignored");
+ token = c_lex (&x);
+ if (token == CPP_CLOSE_PAREN)
+ {
+ action = pop; /* or "set" ??? */
+ align = 0;
+ }
+ else if (token == CPP_NUMBER)
+ {
+ align = TREE_INT_CST_LOW (x);
+ action = push;
+ if (c_lex (&x) != CPP_CLOSE_PAREN)
+ BAD ("malformed '#pragma pack' - ignored");
+ }
+ else
+ BAD ("malformed '#pragma pack' - ignored");
+
+ if (c_lex (&x) != CPP_EOF)
+ warning ("junk at end of '#pragma pack'");
+
+ switch (align)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ case 16:
+ align *= BITS_PER_UNIT;
+ break;
+ default:
+ BAD2 ("alignment must be a small power of two, not %d", align);
+ }
+
+ switch (action)
+ {
+ case pop: pop_field_alignment (); break;
+ case push: push_field_alignment (align, 0, 0); break;
+ case set: break;
+ }
+}
+/* APPLE LOCAL end Macintosh alignment 2002-1-22 --ff */
+
/* #pragma unused ([var {, var}*]) */
void
@@ -525,3 +663,44 @@ find_subframework_header (cpp_reader *pfile, const char *header, cpp_dir **dirp)
return 0;
}
+
+/* APPLE LOCAL begin CALL_ON_LOAD/CALL_ON_UNLOAD pragmas 20020202 --turly */
+extern void mod_init_section (void), mod_term_section (void);
+/* Grab the function name from the pragma line and output it to the
+ assembly output file with the parameter DIRECTIVE. Called by the
+ pragma CALL_ON_LOAD and CALL_ON_UNLOAD handlers below.
+ So: "#pragma CALL_ON_LOAD foo" will output ".mod_init_func _foo". */
+
+static void directive_with_named_function (const char *pragma_name,
+ void (*section_function) (void))
+{
+ tree decl;
+ int tok;
+
+ tok = c_lex (&decl);
+ if (tok == CPP_NAME && decl)
+ {
+ extern FILE *asm_out_file;
+
+ section_function ();
+ fprintf (asm_out_file, "\t.long _%s\n", IDENTIFIER_POINTER (decl));
+
+ if (c_lex (&decl) != CPP_EOF)
+ warning ("junk at end of #pragma %s <function_name>\n", pragma_name);
+ }
+ else
+ warning ("function name expected after #pragma %s\n", pragma_name);
+}
+void
+darwin_pragma_call_on_load (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ warning("Pragma CALL_ON_LOAD is deprecated; use constructor attribute instead");
+ directive_with_named_function ("CALL_ON_LOAD", mod_init_section);
+}
+void
+darwin_pragma_call_on_unload (cpp_reader *pfile ATTRIBUTE_UNUSED)
+{
+ warning("Pragma CALL_ON_UNLOAD is deprecated; use destructor attribute instead");
+ directive_with_named_function ("CALL_ON_UNLOAD", mod_term_section);
+}
+/* APPLE LOCAL end CALL_ON_LOAD/CALL_ON_UNLOAD pragmas 20020202 --turly */
diff --git a/gcc/config/darwin-driver.c b/gcc/config/darwin-driver.c
new file mode 100644
index 00000000000..7f4f347955a
--- /dev/null
+++ b/gcc/config/darwin-driver.c
@@ -0,0 +1,1386 @@
+/* APPLE LOCAL file driver driver */
+/* Darwin driver program that handles -arch commands and invokes
+ appropriate compiler driver.
+ Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+#include <mach-o/arch.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <regex.h>
+#include "libiberty.h"
+#include "filenames.h"
+#include "stdbool.h"
+/* Hack!.
+ Pay the price for including darwin.h. */
+typedef int tree;
+
+/* Include darwin.h for SWITCH_TAKES_ARG and
+ WORD_SWIATCH_TAKES_ARG. */
+
+#include "darwin.h"
+
+/* Include gcc.h for DEFAULT_SWITCH_TAKES_ARG and
+ DEFAULT_WORD_SWIATCH_TAKES_ARG. */
+
+#include "gcc.h"
+
+/* This program name. */
+const char *progname;
+
+/* driver prefix. */
+const char *driver_exec_prefix;
+
+/* driver prefix length. */
+int prefix_len;
+
+/* current working directory. */
+char *curr_dir;
+
+/* Use if -o flag is absent. */
+const char *final_output = "a.out";
+
+/* Variabless to track presence and/or absence of important command
+ line options. */
+int compile_only_request = 0;
+int asm_output_request = 0;
+int preprocessed_output_request = 0;
+int ima_is_used = 0;
+int dash_dynamiclib_seen = 0;
+int verbose_flag = 0;
+
+/* Support at the max 10 arch. at a time. This is historical limit. */
+#define MAX_ARCHES 10
+
+/* Name of user supplied architectures. */
+const char *arches[MAX_ARCHES];
+
+/* -arch counter. */
+static int num_arches;
+
+/* Input filenames. */
+struct input_filename
+{
+ const char *name;
+ int index;
+ struct input_filename *next;
+};
+struct input_filename *in_files;
+struct input_filename *last_infile;
+
+static int num_infiles;
+
+/* User specified output file name. */
+const char *output_filename = NULL;
+
+/* Output file names used for arch specific driver invocation. These
+ are input file names for 'lipo'. */
+const char **out_files;
+static int num_outfiles;
+
+/* Architecture names used by config.guess does not match the names
+ used by NXGet... Use this hand coded mapping to connect them. */
+struct arch_config_guess_map
+{
+ const char *arch_name;
+ const char *config_string;
+};
+
+struct arch_config_guess_map arch_config_map [] =
+{
+ {"i386", "i686"},
+ {"ppc", "powerpc"},
+ {"ppc64", "powerpc"},
+ {NULL, NULL}
+};
+
+/* List of interpreted command line flags. Supply this to gcc driver. */
+const char **new_argv;
+int new_argc;
+
+/* Argument list for 'lipo'. */
+const char **lipo_argv;
+
+/* Info about the sub process. Need one subprocess for each arch plus
+ additional one for 'lipo'. */
+struct command
+{
+ const char *prog;
+ const char **argv;
+ int pid;
+} commands[MAX_ARCHES+1];
+
+/* total number of argc. */
+static int total_argc;
+
+static int greatest_status = 0;
+static int signal_count = 0;
+
+#ifndef SWITCH_TAKES_ARG
+#define SWITCH_TAKES_ARG(CHAR) DEFAULT_SWITCH_TAKES_ARG(CHAR)
+#endif
+
+#ifndef WORD_SWITCH_TAKES_ARG
+#define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)
+#endif
+
+
+/* Local function prototypes. */
+static const char * get_arch_name (const char *);
+static char * get_driver_name (const char *);
+static void delete_out_files (void);
+static char * strip_path_and_suffix (const char *, const char *);
+static void initialize (void);
+static void final_cleanup (void);
+static int do_wait (int, const char *);
+static int do_lipo (int, const char *);
+static int do_compile (const char **, int);
+static int do_compile_separately (void);
+static int do_lipo_separately (void);
+static int add_arch_options (int, const char **, int);
+static int remove_arch_options (const char**, int);
+static void add_arch (const char *);
+
+/* Find arch name for the given input string. If input name is NULL then local
+ arch name is used. */
+
+static const char *
+get_arch_name (const char *name)
+{
+ const NXArchInfo * a_info;
+ const NXArchInfo * all_info;
+ cpu_type_t cputype;
+
+ /* Find cputype associated with the given name. */
+ if (!name)
+ a_info = NXGetLocalArchInfo ();
+ else
+ a_info = NXGetArchInfoFromName (name);
+
+ if (!a_info)
+ fatal ("Invalid arch name : %s", name);
+
+ cputype = a_info->cputype;
+
+ /* Now collect ALL supported arch info. */
+ all_info = NXGetAllArchInfos ();
+
+ if (!all_info)
+ fatal ("Unable to collect arch info for %s", name);
+
+ /* Find first arch. that matches cputype. */
+ while (all_info->name)
+ {
+ if (all_info->cputype == cputype)
+ break;
+ else
+ all_info++;
+ }
+
+ return all_info->name;
+}
+
+/* Find driver name based on input arch name. */
+
+static char *
+get_driver_name (const char *arch_name)
+{
+ char *driver_name;
+ const char *config_name;
+ int len;
+ int index;
+ struct arch_config_guess_map *map;
+
+ /* find config name based on arch name. */
+ config_name = NULL;
+ map = arch_config_map;
+ while (map->arch_name)
+ {
+ if (!strcmp (map->arch_name, arch_name))
+ {
+ config_name = map->config_string;
+ break;
+ }
+ else map++;
+ }
+
+ if (!config_name)
+ fatal ("Unable to guess config name for arch %s", arch_name);
+
+ len = strlen (config_name) + strlen (PDN) + prefix_len + 1;
+ driver_name = (char *) malloc (sizeof (char) * len);
+
+ if (driver_exec_prefix)
+ strcpy (driver_name, driver_exec_prefix);
+ strcat (driver_name, config_name);
+ strcat (driver_name, PDN);
+
+ return driver_name;
+}
+
+/* Delete out_files. */
+
+static void
+delete_out_files (void)
+{
+ const char *temp;
+ struct stat st;
+ int i = 0;
+
+ for (i = 0, temp = out_files[i];
+ temp && i < total_argc * MAX_ARCHES;
+ temp = out_files[++i])
+ if (stat (temp, &st) >= 0 && S_ISREG (st.st_mode))
+ unlink (temp);
+
+}
+
+/* Put fatal error message on stderr and exit. */
+
+void
+fatal (const char *msgid, ...)
+{
+ va_list ap;
+
+ va_start (ap, msgid);
+
+ fprintf (stderr, "%s: ", progname);
+ vfprintf (stderr, msgid, ap);
+ va_end (ap);
+ fprintf (stderr, "\n");
+ delete_out_files ();
+ exit (1);
+}
+
+/* Print error message and exit. */
+
+static void
+pfatal_pexecute (const char *errmsg_fmt, const char *errmsg_arg)
+{
+ if (errmsg_arg)
+ {
+ int save_errno = errno;
+
+ /* Space for trailing '\0' is in %s. */
+ char *msg = (char *) malloc (strlen (errmsg_fmt) + strlen (errmsg_arg));
+ sprintf (msg, errmsg_fmt, errmsg_arg);
+ errmsg_fmt = msg;
+
+ errno = save_errno;
+ }
+
+ fprintf (stderr,"%s: %s: %s", progname, errmsg_fmt, xstrerror (errno));
+ delete_out_files ();
+ exit (1);
+}
+
+#ifdef DEBUG
+static void
+debug_command_line (const char **debug_argv, int debug_argc)
+{
+ int i;
+
+ fprintf (stderr,"%s: debug_command_line\n", progname);
+ fprintf (stderr,"%s: arg count = %d\n", progname, debug_argc);
+
+ for (i = 0; debug_argv[i]; i++)
+ fprintf (stderr,"%s: arg [%d] %s\n", progname, i, debug_argv[i]);
+}
+#endif
+
+/* Strip directory name from the input file name and replace file name
+ suffix with new. */
+
+static char *
+strip_path_and_suffix (const char *full_name, const char *new_suffix)
+{
+ char *name;
+ char *p;
+
+ if (!full_name || !new_suffix)
+ return NULL;
+
+ /* Strip path name. */
+ p = (char *)full_name + strlen (full_name);
+ while (p != full_name && !IS_DIR_SEPARATOR (p[-1]))
+ --p;
+
+ /* Now 'p' is a file name with suffix. */
+ name = (char *) malloc (strlen (p) + 1 + strlen (new_suffix));
+
+ strcpy (name, p);
+
+ p = name + strlen (name);
+ while (p != name && *p != '.')
+ --p;
+
+ /* If did not reach at the beginning of name then '.' is found.
+ Replace '.' with NULL. */
+ if (p != name)
+ *p = '\0';
+
+ strcat (name, new_suffix);
+ return name;
+}
+
+/* Initialization */
+
+static void
+initialize (void)
+{
+
+ int i;
+
+ /* Let's count, how many additional arguments driver driver will supply
+ to compiler driver:
+
+ Each "-arch" "<blah>" is replaced by approriate "-mcpu=<blah>".
+ That leaves one additional arg space available.
+
+ Note that only one -m* is supplied to each compiler driver. Which
+ means, extra "-arch" "<blah>" are removed from the original command
+ line. But lets not count how many additional slots are available.
+
+ Driver driver may need to specify temp. output file name, say
+ "-o" "foobar". That needs two extra argments.
+
+ Sometimes linker wants one additional "-Wl,-arch_multiple".
+
+ Sometimes linker wants to see "-final_output" "outputname".
+
+ In the end, we may need five extra arguments, plus one extra
+ space for the NULL terminator. */
+
+ new_argv = (const char **) malloc ((total_argc + 6) * sizeof (const char *));
+ if (!new_argv)
+ abort ();
+
+ /* First slot, new_argv[0] is reserved for the driver name. */
+ new_argc = 1;
+
+ /* For each -arch, three arguments are needed.
+ For example, "-arch" "ppc" "file". Additional slots are for
+ "lipo" "-create" "-o" "outputfilename" and the NULL. */
+ lipo_argv = (const char **) malloc ((total_argc * 3 + 5) * sizeof (const char *));
+ if (!lipo_argv)
+ abort ();
+
+ /* Need separate out_files for each arch, max is MAX_ARCHES.
+ Need separate out_files for each input file. */
+
+ out_files = (const char **) malloc ((total_argc * MAX_ARCHES) * sizeof (const char *));
+ if (!out_files)
+ abort ();
+
+ num_arches = 0;
+ num_infiles = 0;
+
+ in_files = NULL;
+ last_infile = NULL;
+
+ for (i = 0; i < (MAX_ARCHES + 1); i++)
+ {
+ commands[i].prog = NULL;
+ commands[i].argv = NULL;
+ commands[i].pid = 0;
+ }
+}
+
+/* Cleanup. */
+
+static void
+final_cleanup (void)
+{
+ int i;
+ struct input_filename *next;
+ delete_out_files ();
+ free (new_argv);
+ free (lipo_argv);
+ free (out_files);
+
+ for (i = 0, next = in_files;
+ i < num_infiles && next;
+ i++)
+ {
+ next = in_files->next;
+ free (in_files);
+ in_files = next;
+ }
+}
+
+/* Wait for the process pid and return appropriate code. */
+
+static int
+do_wait (int pid, const char *prog)
+{
+ int status = 0;
+ int ret = 0;
+
+ pid = pwait (pid, &status, 0);
+
+ if (WIFSIGNALED (status))
+ {
+ if (!signal_count &&
+ WEXITSTATUS (status) > greatest_status)
+ greatest_status = WEXITSTATUS (status);
+ ret = -1;
+ }
+ else if (WIFEXITED (status)
+ && WEXITSTATUS (status) >= 1)
+ {
+ if (WEXITSTATUS (status) > greatest_status)
+ greatest_status = WEXITSTATUS (status);
+ signal_count++;
+ ret = -1;
+ }
+ return ret;
+}
+
+/* Invoke 'lipo' and combine and all output files. */
+
+static int
+do_lipo (int start_outfile_index, const char *out_file)
+{
+ int i, j, pid;
+ char *errmsg_fmt, *errmsg_arg;
+
+ /* Populate lipo arguments. */
+ lipo_argv[0] = "lipo";
+ lipo_argv[1] = "-create";
+ lipo_argv[2] = "-o";
+ lipo_argv[3] = out_file;
+
+ /* Already 4 lipo arguments are set. Now add all lipo inputs. */
+ j = 4;
+ for (i = 0; i < num_arches; i++)
+ lipo_argv[j++] = out_files[start_outfile_index + i];
+
+ /* Add the NULL at the end. */
+ lipo_argv[j++] = NULL;
+
+#ifdef DEBUG
+ debug_command_line (lipo_argv, j);
+#endif
+
+ if (verbose_flag)
+ {
+ for (i = 0; lipo_argv[i]; i++)
+ fprintf (stderr, "%s ", lipo_argv[i]);
+ fprintf (stderr, "\n");
+ }
+ pid = pexecute (lipo_argv[0], (char *const *)lipo_argv, progname, NULL, &errmsg_fmt,
+ &errmsg_arg, PEXECUTE_SEARCH | PEXECUTE_LAST);
+
+ if (pid == -1)
+ pfatal_pexecute (errmsg_fmt, errmsg_arg);
+
+ return do_wait (pid, lipo_argv[0]);
+}
+
+/* Invoke compiler for all architectures. */
+
+static int
+do_compile (const char **current_argv, int current_argc)
+{
+ char *errmsg_fmt, *errmsg_arg;
+ int index = 0;
+ int ret = 0;
+
+ int dash_o_index = current_argc;
+ int of_index = current_argc + 1;
+ int argc_count = current_argc + 2;
+
+ while (index < num_arches)
+ {
+ int additional_arch_options = 0;
+
+ current_argv[0] = get_driver_name (get_arch_name (arches[index]));
+
+ /* setup output file. */
+ out_files[num_outfiles] = make_temp_file (".out");
+ current_argv[dash_o_index] = "-o";
+ current_argv[of_index] = out_files [num_outfiles];
+ num_outfiles++;
+
+ /* Add arch option as the last option. Do not add any other option
+ before removing this option. */
+ additional_arch_options = add_arch_options (index, current_argv, argc_count);
+ argc_count += additional_arch_options;
+
+ commands[index].prog = current_argv[0];
+ commands[index].argv = current_argv;
+
+ current_argv[argc_count] = NULL;
+
+#ifdef DEBUG
+ debug_command_line (current_argv, argc_count);
+#endif
+ commands[index].pid = pexecute (current_argv[0],
+ (char *const *)current_argv,
+ progname, NULL,
+ &errmsg_fmt,
+ &errmsg_arg,
+ PEXECUTE_SEARCH | PEXECUTE_LAST);
+
+ if (commands[index].pid == -1)
+ pfatal_pexecute (errmsg_fmt, errmsg_arg);
+
+ /* Remove the last arch option added in the current_argv list. */
+ if (additional_arch_options)
+ argc_count -= remove_arch_options (current_argv, argc_count);
+ index++;
+ }
+
+ index = 0;
+ while (index < num_arches)
+ {
+ ret = do_wait (commands[index].pid, commands[index].prog);
+ fflush (stdout);
+ index++;
+ }
+ return ret;
+}
+
+/* Invoke compiler for each input file separately.
+ Construct command line for each invocation with one input file. */
+
+static int
+do_compile_separately (void)
+{
+ const char **new_new_argv;
+ int i, new_new_argc;
+ struct input_filename *current_ifn;
+
+ if (num_infiles == 1 || ima_is_used)
+ abort ();
+
+ /* Total number of arguments in separate compiler invocation is :
+ total number of original arguments - total no input files + one input
+ file + "-o" + output file . */
+ new_new_argv = (const char **) malloc ((new_argc - num_infiles + 4) * sizeof (const char *));
+ if (!new_new_argv)
+ abort ();
+
+ for (current_ifn = in_files; current_ifn && current_ifn->name;
+ current_ifn = current_ifn->next)
+ {
+ struct input_filename *ifn = in_files;
+ int go_back = 0;
+ new_new_argc = 1;
+
+ for (i = 1; i < new_argc; i++)
+ {
+
+ if (ifn && ifn->name && !strcmp (new_argv[i], ifn->name))
+ {
+ /* This argument is one of the input file. */
+
+ if (!strcmp (new_argv[i], current_ifn->name))
+ {
+ /* If it is current input file name then add it in the new
+ list. */
+ new_new_argv[new_new_argc++] = new_argv[i];
+ }
+ /* This input file can not appear in
+ again on the command line so next time look for next input
+ file. */
+ ifn = ifn->next;
+ }
+ else
+ {
+ /* This argument is not a input file name. Add it into new
+ list. */
+ new_new_argv[new_new_argc++] = new_argv[i];
+ }
+ }
+
+ /* OK now we have only one input file and all other arguments. */
+ do_compile (new_new_argv, new_new_argc);
+ }
+}
+
+/* Invoke 'lipo' on set of output files and create multile FAT binaries. */
+
+static int
+do_lipo_separately (void)
+{
+ int ifn_index;
+ struct input_filename *ifn;
+ for (ifn_index = 0, ifn = in_files;
+ ifn_index < num_infiles && ifn && ifn->name;
+ ifn_index++, ifn = ifn->next)
+ do_lipo (ifn_index * num_arches,
+ strip_path_and_suffix (ifn->name, ".o"));
+}
+
+/* Replace -arch <blah> options with appropriate "-mcpu=<blah>" OR
+ "-march=<blah>". INDEX is the index in arches[] table. */
+
+static int
+add_arch_options (int index, const char **current_argv, int arch_index)
+{
+
+ int count;
+
+ /* We are adding 1 argument for selected arches. */
+ count = 1;
+
+#ifdef DEBUG
+ fprintf (stderr, "%s: add_arch_options: %s\n", progname, arches[index]);
+#endif
+
+ if (!strcmp (arches[index], "ppc601"))
+ current_argv[arch_index] = "-mcpu=601";
+ else if (!strcmp (arches[index], "ppc603"))
+ current_argv[arch_index] = "-mcpu=603";
+ else if (!strcmp (arches[index], "ppc604"))
+ current_argv[arch_index] = "-mcpu=604";
+ else if (!strcmp (arches[index], "ppc604e"))
+ current_argv[arch_index] = "-mcpu=604e";
+ else if (!strcmp (arches[index], "ppc750"))
+ current_argv[arch_index] = "-mcpu=750";
+ else if (!strcmp (arches[index], "ppc7400"))
+ current_argv[arch_index] = "-mcpu=7400";
+ else if (!strcmp (arches[index], "ppc7450"))
+ current_argv[arch_index] = "-mcpu=7450";
+ else if (!strcmp (arches[index], "ppc970"))
+ current_argv[arch_index] = "-mcpu=970";
+ else if (!strcmp (arches[index], "ppc64"))
+ current_argv[arch_index] = "-m64";
+ else if (!strcmp (arches[index], "i486"))
+ current_argv[arch_index] = "-march=i486";
+ else if (!strcmp (arches[index], "i586"))
+ current_argv[arch_index] = "-march=i586";
+ else if (!strcmp (arches[index], "i686"))
+ current_argv[arch_index] = "-march=i686";
+ else if (!strcmp (arches[index], "pentium"))
+ current_argv[arch_index] = "-march=pentium";
+ else if (!strcmp (arches[index], "pentium2"))
+ current_argv[arch_index] = "-march=pentium2";
+ else if (!strcmp (arches[index], "pentpro"))
+ current_argv[arch_index] = "-march=pentiumpro";
+ else if (!strcmp (arches[index], "pentIIm3"))
+ current_argv[arch_index] = "-march=pentium2";
+ else
+ count = 0;
+
+ return count;
+}
+
+/* Remove the last option, which is arch option, added by
+ add_arch_options. Return how count of arguments removed. */
+static int
+remove_arch_options (const char **current_argv, int arch_index)
+{
+#ifdef DEBUG
+ fprintf (stderr, "%s: Removing argument no %d\n", progname, arch_index);
+#endif
+
+ current_argv[arch_index] = '\0';
+
+#ifdef DEBUG
+ debug_command_line (current_argv, arch_index);
+#endif
+
+ return 1;
+}
+
+/* Add new arch request. */
+void
+add_arch (const char *new_arch)
+{
+ int i;
+
+ /* User can say cc -arch ppc -arch ppc foo.c
+ Do not invoke ppc compiler twice in this case. */
+ for (i = 0; i < num_arches; i++)
+ {
+ if (!strcmp (arches[i], new_arch))
+ return;
+ }
+
+ arches[num_arches] = new_arch;
+ num_arches++;
+}
+
+/* Rewrite the command line as requested in the QA_OVERRIDE_GCC3_OPTIONS
+ environment variable -- used for testing the compiler, working around bugs
+ in the Apple build environment, etc.
+
+ The override string is made up of a set of space-separated clauses. The
+ first letter of each clause describes what's to be done:
+ +string Add string as a new argument (at the end of the command line).
+ Multi-word command lines can be added with +x +y
+ s/x/y/ substitute x for y in the command line. X must be an entire
+ argument, and can be a regular expression as accepted by the
+ POSIX regexp code. Y will be substituted as a single argument,
+ and will not have regexp replacements added in.
+ xoption Removes argument matching option
+ Xoption Removes argument matching option and following word
+ Ox Removes any optimization flags in command line and replaces
+ with -Ox.
+
+
+ Here's some examples:
+ O2
+ s/precomp-trustfile=foo//
+ +-fexplore-antartica
+ +-fast
+ s/-fsetvalue=* //
+ x-fwritable-strings
+ s/-O[0-2]/-Osize/
+ x-v
+ X-o +-o +foo.o
+
+ Option substitutions are processed from left to right; matches and changes
+ are cumulative. An error in processing one element (such as trying to
+ remove an element and successor when the match is at the end) cause the
+ particular change to stop, but additional changes in the environment
+ variable to be applied.
+
+ Key details:
+ * we always want to be able to adjust optimization levels for testing
+ * adding options is a common task
+ * substitution and deletion are less common.
+
+ If the first character of the environment variable is #, changes are
+ silent. If not, diagnostics are written to stderr explaining what
+ changes are being performed.
+
+*/
+
+char **arg_array;
+int arg_array_size=0;
+int arg_count = 0;
+int confirm_changes = 1;
+const int ARG_ARRAY_INCREMENT_SIZE = 8;
+#define FALSE 0
+
+/* Routines for the argument array. The argument array routines are
+ responsible for allocation and deallocation of all objects in the
+ array */
+
+void read_args (int argc, char **argv)
+{
+ int i;
+
+ arg_array_size = argc+10;
+ arg_count = argc;
+ arg_array = (char**) malloc(sizeof(char*)*arg_array_size);
+
+ for (i=0;i<argc;i++) {
+ arg_array[i] = malloc (strlen (argv[i])+1);
+ strcpy (arg_array[i], argv[i]);
+ }
+}
+
+/* Insert the argument before pos. */
+void insert_arg(int pos, char *arg_to_insert)
+{
+ int i;
+ char *newArg = malloc (strlen (arg_to_insert)+1);
+ strcpy(newArg, arg_to_insert);
+
+ if (arg_count == arg_array_size) {
+ /* expand array */
+ arg_array_size = arg_count + ARG_ARRAY_INCREMENT_SIZE;
+ arg_array = (char**) realloc (arg_array, arg_array_size);
+ }
+
+ for (i = arg_count; i > pos; i--) {
+ arg_array[i+1] = arg_array[i];
+ }
+
+ arg_array[pos] = newArg;
+ arg_count++;
+
+ if (confirm_changes)
+ fprintf(stderr,"### Adding argument %s at position %d\n",arg_to_insert, pos);
+}
+
+
+void replace_arg (char *str, int pos) {
+ char *newArg = malloc(strlen(str)+1);
+ strcpy(newArg,str);
+
+ if (confirm_changes)
+ fprintf (stderr,"### Replacing %s with %s\n",arg_array[pos], str);
+
+ free (arg_array[pos]);
+ arg_array[pos] = newArg;
+}
+
+void append_arg (char *str)
+{
+ char *new_arg = malloc (strlen (str)+1);
+ strcpy (new_arg, str);
+ if (confirm_changes)
+ fprintf(stderr,"### Adding argument %s at end\n", str);
+
+ if (arg_count == arg_array_size) {
+ /* expand array */
+ arg_array_size = arg_count + ARG_ARRAY_INCREMENT_SIZE;
+ arg_array = (char**) realloc (arg_array, arg_array_size);
+ }
+
+ arg_array[arg_count++] = new_arg;
+}
+
+void delete_arg(int pos) {
+ int i;
+
+ if (confirm_changes)
+ fprintf(stderr,"### Deleting argument %s\n",arg_array[pos]);
+
+ free (arg_array[pos]);
+
+ for (i=pos; i < arg_count; i++)
+ arg_array[i] = arg_array[i+1];
+
+ arg_count--;
+}
+
+/* Changing optimization levels is a common testing pattern --
+ we've got a special option that searches for and replaces anything
+ beginning with -O */
+void replace_optimization_level (char *new_level) {
+ int i;
+ int optionFound = 0;
+ char *new_opt = malloc(strlen(new_opt)+3);
+ sprintf(new_opt, "-O%s",new_level);
+
+
+ for (i=0;i<arg_count;i++) {
+ if (strncmp(arg_array[i],"-O",2) == 0) {
+ replace_arg (new_opt, i);
+ optionFound = 1;
+ break;
+ }
+ }
+
+ if (optionFound == 0)
+ /* No optimization level? Add it! */
+ append_arg (new_opt);
+
+ free (new_opt);
+}
+
+/* Returns a NULL terminated string holding whatever was in the original
+ string at that point. This must be freed by the caller. */
+
+char *arg_string(char *str, int begin, int len) {
+ char *new_str = malloc(len+1);
+ strncpy(new_str,&str[begin],len);
+ new_str[len] = '\0';
+ return new_str;
+}
+
+/* Given a search-and-replace string of the form
+ s/x/y/
+
+ do search and replace on the arg list. Make sure to check that the
+ string is sane -- that it has all the proper slashes that are necessary.
+ The search string can be a regular expression, but the replace string
+ must be a literal; the search must also be for a full argument, not for
+ a chain of arguments. The result will be treated as a single argument.
+
+ Return true if success, false if bad failure.
+*/
+
+bool search_and_replace (char *str) {
+ regex_t regexp_search_struct;
+ int searchLen;
+ int replaceLen;
+ int i;
+ int err;
+
+ char *searchStr;
+ char *replaceStr;
+ char *replacedStr;
+ const int ERRSIZ = 512;
+ char errbuf[ERRSIZ];
+
+
+ if (str[0] != '/') {
+ return false;
+ }
+
+ searchLen = strcspn (str + 1, "/\0");
+
+ if (str[1 + searchLen] != '/')
+ return false;
+
+ replaceLen = strcspn(str+1+searchLen+1, "/\0");
+
+ if (str[1 + searchLen + 1 +replaceLen] != '/')
+ return false;
+
+ searchStr = arg_string(str, 1, searchLen);
+ replaceStr = arg_string (str, 1 + searchLen + 1, replaceLen);
+
+ if ((err = regcomp(&regexp_search_struct, searchStr, REG_EXTENDED)) != 0) {
+ regerror(err, &regexp_search_struct, errbuf, ERRSIZ);
+ fprintf(stderr,"%s",errbuf);
+ return false;
+ }
+
+ for (i=0;i<arg_count;i++) {
+ regmatch_t matches[5];
+ if (regexec (&regexp_search_struct, arg_array[i],
+ 5, matches, 0) == 0) {
+ if ((matches[0].rm_eo - matches[0].rm_so) == strlen (arg_array[i])) {
+ /* Success! Change the string. */
+ replace_arg(replaceStr,i);
+ break;
+ }
+ }
+ }
+
+ regfree (&regexp_search_struct);
+ free (searchStr);
+ free (replaceStr);
+
+ return true;
+}
+
+
+/* Given a string, return the argument number where the first match occurs. */
+int find_arg (char *str) {
+ int i;
+ int matchIndex = -1;
+
+ for (i=0;i<arg_count;i++) {
+ if (strcmp(arg_array[i],str) == 0) {
+ matchIndex = i;
+ break;
+ }
+ }
+
+ return matchIndex;
+}
+
+void rewrite_command_line (char *override_options_line, int *argc, char ***argv){
+ int line_pos = 0;
+
+ read_args (*argc, *argv);
+
+ if (override_options_line[0] == '#')
+ {
+ confirm_changes = 0;
+ line_pos++;
+ }
+
+
+ if (confirm_changes)
+ fprintf (stderr, "### QA_OVERRIDE_GCC3_OPTIONS: %s\n",
+ override_options_line);
+
+ /* Loop through all commands in the file */
+
+ while (override_options_line[line_pos] != '\0')
+ {
+ char first_char;
+ char *searchStr;
+ char *arg;
+ int search_index;
+ int arg_len;
+
+ /* Any spaces in between options don't count. */
+ if (override_options_line[line_pos] == ' ')
+ {
+ line_pos++;
+ continue;
+ }
+
+ /* The first non-space character is the command. */
+ first_char = override_options_line[line_pos];
+ line_pos++;
+ arg_len = strcspn(override_options_line+line_pos, " ");
+
+ switch (first_char) {
+ case '+':
+ /* Add an argument to the end of the arg list */
+ arg = arg_string (override_options_line,
+ line_pos,
+ arg_len);
+ append_arg (arg);
+ free (arg);
+ break;
+
+ case 'x':
+ /* Delete a matching argument */
+ searchStr = arg_string(override_options_line, line_pos, arg_len);
+ if ((search_index = find_arg(searchStr)) != -1) {
+ delete_arg(search_index);
+ }
+ free (searchStr);
+ break;
+
+ case 'X':
+ /* Delete a matching argument and the argument following. */
+ searchStr = arg_string(override_options_line, line_pos, arg_len);
+ if ((search_index = find_arg(searchStr)) != -1) {
+ if (search_index >= arg_count -1) {
+ if (confirm_changes)
+ fprintf(stderr,"Not enough arguments to do X\n");
+ } else {
+ delete_arg(search_index); /* Delete the matching argument */
+ delete_arg(search_index); /* Delete the following argument */
+ }
+ }
+ free (searchStr);
+ break;
+
+ case 'O':
+ /* Change the optimization level to the specified value, and
+ remove any optimization arguments. This is a separate command
+ because we often want is to substitute our favorite
+ optimization level for whatever the project normally wants.
+ As we probably care about this a lot (for things like
+ testing file sizes at different optimization levels) we
+ make a special rewrite clause. */
+ arg = arg_string (override_options_line, line_pos, arg_len);
+ replace_optimization_level(arg);
+ free (arg);
+ break;
+ case 's':
+ /* Search for the regexp passed in, and replace a matching argument
+ with the provided replacement string */
+ searchStr = arg_string (override_options_line, line_pos, arg_len);
+ search_and_replace (searchStr);
+ free (searchStr);
+ break;
+
+ default:
+ fprintf(stderr,"### QA_OVERRIDE_GCC3_OPTIONS: invalid string (pos %d)\n",
+ line_pos);
+ break;
+ }
+ line_pos += arg_len;
+ }
+ *argc = arg_count;
+ *argv = arg_array;
+}
+
+
+
+/* Main entry point. This is gcc driver driver!
+ Interpret -arch flag from the list of input arguments. Invoke appropriate
+ compiler driver. 'lipo' the results if more than one -arch is supplied. */
+int
+main (int argc, const char **argv)
+{
+ size_t i;
+ int l, pid, ret, argv_0_len, prog_len;
+ char *errmsg_fmt, *errmsg_arg;
+ char *override_option_str = NULL;
+ total_argc = argc;
+ argv_0_len = strlen (argv[0]);
+ prog_len = 0;
+
+ /* Get the progname, required by pexecute () and program location. */
+ progname = argv[0] + argv_0_len;
+ while (progname != argv[0] && !IS_DIR_SEPARATOR (progname[-1]))
+ {
+ prog_len++;
+ --progname;
+ }
+
+ /* Setup driver prefix. */
+ prefix_len = argv_0_len - prog_len;
+ curr_dir = (char *) malloc (sizeof (char) * (prefix_len + 1));
+ strncpy (curr_dir, argv[0], prefix_len);
+ curr_dir[prefix_len] = '\0';
+ driver_exec_prefix = (argv[0], "/usr/bin", curr_dir);
+
+#ifdef DEBUG
+ fprintf (stderr,"%s: full progname = %s\n", progname, argv[0]);
+ fprintf (stderr,"%s: progname = %s\n", progname, progname);
+ fprintf (stderr,"%s: driver_exec_prefix = %s\n", progname, driver_exec_prefix);
+#endif
+
+ /* Before we get too far, rewrite the command line with any requested overrides */
+ if ((override_option_str = getenv ("QA_OVERRIDE_GCC3_OPTIONS")) != NULL)
+ rewrite_command_line(override_option_str, &argc, (char***)&argv);
+
+
+
+ initialize ();
+
+ /* Process arguments. Take appropriate actions when
+ -arch, -c, -S, -E, -o is encountered. Find input file name. */
+ for (i = 1; i < argc; i++)
+ {
+ if (!strcmp (argv[i], "-arch"))
+ {
+ if (i + 1 >= argc)
+ abort ();
+
+ add_arch (argv[i+1]);
+ i++;
+ }
+ else if (!strcmp (argv[i], "-c"))
+ {
+ new_argv[new_argc++] = argv[i];
+ compile_only_request = 1;
+ }
+ else if (!strcmp (argv[i], "-S"))
+ {
+ new_argv[new_argc++] = argv[i];
+ asm_output_request = 1;
+ }
+ else if (!strcmp (argv[i], "-E"))
+ {
+ new_argv[new_argc++] = argv[i];
+ preprocessed_output_request = 1;
+ }
+ else if (!strcmp (argv[i], "-dynamiclib"))
+ {
+ new_argv[new_argc++] = argv[i];
+ dash_dynamiclib_seen = 1;
+ }
+ else if (!strcmp (argv[i], "-v"))
+ {
+ new_argv[new_argc++] = argv[i];
+ verbose_flag = 1;
+ }
+ else if (!strcmp (argv[i], "-o"))
+ {
+ if (i + 1 >= argc)
+ abort ();
+
+ output_filename = argv[i+1];
+ i++;
+ }
+ else if ((! strcmp (argv[i], "-pass-exit-codes"))
+ || (! strcmp (argv[i], "-print-search-dirs"))
+ || (! strcmp (argv[i], "-print-libgcc-file-name"))
+ || (! strncmp (argv[i], "-print-file-name=", 17))
+ || (! strncmp (argv[i], "-print-prog-name=", 17))
+ || (! strcmp (argv[i], "-print-multi-lib"))
+ || (! strcmp (argv[i], "-print-multi-directory"))
+ || (! strcmp (argv[i], "-print-multi-os-directory"))
+ || (! strcmp (argv[i], "-ftarget-help"))
+ || (! strcmp (argv[i], "-fhelp"))
+ || (! strcmp (argv[i], "+e"))
+ || (! strncmp (argv[i], "-Wa,",4))
+ || (! strncmp (argv[i], "-Wp,",4))
+ || (! strncmp (argv[i], "-Wl,",4))
+ || (! strncmp (argv[i], "-l", 2))
+ || (! strncmp (argv[i], "-weak-l", 7))
+ || (! strncmp (argv[i], "-specs=", 7))
+ || (! strcmp (argv[i], "-ObjC"))
+ || (! strcmp (argv[i], "-fobjC"))
+ || (! strcmp (argv[i], "-ObjC++"))
+ || (! strcmp (argv[i], "-time"))
+ || (! strcmp (argv[i], "-###"))
+ || (! strcmp (argv[i], "-fconstant-cfstrings"))
+ || (! strcmp (argv[i], "-fno-constant-cfstrings"))
+ || (! strcmp (argv[i], "-save-temps"))
+ || (! strcmp (argv[i], "-static-libgcc"))
+ || (! strcmp (argv[i], "-shared-libgcc"))
+ || (! strcmp (argv[i], "-pipe"))
+ )
+ {
+ new_argv[new_argc++] = argv[i];
+ }
+ else if ((! strcmp (argv[i], "-Xlinker"))
+ || (! strcmp (argv[i], "-Xassembler"))
+ || (! strcmp (argv[i], "-Xpreprocessor"))
+ || (! strcmp (argv[i], "-l"))
+ || (! strcmp (argv[i], "-weak_library"))
+ || (! strcmp (argv[i], "-weak_framework"))
+ || (! strcmp (argv[i], "-specs"))
+ || (! strcmp (argv[i], "-framework"))
+ )
+ {
+ new_argv[new_argc++] = argv[i];
+ i++;
+ new_argv[new_argc++] = argv[i];
+ }
+ else if (argv[i][0] == '-' && argv[i][1] != 0)
+ {
+ const char *p = &argv[i][1];
+ int c = *p;
+
+ /* First copy this flag itself. */
+ new_argv[new_argc++] = argv[i];
+
+ /* Now copy this flag's arguments, if any, appropriately. */
+ if ((SWITCH_TAKES_ARG (c) > (p[1] != 0))
+ || WORD_SWITCH_TAKES_ARG (p))
+ {
+ int j = 0;
+ int n_args = WORD_SWITCH_TAKES_ARG (p);
+ if (n_args == 0)
+ {
+ /* Count only the option arguments in separate argv elements. */
+ n_args = SWITCH_TAKES_ARG (c) - (p[1] != 0);
+ }
+ if (i + n_args >= argc)
+ fatal ("argument to `-%s' is missing", p);
+
+
+ while ( j < n_args)
+ {
+ i++;
+ new_argv[new_argc++] = argv[i];
+ j++;
+ }
+ }
+
+ }
+ else
+ {
+ struct input_filename *ifn;
+ new_argv[new_argc++] = argv[i];
+ ifn = (struct input_filename *) malloc (sizeof (struct input_filename));
+ ifn->name = argv[i];
+ ifn->index = i;
+ ifn->next = NULL;
+ num_infiles++;
+
+ if (last_infile)
+ last_infile->next = ifn;
+ else
+ in_files = ifn;
+
+ last_infile = ifn;
+ }
+ }
+
+#if 0
+ if (num_infiles == 0)
+ fatal ("no input files");
+#endif
+
+ if (preprocessed_output_request && asm_output_request && num_infiles > 1)
+ fatal ("-E and -S are not allowed with multiple -arch flags");
+
+ /* If -arch is not present OR Only one -arch <blah> is specified.
+ Invoke appropriate compiler driver. FAT build is not required in this
+ case. */
+
+ if (num_arches == 0 || num_arches == 1)
+ {
+
+ /* If no -arch is specified than use host compiler driver. */
+ if (num_arches == 0)
+ new_argv[0] = get_driver_name (get_arch_name (NULL));
+ else if (num_arches == 1)
+ {
+ /* Find compiler driver based on -arch <foo> and add approriate
+ -m* argument. */
+ new_argv[0] = get_driver_name (get_arch_name (arches[0]));
+ new_argc = new_argc + add_arch_options (0, new_argv, new_argc);
+ }
+
+
+#ifdef DEBUG
+ printf ("%s: invoking single driver name = %s\n", progname, new_argv[0]);
+#endif
+
+ /* Re insert output file name. */
+ if (output_filename)
+ {
+ new_argv[new_argc++] = "-o";
+ new_argv[new_argc++] = output_filename;
+ }
+
+ /* Add the NULL. */
+ new_argv[new_argc] = NULL;
+
+#ifdef DEBUG
+ debug_command_line (new_argv, new_argc);
+#endif
+
+ pid = pexecute (new_argv[0], (char *const *)new_argv, progname, NULL,
+ &errmsg_fmt, &errmsg_arg, PEXECUTE_SEARCH | PEXECUTE_LAST);
+
+ if (pid == -1)
+ pfatal_pexecute (errmsg_fmt, errmsg_arg);
+
+ ret = do_wait (pid, new_argv[0]);
+ }
+ else
+ {
+ /* Handle multiple -arch <blah>. */
+
+ /* If more than one input files are supplied but only one output filename
+ is pressent then IMA will be used. */
+ if (num_infiles > 1 && output_filename)
+ ima_is_used = 1;
+
+ /* Linker wants to know this in case of multiple -arch. */
+ if (!compile_only_request && !dash_dynamiclib_seen)
+ new_argv[new_argc++] = "-Wl,-arch_multiple";
+
+
+ /* If only one input file is specified OR IMA is used then expected output
+ is one FAT binary. */
+ if (num_infiles == 1 || ima_is_used)
+ {
+ const char *out_file;
+
+ /* Create output file name based on
+ input filename, if required. */
+ if (compile_only_request && !output_filename && num_infiles == 1)
+ out_file = strip_path_and_suffix (in_files->name, ".o");
+ else
+ out_file = (output_filename ? output_filename : final_output);
+
+
+ /* Linker wants to know name of output file using one extra arg. */
+ if (!compile_only_request)
+ {
+ char *oname = (char *)(output_filename ? output_filename : final_output);
+ char *n = malloc (sizeof (char) * (strlen (oname) + 5));
+ strcpy (n, "-Wl,");
+ strcat (n, oname);
+ new_argv[new_argc++] = "-Wl,-final_output";
+ new_argv[new_argc++] = n;
+ }
+
+ /* Compile file(s) for each arch and lipo 'em together. */
+ ret = do_compile (new_argv, new_argc);
+
+ /* Make FAT binary by combining individual output files for each
+ architecture, using 'lipo'. */
+ ret = do_lipo (0, out_file);
+ }
+ else
+ {
+ /* Multiple input files are present and IMA is not used.
+ Which means need to generate multiple FAT files. */
+ ret = do_compile_separately ();
+ ret = do_lipo_separately ();
+ }
+ }
+
+ final_cleanup ();
+ free (curr_dir);
+ return greatest_status;
+}
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index 43ea4cd3363..2544e6eb8ee 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -57,6 +57,8 @@ extern void machopic_asm_out_destructor (rtx, int);
extern void machopic_define_symbol (rtx);
extern void darwin_encode_section_info (tree, rtx, int);
+/* APPLE LOCAL CW asm blocks */
+extern tree darwin_cw_asm_special_label (tree);
#endif /* TREE_CODE */
@@ -77,6 +79,25 @@ extern void darwin_emit_unwind_label (FILE *, tree, int, int);
extern void darwin_pragma_ignore (struct cpp_reader *);
extern void darwin_pragma_options (struct cpp_reader *);
extern void darwin_pragma_unused (struct cpp_reader *);
+/* APPLE LOCAL pragma fenv */
+extern void darwin_pragma_fenv (struct cpp_reader *);
+
+/* APPLE LOCAL begin Macintosh alignment 2002-1-22 --ff */
+extern void darwin_pragma_pack (struct cpp_reader *);
+/* APPLE LOCAL end Macintosh alignment 2002-1-22 --ff */
+/* APPLE LOCAL begin CALL_ON_LOAD/CALL_ON_UNLOAD pragmas 20020202 --turly */
+extern void darwin_pragma_call_on_load (struct cpp_reader *);
+extern void darwin_pragma_call_on_unload (struct cpp_reader *);
+/* APPLE LOCAL end CALL_ON_LOAD/CALL_ON_UNLOAD pragmas 20020202 --turly */
+
+/* APPLE LOCAL begin darwin_set_section_for_var_p */
+extern int darwin_set_section_for_var_p (tree, int, int);
+/* APPLE LOCAL end darwin_set_section_for_var_p */
+
+/* APPLE LOCAL double destructor */
+extern tree darwin_handle_odd_attribute (tree *, tree, tree, int, bool *);
+/* APPLE LOCAL ObjC GC */
+extern tree darwin_handle_objc_gc_attribute (tree *, tree, tree, int, bool *);
extern void darwin_file_end (void);
@@ -123,6 +144,10 @@ extern void objc_class_names_section (void);
extern void objc_meth_var_names_section (void);
extern void objc_meth_var_types_section (void);
extern void objc_cls_refs_section (void);
+/* APPLE LOCAL begin constant cfstrings */
+extern void cfstring_constant_object_section (void);
+extern bool darwin_constant_cfstring_p (tree);
+/* APPLE LOCAL end constant cfstrings */
extern void machopic_lazy_symbol_ptr_section (void);
extern void machopic_nl_symbol_ptr_section (void);
extern void machopic_symbol_stub_section (void);
@@ -134,3 +159,20 @@ extern void darwin_globalize_label (FILE *, const char *);
extern void darwin_assemble_visibility (tree, int);
extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *,
const char *);
+/* APPLE LOCAL C++ EH */
+extern void darwin_non_lazy_pcrel (FILE *file, rtx addr);
+
+/* APPLE LOCAL begin constant cfstrings */
+extern void darwin_init_cfstring_builtins (void);
+extern tree darwin_expand_tree_builtin (tree, tree, tree);
+extern tree darwin_construct_objc_string (tree);
+/* APPLE LOCAL end constant cfstrings */
+
+/* APPLE LOCAL CW asm blocks */
+#define CW_ASM_SPECIAL_LABEL(ID) darwin_cw_asm_special_label (ID)
+
+/* APPLE LOCAL begin KEXT */
+#ifdef TREE_CODE
+extern bool flag_apple_kext_p (void);
+#endif
+/* APPLE LOCAL end KEXT */
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index de2f6e3e0b6..5ef8439593d 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -45,6 +45,19 @@ Boston, MA 02111-1307, USA. */
#include "tm_p.h"
#include "errors.h"
#include "hashtab.h"
+/* APPLE LOCAL begin constant cfstrings */
+#include "toplev.h"
+
+static tree darwin_build_constant_cfstring (tree);
+
+enum darwin_builtins
+{
+ DARWIN_BUILTIN_MIN = (int)END_BUILTINS,
+
+ DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING,
+ DARWIN_BUILTIN_MAX
+};
+/* APPLE LOCAL end constant cfstrings */
/* Darwin supports a feature called fix-and-continue, which is used
for rapid turn around debugging. When code is compiled with the
@@ -824,6 +837,43 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
else
pic_ref = gen_rtx_PLUS (Pmode, base, orig);
+ /* APPLE LOCAL begin gen ADD */
+#ifdef MASK_80387
+ {
+ rtx mem, other;
+
+ if (GET_CODE (orig) == MEM) {
+ mem = orig; other = base;
+ /* Swap the kids only if there is only one MEM, and it's on the right. */
+ if (GET_CODE (base) != MEM) {
+ XEXP (pic_ref, 0) = orig;
+ XEXP (pic_ref, 1) = base;
+ }
+ }
+ else if (GET_CODE (base) == MEM) {
+ mem = base; other = orig;
+ } else
+ mem = other = NULL_RTX;
+
+ /* Both kids are MEMs. */
+ if (other && GET_CODE (other) == MEM)
+ other = force_reg (GET_MODE (other), other);
+
+ /* The x86 can't post-index a MEM; emit an ADD instruction to handle this. */
+ if (mem && GET_CODE (mem) == MEM) {
+ if ( ! reload_in_progress) {
+ rtx set = gen_rtx_SET (VOIDmode, reg, pic_ref);
+ rtx clobber_cc = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (CCmode, FLAGS_REG));
+ pic_ref = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, set, clobber_cc));
+ emit_insn (pic_ref);
+ pic_ref = reg;
+ is_complex = 0;
+ }
+ }
+ }
+#endif
+ /* APPLE LOCAL end gen ADD */
+
if (reg && is_complex)
{
emit_move_insn (reg, pic_ref);
@@ -840,7 +890,13 @@ machopic_legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
else if (GET_CODE (orig) == MEM
&& GET_CODE (XEXP (orig, 0)) == SYMBOL_REF)
{
- rtx addr = machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, reg);
+ /* APPLE LOCAL begin use new pseudo for temp; reusing reg confuses PRE */
+ rtx tempreg = reg;
+ rtx addr;
+ if ( !no_new_pseudos )
+ tempreg = gen_reg_rtx (Pmode);
+ addr = machopic_legitimize_pic_address (XEXP (orig, 0), Pmode, tempreg);
+ /* APPLE LOCAL end use new pseudo for temp; reusing reg confuses PRE */
addr = replace_equiv_address (orig, addr);
emit_move_insn (reg, addr);
pic_ref = reg;
@@ -998,6 +1054,14 @@ darwin_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
&& indirect_data (sym_ref)
&& ! TREE_PUBLIC (decl))
SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_STATIC;
+
+ /* APPLE LOCAL begin fix OBJC codegen */
+ if (TREE_CODE (decl) == VAR_DECL)
+ {
+ if (strncmp (XSTR (sym_ref, 0), "_OBJC_", 6) == 0)
+ SYMBOL_REF_FLAGS (sym_ref) |= MACHO_SYMBOL_FLAG_DEFINED;
+ }
+ /* APPLE LOCAL end fix OBJC codegen */
}
void
@@ -1031,10 +1095,13 @@ machopic_select_section (tree exp, int reloc,
else
base_function = base_funs[4][weak_p];
+ /* APPLE LOCAL begin fwritable strings */
if (TREE_CODE (exp) == STRING_CST
&& ((size_t) TREE_STRING_LENGTH (exp)
- == strlen (TREE_STRING_POINTER (exp)) + 1))
+ == strlen (TREE_STRING_POINTER (exp)) + 1)
+ && ! flag_writable_strings)
cstring_section ();
+ /* APPLE LOCAL end fwritable strings */
else if ((TREE_CODE (exp) == INTEGER_CST || TREE_CODE (exp) == REAL_CST)
&& flag_merge_constants)
{
@@ -1056,6 +1123,10 @@ machopic_select_section (tree exp, int reloc,
&& TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE
&& TYPE_NAME (TREE_TYPE (exp)))
{
+ /* APPLE LOCAL begin constant strings */
+ extern int flag_next_runtime;
+ extern const char *constant_string_class_name;
+ /* APPLE LOCAL end constant strings */
tree name = TYPE_NAME (TREE_TYPE (exp));
if (TREE_CODE (name) == TYPE_DECL)
name = DECL_NAME (name);
@@ -1063,6 +1134,19 @@ machopic_select_section (tree exp, int reloc,
objc_constant_string_object_section ();
else if (!strcmp (IDENTIFIER_POINTER (name), "NXConstantString"))
objc_string_object_section ();
+ /* APPLE LOCAL begin constant strings */
+ else if (!strcmp (IDENTIFIER_POINTER (name), "__builtin_CFString"))
+ cfstring_constant_object_section ();
+ else if (constant_string_class_name
+ && !strcmp (IDENTIFIER_POINTER (name),
+ constant_string_class_name))
+ {
+ if (flag_next_runtime)
+ objc_constant_string_object_section ();
+ else
+ objc_string_object_section ();
+ }
+ /* APPLE LOCAL end constant strings */
else
base_function ();
}
@@ -1123,28 +1207,12 @@ machopic_select_section (tree exp, int reloc,
else
base_function ();
}
- /* ::operator new and ::operator delete must be coalesced, even
- if not weak. There are 8 variants that we look for. */
- else if (TREE_CODE (exp) == FUNCTION_DECL
- && ! DECL_ONE_ONLY (exp))
- {
- const char * name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (exp));
- if (name[0] == '_' && name[1] == 'Z'
- && ((name[2] == 'n' && (name[3] == 'a' || name[3] == 'w')
- && name[4] == 'm')
- || (name[2] == 'd' && (name[3] == 'a' || name[3] == 'l')
- && name[4] == 'P' && name[5] == 'v')))
- {
- bool delete_p = name[2] == 'd';
- if (name[5 + delete_p] == 0
- || strcmp (name + 5 + delete_p, "KSt9nothrow_t") == 0)
- base_funs[reloc][1] ();
- else
- base_function ();
- }
- else
- base_function ();
- }
+ /* APPLE LOCAL coalescing */
+ /* Removed special handling of '::operator new' and '::operator delete'. */
+ /* APPLE LOCAL begin darwin_set_section_for_var_p */
+ else if (darwin_set_section_for_var_p (exp, reloc, align))
+ ;
+ /* APPLE LOCAL end darwin_set_section_for_var_p */
else
base_function ();
}
@@ -1156,7 +1224,11 @@ void
machopic_select_rtx_section (enum machine_mode mode, rtx x,
unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
- if (GET_MODE_SIZE (mode) == 8)
+ /* APPLE LOCAL begin 64-bit mainline */
+ if (GET_MODE_SIZE (mode) == 8
+ && (GET_CODE (x) == CONST_INT
+ || GET_CODE (x) == CONST_DOUBLE))
+ /* APPLE LOCAL end 64-bit mainline */
literal8_section ();
else if (GET_MODE_SIZE (mode) == 4
&& (GET_CODE (x) == CONST_INT
@@ -1206,6 +1278,153 @@ darwin_globalize_label (FILE *stream, const char *name)
default_globalize_label (stream, name);
}
+/* APPLE LOCAL begin assembly "abort" directive */
+/* This can be called instead of EXIT. It will emit a '.abort' directive
+ into any existing assembly file, causing assembly to immediately abort,
+ thus preventing the assembler from spewing out numerous, irrelevant
+ error messages. */
+
+void
+abort_assembly_and_exit (int status)
+{
+ /* If we're aborting, get the assembler to abort, too. */
+ if (status == FATAL_EXIT_CODE && asm_out_file != 0)
+ fprintf (asm_out_file, "\n.abort\n");
+
+ exit (status);
+}
+/* APPLE LOCAL end assembly "abort" directive */
+
+/* APPLE LOCAL begin KEXT double destructor */
+#include "c-common.h"
+
+/* Handle __attribute__ ((apple_kext_compatibility)).
+ This only applies to darwin kexts for 2.95 compatibility -- it shrinks the
+ vtable for classes with this attribute (and their descendants) by not
+ outputting the new 3.0 nondeleting destructor. This means that such
+ objects CANNOT be allocated on the stack or as globals UNLESS they have
+ a completely empty `operator delete'.
+ Luckily, this fits in with the Darwin kext model.
+
+ This attribute also disables gcc3's potential overlaying of derived
+ class data members on the padding at the end of the base class. */
+
+tree
+darwin_handle_odd_attribute (tree *node, tree name, tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED, bool *no_add_attrs)
+{
+ /* APPLE KEXT stuff -- only applies with pure static C++ code. */
+ if (! flag_apple_kext || ! c_dialect_cxx ())
+ {
+ warning ("`%s' 2.95 vtable-compatability attribute applies "
+ "only when compiling a kext", IDENTIFIER_POINTER (name));
+
+ *no_add_attrs = true;
+ }
+ else if (TREE_CODE (*node) != RECORD_TYPE)
+ {
+ warning ("`%s' 2.95 vtable-compatability attribute applies "
+ "only to C++ classes", IDENTIFIER_POINTER (name));
+
+ *no_add_attrs = true;
+ }
+
+ return NULL_TREE;
+}
+/* APPLE LOCAL end KEXT double destructor */
+
+/* APPLE LOCAL begin ObjC GC */
+tree
+darwin_handle_objc_gc_attribute (tree *node ATTRIBUTE_UNUSED,
+ tree name ATTRIBUTE_UNUSED,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs ATTRIBUTE_UNUSED)
+{
+ return NULL_TREE;
+}
+/* APPLE LOCAL end ObjC GC */
+
+/* APPLE LOCAL begin darwin_set_section_for_var_p 20020226 --turly */
+
+/* This is specifically for any initialised static class constants
+ which may be output by the C++ front end at the end of compilation.
+ SELECT_SECTION () macro won't do because these are VAR_DECLs, not
+ STRING_CSTs or INTEGER_CSTs. And by putting 'em in appropriate
+ sections, we save space.
+
+ FIXME: does this really do anything? Won't the DECL_WEAK test be
+ true 99% (or 100%) of the time? In the other 1% of the time,
+ shouldn't select_section be fixed instead of this hackery? */
+
+extern void cstring_section (void),
+ literal4_section (void), literal8_section (void);
+int
+darwin_set_section_for_var_p (tree exp, int reloc, int align)
+{
+ if (!reloc && TREE_CODE (exp) == VAR_DECL
+ && DECL_ALIGN (exp) == align
+ && TREE_READONLY (exp) && DECL_INITIAL (exp)
+ && ! DECL_WEAK (exp))
+ {
+ /* Put constant string vars in ".cstring" section. */
+
+ if (TREE_CODE (TREE_TYPE (exp)) == ARRAY_TYPE
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (exp))) == INTEGER_TYPE
+ && integer_onep (TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (exp))))
+ && TREE_CODE (DECL_INITIAL (exp)) == STRING_CST)
+ {
+
+ /* Compare string length with actual number of characters
+ the compiler will write out (which is not necessarily
+ TREE_STRING_LENGTH, in the case of a constant array of
+ characters that is not null-terminated). Select appropriate
+ section accordingly. */
+
+ if (MIN ( TREE_STRING_LENGTH (DECL_INITIAL(exp)),
+ int_size_in_bytes (TREE_TYPE (exp)))
+ == (long) strlen (TREE_STRING_POINTER (DECL_INITIAL (exp))) + 1)
+ {
+ cstring_section ();
+ return 1;
+ }
+ else
+ {
+ const_section ();
+ return 1;
+ }
+ }
+ else
+ if (TREE_READONLY (exp)
+ && ((TREE_CODE (TREE_TYPE (exp)) == INTEGER_TYPE
+ && TREE_CODE (DECL_INITIAL (exp)) == INTEGER_CST)
+ || (TREE_CODE (TREE_TYPE (exp)) == REAL_TYPE
+ && TREE_CODE (DECL_INITIAL (exp)) == REAL_CST))
+ && TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (DECL_INITIAL (exp))))
+ == INTEGER_CST)
+ {
+ tree size = TYPE_SIZE_UNIT (TREE_TYPE (DECL_INITIAL (exp)));
+ if (TREE_INT_CST_HIGH (size) != 0)
+ return 0;
+
+ /* Put integer and float consts in the literal4|8 sections. */
+
+ if (TREE_INT_CST_LOW (size) == 4)
+ {
+ literal4_section ();
+ return 1;
+ }
+ else if (TREE_INT_CST_LOW (size) == 8)
+ {
+ literal8_section ();
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+/* APPLE LOCAL end darwin_set_section_for_var_p 20020226 --turly */
+
void
darwin_asm_named_section (const char *name,
unsigned int flags ATTRIBUTE_UNUSED,
@@ -1381,7 +1600,8 @@ void
darwin_file_end (void)
{
machopic_finish (asm_out_file);
- if (strcmp (lang_hooks.name, "GNU C++") == 0)
+ /* APPLE LOCAL constant cfstrings */
+ if (darwin_running_cxx)
{
constructor_section ();
destructor_section ();
@@ -1399,4 +1619,315 @@ darwin_file_end (void)
int darwin_fix_and_continue;
const char *darwin_fix_and_continue_switch;
+/* APPLE LOCAL begin KEXT */
+/* Ture, iff we're generating code for loadable kernel extentions. */
+
+bool
+flag_apple_kext_p (void) {
+ return flag_apple_kext;
+}
+/* APPLE LOCAL end KEXT */
+
+/* APPLE LOCAL begin constant cfstrings */
+int darwin_constant_cfstrings = 0;
+const char *darwin_constant_cfstrings_switch;
+int darwin_warn_nonportable_cfstrings = 1; /* on by default. */
+const char *darwin_warn_nonportable_cfstrings_switch;
+int darwin_pascal_strings = 0;
+const char *darwin_pascal_strings_switch;
+int darwin_running_cxx;
+
+static GTY(()) tree cfstring_class_reference = NULL_TREE;
+static GTY(()) tree cfstring_type_node = NULL_TREE;
+static GTY(()) tree ccfstring_type_node = NULL_TREE;
+static GTY(()) tree pccfstring_type_node = NULL_TREE;
+static GTY(()) tree pcint_type_node = NULL_TREE;
+static GTY(()) tree pcchar_type_node = NULL_TREE;
+
+/* Store all constructed constant CFStrings in a hash table so that
+ they get uniqued properly. */
+
+struct cfstring_descriptor GTY(())
+{
+ /* The literal argument . */
+ tree literal;
+
+ /* The resulting constant CFString. */
+ tree constructor;
+};
+
+static GTY((param_is (struct cfstring_descriptor))) htab_t cfstring_htab;
+
+static hashval_t cfstring_hash (const void *);
+static int cfstring_eq (const void *, const void *);
+
+void
+darwin_init_cfstring_builtins (void)
+{
+ tree field, fields, pccfstring_ftype_pcchar;
+
+ /* struct __builtin_CFString {
+ const int *isa; (will point at
+ int flags; __CFConstantStringClassReference)
+ const char *str;
+ int length;
+ }; */
+
+ pcint_type_node
+ = build_pointer_type (build_qualified_type (integer_type_node,
+ TYPE_QUAL_CONST));
+ pcchar_type_node
+ = build_pointer_type (build_qualified_type (char_type_node,
+ TYPE_QUAL_CONST));
+ cfstring_type_node = (*lang_hooks.types.make_type) (RECORD_TYPE);
+ fields = build_decl (FIELD_DECL, NULL_TREE, pcint_type_node);
+ field = build_decl (FIELD_DECL, NULL_TREE, integer_type_node);
+ TREE_CHAIN (field) = fields; fields = field;
+ field = build_decl (FIELD_DECL, NULL_TREE, pcchar_type_node);
+ TREE_CHAIN (field) = fields; fields = field;
+ field = build_decl (FIELD_DECL, NULL_TREE, integer_type_node);
+ TREE_CHAIN (field) = fields; fields = field;
+ /* NB: The finish_builtin_struct() routine expects FIELD_DECLs in
+ reverse order! */
+ finish_builtin_struct (cfstring_type_node, "__builtin_CFString",
+ fields, NULL_TREE);
+
+ /* const struct __builtin_CFstring *
+ __builtin___CFStringMakeConstantString (const char *); */
+
+ ccfstring_type_node
+ = build_qualified_type (cfstring_type_node, TYPE_QUAL_CONST);
+ pccfstring_type_node
+ = build_pointer_type (ccfstring_type_node);
+ pccfstring_ftype_pcchar
+ = build_function_type_list (pccfstring_type_node,
+ pcchar_type_node, NULL_TREE);
+ lang_hooks.builtin_function ("__builtin___CFStringMakeConstantString",
+ pccfstring_ftype_pcchar,
+ DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING,
+ BUILT_IN_NORMAL, NULL, NULL_TREE);
+
+ /* extern int __CFConstantStringClassReference[]; */
+ cfstring_class_reference
+ = build_decl (VAR_DECL,
+ get_identifier ("__CFConstantStringClassReference"),
+ build_array_type (integer_type_node, NULL_TREE));
+ TREE_PUBLIC (cfstring_class_reference) = 1;
+ TREE_USED (cfstring_class_reference) = 1;
+ DECL_ARTIFICIAL (cfstring_class_reference) = 1;
+ (*lang_hooks.decls.pushdecl) (cfstring_class_reference);
+ DECL_EXTERNAL (cfstring_class_reference) = 1;
+ rest_of_decl_compilation (cfstring_class_reference, 0, 0);
+
+ /* Initialize the hash table used to hold the constant CFString objects. */
+ cfstring_htab = htab_create_ggc (31, cfstring_hash,
+ cfstring_eq, NULL);
+}
+
+tree
+darwin_expand_tree_builtin (tree function, tree params,
+ tree coerced_params ATTRIBUTE_UNUSED)
+{
+ unsigned int fcode = DECL_FUNCTION_CODE (function);
+
+ switch (fcode)
+ {
+ case DARWIN_BUILTIN_CFSTRINGMAKECONSTANTSTRING:
+ if (!darwin_constant_cfstrings)
+ {
+ error ("built-in function `%s' requires `-fconstant-cfstrings' flag",
+ IDENTIFIER_POINTER (DECL_NAME (function)));
+ return error_mark_node;
+ }
+
+ return darwin_build_constant_cfstring (TREE_VALUE (params));
+ default:
+ break;
+ }
+
+ return NULL_TREE;
+}
+
+static hashval_t
+cfstring_hash (const void *ptr)
+{
+ tree str = ((struct cfstring_descriptor *)ptr)->literal;
+ const unsigned char *p = (const unsigned char *) TREE_STRING_POINTER (str);
+ int i, len = TREE_STRING_LENGTH (str);
+ hashval_t h = len;
+
+ for (i = 0; i < len; i++)
+ h = ((h * 613) + p[i]);
+
+ return h;
+}
+
+static int
+cfstring_eq (const void *ptr1, const void *ptr2)
+{
+ tree str1 = ((struct cfstring_descriptor *)ptr1)->literal;
+ tree str2 = ((struct cfstring_descriptor *)ptr2)->literal;
+ int len1 = TREE_STRING_LENGTH (str1);
+
+ return (len1 == TREE_STRING_LENGTH (str2)
+ && !memcmp (TREE_STRING_POINTER (str1), TREE_STRING_POINTER (str2),
+ len1));
+}
+
+tree
+darwin_construct_objc_string (tree str)
+{
+ if (!darwin_constant_cfstrings)
+ return NULL_TREE; /* Fall back to NSConstantString. */
+
+ return darwin_build_constant_cfstring (str);
+}
+
+bool
+darwin_constant_cfstring_p (tree str)
+{
+ struct cfstring_descriptor key;
+ void **loc;
+
+ if (!str)
+ return false;
+
+ STRIP_NOPS (str);
+
+ if (TREE_CODE (str) == ADDR_EXPR)
+ str = TREE_OPERAND (str, 0);
+
+ if (TREE_CODE (str) != STRING_CST)
+ return false;
+
+ key.literal = str;
+ loc = htab_find_slot (cfstring_htab, &key, NO_INSERT);
+
+ if (loc)
+ return true;
+
+ return false;
+}
+
+static tree
+darwin_build_constant_cfstring (tree str)
+{
+ struct cfstring_descriptor *desc, key;
+ void **loc;
+ tree addr;
+
+ if (!str)
+ goto invalid_string;
+
+ STRIP_NOPS (str);
+
+ if (TREE_CODE (str) == ADDR_EXPR)
+ str = TREE_OPERAND (str, 0);
+
+ if (TREE_CODE (str) != STRING_CST)
+ {
+ invalid_string:
+ error ("CFString literal expression is not constant");
+ return error_mark_node;
+ }
+
+ /* Perhaps we already constructed a constant CFString just like this one? */
+ key.literal = str;
+ loc = htab_find_slot (cfstring_htab, &key, INSERT);
+ desc = *loc;
+
+ if (!desc)
+ {
+ tree initlist, constructor, field = TYPE_FIELDS (ccfstring_type_node);
+ tree var;
+ int length = TREE_STRING_LENGTH (str) - 1;
+ /* FIXME: The CFString functionality should probably reside
+ in darwin-c.c. */
+ extern tree pushdecl_top_level (tree);
+
+ if (darwin_warn_nonportable_cfstrings)
+ {
+ extern int isascii (int);
+ const char *s = TREE_STRING_POINTER (str);
+ int l = 0;
+
+ for (l = 0; l < length; l++)
+ if (!s[l] || !isascii (s[l]))
+ {
+ warning ("%s in CFString literal",
+ s[l] ? "non-ASCII character" : "embedded NUL");
+ break;
+ }
+ }
+
+ *loc = desc = ggc_alloc (sizeof (*desc));
+ desc->literal = str;
+
+ initlist = build_tree_list
+ (field, build1 (ADDR_EXPR, pcint_type_node,
+ cfstring_class_reference));
+ field = TREE_CHAIN (field);
+ initlist = tree_cons (field, build_int_cst (NULL_TREE, 0x000007c8),
+ initlist);
+ field = TREE_CHAIN (field);
+ initlist = tree_cons (field,
+ build1 (ADDR_EXPR, pcchar_type_node,
+ str), initlist);
+ field = TREE_CHAIN (field);
+ initlist = tree_cons (field, build_int_cst (NULL_TREE, length),
+ initlist);
+
+ constructor = build_constructor (ccfstring_type_node,
+ nreverse (initlist));
+ TREE_READONLY (constructor) = 1;
+ TREE_CONSTANT (constructor) = 1;
+ TREE_STATIC (constructor) = 1;
+
+ /* Fromage: The C++ flavor of 'build_unary_op' expects constructor nodes
+ to have the TREE_HAS_CONSTRUCTOR (...) bit set. However, this file is
+ being built without any knowledge of C++ tree accessors; hence, we shall
+ use the generic accessor that TREE_HAS_CONSTRUCTOR actually maps to! */
+ if (darwin_running_cxx)
+ TREE_LANG_FLAG_4 (constructor) = 1; /* TREE_HAS_CONSTRUCTOR */
+
+ /* Create an anonymous global variable for this CFString. */
+ var = build_decl (CONST_DECL, NULL, TREE_TYPE (constructor));
+ DECL_INITIAL (var) = constructor;
+ TREE_STATIC (var) = 1;
+ pushdecl_top_level (var);
+ desc->constructor = var;
+ }
+
+ addr = build1 (ADDR_EXPR, pccfstring_type_node, desc->constructor);
+ TREE_CONSTANT (addr) = 1;
+
+ return addr;
+}
+
+/* APPLE LOCAL end constant cfstrings */
+
+/* APPLE LOCAL begin CW asm blocks */
+/* Assume labels like L_foo$stub etc in CW-style inline code are
+ intended to be taken as literal labels, and return the identifier,
+ otherwise return NULL signifying that we have no special
+ knowledge. */
+tree
+darwin_cw_asm_special_label (tree id)
+{
+ const char *name = IDENTIFIER_POINTER (id);
+
+ if (name[0] == 'L')
+ {
+ int len = strlen (name);
+
+ if ((len > 5 && strcmp (name + len - 5, "$stub") == 0)
+ || (len > 9 && strcmp (name + len - 9, "$lazy_ptr") == 0)
+ || (len > 13 && strcmp (name + len - 13, "$non_lazy_ptr") == 0))
+ return id;
+ }
+
+ return NULL_TREE;
+}
+/* APPLE LOCAL end CW asm blocks */
+
#include "gt-darwin.h"
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 027aa6839a3..d74b503a52f 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -80,6 +80,12 @@ Boston, MA 02111-1307, USA. */
#undef DEFAULT_PCC_STRUCT_RETURN
#define DEFAULT_PCC_STRUCT_RETURN 0
+/* APPLE LOCAL begin -Wfour-char-constants */
+/* Don't warn about MacOS-style 'APPL' four-char-constants. */
+#undef WARN_FOUR_CHAR_CONSTANTS
+#define WARN_FOUR_CHAR_CONSTANTS 0
+/* APPLE LOCAL end -Wfour-char-constants */
+
/* This table intercepts weirdo options whose names would interfere
with normal driver conventions, and either translates them into
standardly-named options, or adds a 'Z' so that they can get to
@@ -103,6 +109,10 @@ Boston, MA 02111-1307, USA. */
architecture. */
#define TARGET_OPTION_TRANSLATE_TABLE \
+/* APPLE LOCAL KEXT terminated-vtables */ \
+ { "-fterminated-vtables", "-fapple-kext" }, \
+/* APPLE LOCAL KEXT indirect-virtual-calls --sts */ \
+ { "-findirect-virtual-calls", "-fapple-kext" }, \
{ "-all_load", "-Zall_load" }, \
{ "-allowable_client", "-Zallowable_client" }, \
{ "-arch_errors_fatal", "-Zarch_errors_fatal" }, \
@@ -123,7 +133,8 @@ Boston, MA 02111-1307, USA. */
{ "-segs_read_only_addr", "-Zsegs_read_only_addr" }, \
{ "-segs_read_write_addr", "-Zsegs_read_write_addr" }, \
{ "-seg_addr_table", "-Zseg_addr_table" }, \
- { "-seg_addr_table_filename", "-Zseg_addr_table_filename" }, \
+ /* APPLE LOCAL why did I do that? -- mrs */ \
+ { "-seg_addr_table_filename", "-Zfn_seg_addr_table_filename" }, \
{ "-filelist", "-Xlinker -filelist -Xlinker" }, \
{ "-framework", "-Xlinker -framework -Xlinker" }, \
{ "-flat_namespace", "-Zflat_namespace" }, \
@@ -138,8 +149,28 @@ Boston, MA 02111-1307, USA. */
{ "-static", "-static -Wa,-static" }, \
{ "-single_module", "-Zsingle_module" }, \
{ "-unexported_symbols_list", "-Zunexported_symbols_list" }, \
+ /* APPLE LOCAL ObjC GC */ \
+ { "-fobjc-gc", "-fobjc-gc -Wno-non-lvalue-assign" }, \
+ /* APPLE LOCAL begin constant cfstrings */ \
+ { "-fconstant-cfstrings", "-mconstant-cfstrings" }, \
+ { "-fno-constant-cfstrings", "-mno-constant-cfstrings" }, \
+ { "-Wnonportable-cfstrings", "-mwarn-nonportable-cfstrings" }, \
+ { "-Wno-nonportable-cfstrings", "-mno-warn-nonportable-cfstrings" }, \
+ { "-fpascal-strings", "-mpascal-strings" }, \
+ { "-fno-pascal-strings", "-mno-pascal-strings" }, \
+ /* APPLE LOCAL end constant cfstrings */ \
SUBTARGET_OPTION_TRANSLATE_TABLE
+/* APPLE LOCAL begin constant cfstrings */
+extern int darwin_constant_cfstrings;
+extern const char *darwin_constant_cfstrings_switch;
+extern int darwin_warn_nonportable_cfstrings;
+extern const char *darwin_warn_nonportable_cfstrings_switch;
+extern int darwin_pascal_strings;
+extern const char *darwin_pascal_strings_switch;
+extern int darwin_running_cxx;
+/* APPLE LOCAL end constant cfstrings */
+
/* Nonzero if the user has chosen to force sizeof(bool) to be 1
by providing the -mone-byte-bool switch. It would be better
to use SUBTARGET_SWITCHES for this instead of SUBTARGET_OPTIONS,
@@ -156,7 +187,96 @@ extern const char *darwin_fix_and_continue_switch;
{"fix-and-continue", &darwin_fix_and_continue_switch, \
N_("Generate code suitable for fast turn around debugging"), 0}, \
{"no-fix-and-continue", &darwin_fix_and_continue_switch, \
- N_("Don't generate code suitable for fast turn around debugging"), 0}
+/* APPLE LOCAL begin constant cfstrings */ \
+ N_("Don't generate code suitable for fast turn around debugging"), 0}, \
+ {"constant-cfstrings", &darwin_constant_cfstrings_switch, \
+ N_("Generate compile-time CFString objects"), 0}, \
+ {"no-constant-cfstrings", &darwin_constant_cfstrings_switch, "", 0}, \
+ {"pascal-strings", &darwin_pascal_strings_switch, \
+ N_("Allow use of Pascal strings"), 0}, \
+ {"no-pascal-strings", &darwin_pascal_strings_switch, "", 0}, \
+ {"warn-nonportable-cfstrings", &darwin_warn_nonportable_cfstrings_switch, \
+ N_("Warn if constant CFString objects contain non-portable characters"), 0}, \
+ {"no-warn-nonportable-cfstrings", &darwin_warn_nonportable_cfstrings_switch, "", 0}
+
+#define SUBTARGET_OS_CPP_BUILTINS() \
+ do \
+ { \
+ builtin_define ("__MACH__"); \
+ builtin_define ("__APPLE__"); \
+ if (darwin_constant_cfstrings) \
+ builtin_define ("__CONSTANT_CFSTRINGS__"); \
+ /* APPLE LOCAL begin pascal strings */ \
+ if (darwin_pascal_strings) \
+ { \
+ builtin_define ("__PASCAL_STRINGS__"); \
+ } \
+ /* APPLE LOCAL end pascal strings */ \
+ /* APPLE LOCAL begin ObjC GC */ \
+ if (flag_objc_gc) \
+ { \
+ builtin_define ("__strong=__attribute__((objc_gc(strong)))"); \
+ builtin_define ("__OBJC_GC__"); \
+ } \
+ else \
+ builtin_define ("__strong="); \
+ /* APPLE LOCAL end ObjC GC */ \
+ } \
+ while (0)
+
+#define SUBSUBTARGET_OVERRIDE_OPTIONS \
+do { \
+ /* APPLE LOCAL kext */ \
+ extern int flag_weak; \
+ if (darwin_constant_cfstrings_switch) \
+ { \
+ const char *base = darwin_constant_cfstrings_switch; \
+ while (base[-1] != 'm') base--; \
+ \
+ if (*darwin_constant_cfstrings_switch != '\0') \
+ error ("invalid option `%s'", base); \
+ darwin_constant_cfstrings = (base[0] != 'n'); \
+ } \
+ if (darwin_warn_nonportable_cfstrings_switch) \
+ { \
+ const char *base = darwin_warn_nonportable_cfstrings_switch; \
+ while (base[-1] != 'm') base--; \
+ \
+ if (*darwin_warn_nonportable_cfstrings_switch != '\0') \
+ error ("invalid option `%s'", base); \
+ darwin_warn_nonportable_cfstrings = (base[0] != 'n'); \
+ } \
+ if (darwin_pascal_strings_switch) \
+ { \
+ const char *base = darwin_pascal_strings_switch; \
+ while (base[-1] != 'm') base--; \
+ \
+ if (*darwin_pascal_strings_switch != '\0') \
+ error ("invalid option `%s'", base); \
+ darwin_pascal_strings = (base[0] != 'n'); \
+ if (darwin_pascal_strings) \
+ CPP_OPTION (parse_in, pascal_strings) = 1; \
+ } \
+ /* The c_dialect...() macros are not available to us here. */ \
+ darwin_running_cxx = (strstr (lang_hooks.name, "C++") != 0); \
+ /* APPLE LOCAL begin kexts --bowdidge */ \
+ /* kexts should always be built without the coalesced sections */ \
+ /* because the kernel loader doesn't grok such sections. */ \
+ if (flag_apple_kext) flag_weak = 0; \
+ /* APPLE LOCAL end kexts */ \
+} while(0)
+
+#define SUBTARGET_INIT_BUILTINS \
+do { \
+ darwin_init_cfstring_builtins (); \
+} while(0)
+
+#undef TARGET_EXPAND_TREE_BUILTIN
+#define TARGET_EXPAND_TREE_BUILTIN darwin_expand_tree_builtin
+#undef TARGET_CONSTRUCT_OBJC_STRING
+#define TARGET_CONSTRUCT_OBJC_STRING darwin_construct_objc_string
+
+/* APPLE LOCAL end constant cfstrings */
/* These compiler options take n arguments. */
@@ -185,7 +305,8 @@ extern const char *darwin_fix_and_continue_switch;
!strcmp (STR, "Zsegs_read_only_addr") ? 1 : \
!strcmp (STR, "Zsegs_read_write_addr") ? 1 : \
!strcmp (STR, "Zseg_addr_table") ? 1 : \
- !strcmp (STR, "Zseg_addr_table_filename") ?1 :\
+ /* APPLE LOCAL why did I do that? -- mrs */ \
+ !strcmp (STR, "Zfn_seg_addr_table_filename") ? 1 :\
!strcmp (STR, "seg1addr") ? 1 : \
!strcmp (STR, "segprot") ? 3 : \
!strcmp (STR, "sub_library") ? 1 : \
@@ -208,8 +329,15 @@ extern const char *darwin_fix_and_continue_switch;
isn't. */
#undef CPP_SPEC
-#define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__}\
- -D__APPLE_CC__=1"
+/* APPLE LOCAL __APPLE__ setting, don't set __APPLE__ here, as we do it someplace else */
+#define CPP_SPEC "%{static:%{!dynamic:-D__STATIC__}}%{!static:-D__DYNAMIC__} \
+"/* APPLE LOCAL -arch */"\
+ %{arch}"
+
+/* APPLE LOCAL begin private extern */
+#undef CC1PLUS_SPEC
+#define CC1PLUS_SPEC "-D__private_extern__=extern"
+/* APPLE LOCAL end private extern */
/* This is mostly a clone of the standard LINK_COMMAND_SPEC, plus
precomp, libtool, and fat build additions. Also we
@@ -226,7 +354,8 @@ extern const char *darwin_fix_and_continue_switch;
%{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \
%{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
%{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \
- %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} \
+"/* APPLE LOCAL add fcreate-profile */"\
+ %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|fcreate-profile:-lgcov} \
%{!nostdlib:%{!nodefaultlibs:%G %L}} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}"
@@ -291,7 +420,8 @@ extern const char *darwin_fix_and_continue_switch;
%{Zsegs_read_only_addr*:-segs_read_only_addr %*} \
%{Zsegs_read_write_addr*:-segs_read_write_addr %*} \
%{Zseg_addr_table*: -seg_addr_table %*} \
- %{Zseg_addr_table_filename*:-seg_addr_table_filename %*} \
+ "/* APPLE LOCAL why did I do that? -- mrs */" \
+ %{Zfn_seg_addr_table_filename*:-seg_addr_table_filename %*} \
%{sub_library*} %{sub_umbrella*} \
%{twolevel_namespace} %{twolevel_namespace_hints} \
%{umbrella*} \
@@ -315,12 +445,24 @@ extern const char *darwin_fix_and_continue_switch;
#define LIB_SPEC "%{!static:-lSystem}"
#endif
-/* -dynamiclib implies -shared-libgcc just like -shared would on linux. */
-#define REAL_LIBGCC_SPEC \
- "%{static|static-libgcc:-lgcc -lgcc_eh}\
- %{!static:%{!static-libgcc:\
- %{!Zdynamiclib:%{!shared-libgcc:-lgcc -lgcc_eh}\
- %{shared-libgcc:-lgcc_s -lgcc}} %{Zdynamiclib:-lgcc_s -lgcc}}}"
+/* APPLE LOCAL begin Handle static/shared libgcc correctly (radar 3554191, 3127145) */
+#undef LIBGCC_SPEC
+#undef REAL_LIBGCC_SPEC
+/* APPLE LOCAL 64-bit bringup */
+#ifdef ENABLE_SHARED_LIBGCC
+#define REAL_LIBGCC_SPEC \
+ "%{static:-lgcc_static} \
+ %{!static:%{static-libgcc:-lgcc -lgcc_eh} \
+ %{!static-libgcc:%{shared-libgcc:-lgcc_s%M -lgcc} \
+ %{!shared-libgcc:-lgcc -lgcc_eh}}}"
+#else
+#define REAL_LIBGCC_SPEC \
+ "%{static:-lgcc_static} \
+ %{!static:%{static-libgcc:-lgcc} \
+ %{!static-libgcc:%{shared-libgcc:-lgcc_s%M -lgcc} \
+ %{!shared-libgcc:-lgcc}}}"
+#endif /* ENABLE_SHARED_LIBGCC */
+/* APPLE LOCAL end Handle static/shared libgcc correctly (radar 3554191, 3127145) */
/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
/* We don't want anything to do with crt2.o in the 64-bit case;
@@ -368,6 +510,12 @@ extern const char *darwin_fix_and_continue_switch;
#define DEBUG_STR_SECTION "__DWARFA,__debug_str"
#define DEBUG_RANGES_SECTION "__DWARFA,__debug_ranges"
+/* APPLE LOCAL begin gdb only used symbols */
+/* Support option to generate stabs for only used symbols. */
+
+#define DBX_ONLY_USED_SYMBOLS
+/* APPLE LOCAL end gdb only used symbols */
+
/* When generating stabs debugging, use N_BINCL entries. */
#define DBX_USE_BINCL
@@ -447,6 +595,10 @@ extern const char *darwin_fix_and_continue_switch;
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP
+/* APPLE LOCAL begin static structors in __StaticInit section */
+#define STATIC_INIT_SECTION "__TEXT,__StaticInit,regular,pure_instructions"
+/* APPLE LOCAL end static structors in __StaticInit section */
+
#undef INVOKE__main
#define TARGET_ASM_CONSTRUCTOR machopic_asm_out_constructor
@@ -551,7 +703,12 @@ extern const char *darwin_fix_and_continue_switch;
machopic_validate_stub_or_non_lazy_ptr (xname); \
else if (len > 14 && !strcmp ("$non_lazy_ptr", xname + len - 13)) \
machopic_validate_stub_or_non_lazy_ptr (xname); \
- fputs (&xname[1], FILE); \
+ /* APPLE LOCAL begin Objective-C++ */ \
+ if (xname[1] != '"' && name_needs_quotes (&xname[1])) \
+ fprintf (FILE, "\"%s\"", &xname[1]); \
+ else \
+ fputs (&xname[1], FILE); \
+ /* APPLE LOCAL end Objective-C++ */ \
} \
else if (xname[0] == '+' || xname[0] == '-') \
fprintf (FILE, "\"%s\"", xname); \
@@ -559,6 +716,10 @@ extern const char *darwin_fix_and_continue_switch;
fprintf (FILE, "L%s", xname); \
else if (!strncmp (xname, ".objc_class_name_", 17)) \
fprintf (FILE, "%s", xname); \
+ /* APPLE LOCAL begin Objective-C++ */ \
+ else if (xname[0] != '"' && name_needs_quotes (xname)) \
+ fprintf (FILE, "\"%s\"", xname); \
+ /* APPLE LOCAL end Objective-C++ */ \
else \
asm_fprintf (FILE, "%U%s", xname); \
} while (0)
@@ -642,6 +803,8 @@ FUNCTION (void) \
in_objc_image_info, \
in_objc_class_names, in_objc_meth_var_names, \
in_objc_meth_var_types, in_objc_cls_refs, \
+ /* APPLE LOCAL constant cfstrings */ \
+ in_cfstring_constant_object, \
in_machopic_nl_symbol_ptr, \
in_machopic_lazy_symbol_ptr, \
in_machopic_symbol_stub, \
@@ -751,6 +914,14 @@ SECTION_FUNCTION (objc_constant_string_object_section, \
in_objc_constant_string_object, \
".section __OBJC, __cstring_object, regular, " \
"no_dead_strip", 1) \
+/* APPLE LOCAL begin constant cfstrings */ \
+/* Unlike constant NSStrings, constant CFStrings do not live */\
+/* in the __OBJC segment since they may also occur in pure C */\
+/* or C++ programs. */\
+SECTION_FUNCTION (cfstring_constant_object_section, \
+ in_cfstring_constant_object, \
+ ".section __DATA, __cfstring", 0) \
+/* APPLE LOCAL end constant cfstrings */ \
/* Fix-and-Continue image marker. */ \
SECTION_FUNCTION (objc_image_info_section, \
in_objc_image_info, \
@@ -870,6 +1041,13 @@ objc_section_init (void) \
#define GLOBAL_ASM_OP ".globl "
#define TARGET_ASM_GLOBALIZE_LABEL darwin_globalize_label
+/* APPLE LOCAL begin weak definition */
+#define ASM_WEAK_DEFINITIONIZE_LABEL(FILE, NAME) \
+ do { const char* _x = (NAME); if (!!strncmp (_x, "_OBJC_", 6)) { \
+ fputs (".weak_definition ", FILE); assemble_name (FILE, _x); \
+ fputs ("\n", FILE); }} while (0)
+/* APPLE LOCAL end weak definition */
+
/* Emit an assembler directive to set visibility for a symbol. Used
to support visibility attribute and Darwin's private extern
feature. */
@@ -879,6 +1057,12 @@ objc_section_init (void) \
/* Extra attributes for Darwin. */
#define SUBTARGET_ATTRIBUTE_TABLE \
/* { name, min_len, max_len, decl_req, type_req, fn_type_req, handler } */ \
+ /* APPLE LOCAL begin KEXT double destructor */ \
+ { "apple_kext_compatibility", 0, 0, false, true, false, \
+ darwin_handle_odd_attribute }, \
+ /* APPLE LOCAL end KEXT double destructor */ \
+ /* APPLE LOCAL ObjC GC */ \
+ { "objc_gc", 1, 1, 0, 0, 0, darwin_handle_objc_gc_attribute }, \
{ "weak_import", 0, 0, true, false, false, \
darwin_handle_weak_import_attribute }
@@ -925,6 +1109,12 @@ enum machopic_addr_class {
#undef TARGET_STRIP_NAME_ENCODING
#define TARGET_STRIP_NAME_ENCODING default_strip_name_encoding
+/* APPLE LOCAL begin what is this for? */
+/* Be conservative and always redo the encoding. */
+
+#define REDO_SECTION_INFO_P(DECL) (1)
+/* APPLE LOCAL end what is this for? */
+
#define GEN_BINDER_NAME_FOR_STUB(BUF,STUB,STUB_LENGTH) \
do { \
const char *const stub_ = (STUB); \
@@ -1013,6 +1203,19 @@ enum machopic_addr_class {
#define JUMP_TABLES_IN_TEXT_SECTION 1
#endif
+/* APPLE LOCAL begin OS pragma hook */
+#define REGISTER_OS_PRAGMAS() \
+ do { \
+ /* APPLE LOCAL begin Macintosh alignment 2002-1-22 --ff */ \
+ c_register_pragma (0, "pack", darwin_pragma_pack); \
+ /* APPLE LOCAL end Macintosh alignment 2002-1-22 --ff */ \
+ /* APPLE LOCAL begin CALL_ON_LOAD/CALL_ON_UNLOAD pragmas 20020202 --turly */ \
+ c_register_pragma (0, "CALL_ON_LOAD", darwin_pragma_call_on_load); \
+ c_register_pragma (0, "CALL_ON_UNLOAD", darwin_pragma_call_on_unload); \
+ /* APPLE LOCAL end CALL_ON_LOAD/CALL_ON_UNLOAD pragmas 20020202 --turly */ \
+ } while (0)
+/* APPLE LOCAL end OS pragma hook */
+
#define TARGET_TERMINATE_DW2_EH_FRAME_INFO false
#undef TARGET_ASM_NAMED_SECTION
@@ -1023,9 +1226,78 @@ enum machopic_addr_class {
c_register_pragma (0, "mark", darwin_pragma_ignore); \
c_register_pragma (0, "options", darwin_pragma_options); \
c_register_pragma (0, "segment", darwin_pragma_ignore); \
+ /* APPLE LOCAL pragma fenv */ \
+ c_register_pragma ("GCC", "fenv", darwin_pragma_fenv); \
c_register_pragma (0, "unused", darwin_pragma_unused); \
} while (0)
+/* APPLE LOCAL begin insert assembly ".abort" directive on fatal error */
+#define EXIT_FROM_FATAL_DIAGNOSTIC(status) abort_assembly_and_exit (status)
+extern void abort_assembly_and_exit (int status) ATTRIBUTE_NORETURN;
+/* APPLE LOCAL end insert assembly ".abort" directive on fatal error */
+
+/* APPLE LOCAL begin Macintosh alignment 2002-2-13 --ff */
+#ifdef RS6000_VECTOR_ALIGNMENT
+/* When adjusting (lowering) the alignment of fields when in the
+ mac68k alignment mode, the 128-bit alignment of vectors *MUST*
+ be preserved. */
+#define PEG_ALIGN_FOR_MAC68K(DESIRED) \
+ ((TARGET_ALTIVEC && (DESIRED) == RS6000_VECTOR_ALIGNMENT) \
+ ? RS6000_VECTOR_ALIGNMENT \
+ : MIN ((DESIRED), 16))
+#else
+#define PEG_ALIGN_FOR_MAC68K(DESIRED) MIN ((DESIRED), 16)
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-13 --ff */
+
+/* APPLE LOCAL begin KEXT double destructor */
+/* Need a mechanism to tell whether a C++ operator delete is empty so
+ we overload TREE_SIDE_EFFECTS here (it is unused for FUNCTION_DECLS.)
+ Fromage, c'est moi! */
+#define CHECK_TRIVIAL_FUNCTION(DECL) \
+ do { \
+ const char *_name = IDENTIFIER_POINTER (DECL_NAME (DECL)); \
+ if (flag_apple_kext && DECL_SAVED_TREE (DECL) \
+ && strstr (_name, "operator delete") \
+ && TREE_CODE (DECL_SAVED_TREE (DECL)) == COMPOUND_STMT \
+ && compound_body_is_empty_p ( \
+ COMPOUND_BODY (DECL_SAVED_TREE (DECL))))\
+ TREE_SIDE_EFFECTS (DECL) = 1; \
+ } while (0)
+
+/* gcc3 initialises the vptr field of all objects so that it points at the
+ first virtual function slot, NOT the base address of the vtable proper.
+ This is different from gcc2.95 which always initialised the vptr to
+ point at the base address of the vtable. The difference here is 8 bytes.
+ So, for 2.95 compatibility, we need to:
+
+ (1) subtract 8 from the vptr initialiser, and
+ (2) add 2 to every vfunc index. (2 * 4 == 8.)
+
+ This is getting ever cheesier. */
+
+#define VPTR_INITIALIZER_ADJUSTMENT 8
+#define ADJUST_VTABLE_INDEX(IDX, VTBL) \
+ do { \
+ if (flag_apple_kext) \
+ (IDX) = fold (build2 (PLUS_EXPR, TREE_TYPE (IDX), IDX, size_int (2))); \
+ } while (0)
+/* APPLE LOCAL end KEXT double destructor */
+
+/* APPLE LOCAL begin zerofill 20020218 --turly */
+/* This keeps uninitialized data from bloating the data when -fno-common.
+ Radar 2863107. */
+#define ASM_OUTPUT_ZEROFILL(FILE, NAME, SIZE, ALIGNMENT) \
+ do { \
+ fputs (".zerofill __DATA, __common, ", (FILE)); \
+ assemble_name ((FILE), (NAME)); \
+ fprintf ((FILE), ", " HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT) (SIZE)); \
+ fprintf ((FILE), ", " HOST_WIDE_INT_PRINT_DEC "\n", \
+ (HOST_WIDE_INT) (ALIGNMENT)); \
+ in_section = no_section; \
+ } while (0)
+/* APPLE LOCAL end zerofill 20020218 --turly */
+
#undef ASM_APP_ON
#define ASM_APP_ON ""
#undef ASM_APP_OFF
@@ -1046,6 +1318,12 @@ void add_framework_path (char *);
#define TARGET_C99_FUNCTIONS 0
#endif
+/* APPLE LOCAL begin KEXT ctors return this */
+/* For Apple KEXTs, we make the constructors return this to match gcc
+ 2.95. */
+#define TARGET_CXX_CDTOR_RETURNS_THIS (flag_apple_kext_p)
+/* APPLE LOCAL end KEXT ctors return this */
+
#define WINT_TYPE "int"
#endif /* CONFIG_DARWIN_H */
diff --git a/gcc/config/darwin8.h b/gcc/config/darwin8.h
index 6a061a41caf..3fc0c1d7453 100644
--- a/gcc/config/darwin8.h
+++ b/gcc/config/darwin8.h
@@ -22,11 +22,15 @@ Boston, MA 02111-1307, USA. */
/* Darwin 7.0 and above have C99 functions. */
#define TARGET_C99_FUNCTIONS 1
-/* Machine dependent libraries. Include libmx when compiling on Darwin 7.0
- and above. Include libSystemStubs when compiling on 8.0 and above and
- not 64-bit long double. */
+/* APPLE LOCAL begin mainline */
+/* Machine dependent libraries. Include libmx when compiling on
+ Darwin 7.0 and above, but before libSystem, since the functions are
+ actually in libSystem but for 7.x compatibility we want them to be
+ looked for in libmx first. Include libSystemStubs when compiling
+ on 8.0 and above and not 64-bit long double. */
#undef LIB_SPEC
#define LIB_SPEC "%{!static:\
%{!mlong-double-64:%{pg:-lSystemStubs_profile;:-lSystemStubs}} \
- -lSystem -lmx}"
+ -lmx -lSystem}"
+/* APPLE LOCAL end mainline */
diff --git a/gcc/config/i386/darwin.h b/gcc/config/i386/darwin.h
index ec816259bde..e7310412a05 100644
--- a/gcc/config/i386/darwin.h
+++ b/gcc/config/i386/darwin.h
@@ -1,5 +1,6 @@
/* Target definitions for x86 running Darwin.
- Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc.
+ APPLE LOCAL copyright
+ Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
Contributed by Apple Computer Inc.
This file is part of GCC.
@@ -23,6 +24,12 @@ Boston, MA 02111-1307, USA. */
#undef TARGET_MACHO
#define TARGET_MACHO 1
+/* APPLE LOCAL begin default to ppro */
+/* Default to -mcpu=pentiumpro instead of i386 (radar 2730299) ilr */
+#undef TARGET_CPU_DEFAULT
+#define TARGET_CPU_DEFAULT 4
+/* APPLE LOCAL end default to ppro */
+
#define TARGET_VERSION fprintf (stderr, " (i686 Darwin)");
#define TARGET_OS_CPP_BUILTINS() \
@@ -30,8 +37,9 @@ Boston, MA 02111-1307, USA. */
{ \
builtin_define ("__i386__"); \
builtin_define ("__LITTLE_ENDIAN__"); \
- builtin_define ("__MACH__"); \
- builtin_define ("__APPLE__"); \
+ /* APPLE LOCAL remove __MACH__ and __APPLE__, defined in gcc/config/darwin.h */\
+ /* APPLE LOCAL constant cfstrings */ \
+ SUBTARGET_OS_CPP_BUILTINS (); \
} \
while (0)
@@ -39,16 +47,27 @@ Boston, MA 02111-1307, USA. */
the kernel or some such. */
#undef CC1_SPEC
-#define CC1_SPEC "%{!static:-fPIC}\
- %{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }}"
+/* APPLE LOCAL begin dynamic-no-pic */
+/* When -mdynamic-no-pic finally works, remove the "xx" below. FIXME!! */
+#define CC1_SPEC "\
+%{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \
+"/* APPLE LOCAL ignore -mcpu=G4 -mcpu=G5 */"\
+%{!static:%{!mxxdynamic-no-pic:-fPIC}} %<faltivec %<mno-fused-madd %<mlong-branch %<mlongcall %<mcpu=G4 %<mcpu=G5"
+/* APPLE LOCAL end dynamic-no-pic */
+
+/* APPLE LOCAL AltiVec */
+#define CPP_ALTIVEC_SPEC "%<faltivec"
#undef ASM_SPEC
-#define ASM_SPEC "-arch i686 -force_cpusubtype_ALL"
+/* APPLE LOCAL Mach-O wants only i386 here */
+#define ASM_SPEC "-arch i386 -force_cpusubtype_ALL"
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
- { "darwin_arch", "i686" }, \
- { "darwin_subarch", "%{march=pentium3:pentIIm3;:i686}" },
+ /* APPLE LOCAL begin Mach-O wants only i386 here */ \
+ { "darwin_arch", "i386" }, \
+ { "darwin_subarch", "i386" },
+ /* APPLE LOCAL end Mach-O wants only i386 here */
/* Use the following macro for any Darwin/x86-specific command-line option
@@ -76,7 +95,10 @@ Boston, MA 02111-1307, USA. */
/* By default, target has a 80387, uses IEEE compatible arithmetic,
and returns float values in the 387. */
-#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS)
+/* APPLE LOCAL begin long double default size --mrs */
+/* MERGE FIXME: 0 & to make the build go */
+#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | (0 & MASK_128BIT_LONG_DOUBLE))
+/* APPLE LOCAL end long double default size -- mrs */
/* TARGET_DEEP_BRANCH_PREDICTION is incompatible with Mach-O PIC. */
@@ -131,6 +153,37 @@ Boston, MA 02111-1307, USA. */
assemble_name ((FILE), (NAME)), \
fprintf ((FILE), ","HOST_WIDE_INT_PRINT_UNSIGNED"\n", (ROUNDED)))
+
+/* APPLE LOCAL begin Macintosh alignment 2002-2-19 --ff */
+#define MASK_ALIGN_NATURAL 0x40000000
+#define TARGET_ALIGN_NATURAL (target_flags & MASK_ALIGN_NATURAL)
+#define rs6000_alignment_flags target_flags
+#define MASK_ALIGN_MAC68K 0x20000000
+#define TARGET_ALIGN_MAC68K (target_flags & MASK_ALIGN_MAC68K)
+
+#define REGISTER_TARGET_PRAGMAS DARWIN_REGISTER_TARGET_PRAGMAS
+
+#define ROUND_TYPE_ALIGN(TYPE, COMPUTED, SPECIFIED) \
+ (((TREE_CODE (TYPE) == RECORD_TYPE \
+ || TREE_CODE (TYPE) == UNION_TYPE \
+ || TREE_CODE (TYPE) == QUAL_UNION_TYPE) \
+ && TARGET_ALIGN_MAC68K \
+ && MAX (COMPUTED, SPECIFIED) == 8) ? 16 \
+ : MAX (COMPUTED, SPECIFIED))
+
+#undef SUBTARGET_SWITCHES
+#define SUBTARGET_SWITCHES \
+ {"align-mac68k", MASK_ALIGN_MAC68K, \
+ N_("Align structs and unions according to mac68k rules")}, \
+ {"align-power", - (MASK_ALIGN_MAC68K | MASK_ALIGN_NATURAL), \
+ N_("Align structs and unions according to PowerPC rules")}, \
+ {"align-natural", MASK_ALIGN_NATURAL, \
+ N_("Align structs and unions according to natural rules")}, \
+ {"dynamic-no-pic", MASK_MACHO_DYNAMIC_NO_PIC, \
+ N_("Generate code suitable for executables (NOT shared libs)")},\
+ {"no-dynamic-no-pic", -MASK_MACHO_DYNAMIC_NO_PIC, ""},
+/* APPLE LOCAL end Macintosh alignment 2002-2-19 --ff */
+
/* Darwin profiling -- call mcount. */
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(FILE, LABELNO) \
@@ -143,3 +196,17 @@ Boston, MA 02111-1307, USA. */
} \
else fprintf (FILE, "\tcall mcount\n"); \
} while (0)
+
+/* APPLE LOCAL begin SSE stack alignment */
+#define BASIC_STACK_BOUNDARY (128)
+/* APPLE LOCAL end SSE stack alignment */
+
+/* APPLE LOCAL begin default to ppro */
+#undef SUBTARGET_OVERRIDE_OPTIONS
+/* Force Darwin/x86 to default as "-march=i686 -mcpu=pentium4". */
+#define SUBTARGET_OVERRIDE_OPTIONS \
+ do { \
+ if (!ix86_arch_string) ix86_arch_string = "pentiumpro"; \
+ if (!ix86_tune_string) ix86_tune_string = "pentium4"; \
+ } while (0)
+/* APPLE LOCAL end default to ppro */
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index bc680c80df9..cecba134765 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -49,6 +49,11 @@ Boston, MA 02111-1307, USA. */
#include "cgraph.h"
#include "tree-gimple.h"
+/* APPLE LOCAL begin pascal strings */
+#include "../../libcpp/internal.h"
+extern struct cpp_reader* parse_in;
+/* APPLE LOCAL end pascal strings */
+
#ifndef CHECK_STACK_LIMIT
#define CHECK_STACK_LIMIT (-1)
#endif
@@ -505,6 +510,34 @@ struct processor_costs nocona_cost = {
const struct processor_costs *ix86_cost = &pentium_cost;
+/* APPLE LOCAL begin Altivec */
+/* vector types */
+static GTY(()) tree unsigned_V16QI_type_node;
+static GTY(()) tree unsigned_V4SI_type_node;
+static GTY(()) tree unsigned_V8QI_type_node;
+static GTY(()) tree unsigned_V8HI_type_node;
+static GTY(()) tree unsigned_V4HI_type_node;
+static GTY(()) tree unsigned_V2HI_type_node;
+static GTY(()) tree unsigned_V2SI_type_node;
+static GTY(()) tree unsigned_V2DI_type_node;
+static GTY(()) tree unsigned_V1DI_type_node;
+
+static GTY(()) tree V16QI_type_node;
+static GTY(()) tree V4SF_type_node;
+static GTY(()) tree V4SI_type_node;
+static GTY(()) tree V8QI_type_node;
+static GTY(()) tree V8HI_type_node;
+static GTY(()) tree V4HI_type_node;
+static GTY(()) tree V2HI_type_node;
+static GTY(()) tree V2SI_type_node;
+static GTY(()) tree V2SF_type_node;
+static GTY(()) tree V2DI_type_node;
+static GTY(()) tree V2DF_type_node;
+static GTY(()) tree V16SF_type_node;
+static GTY(()) tree V1DI_type_node;
+static GTY(()) tree V4DF_type_node;
+/* APPLE LOCAL end Altivec */
+
/* Processor feature/optimization bitmasks. */
#define m_386 (1<<PROCESSOR_I386)
#define m_486 (1<<PROCESSOR_I486)
@@ -919,6 +952,11 @@ static rtx ix86_struct_value_rtx (tree, int);
static bool ix86_ms_bitfield_layout_p (tree);
static tree ix86_handle_struct_attribute (tree *, tree, tree, int, bool *);
static int extended_reg_mentioned_1 (rtx *, void *);
+/* APPLE LOCAL begin why is this local? */
+#if TARGET_MACHO
+static bool ix86_binds_local_p (tree);
+#endif
+/* APPLE LOCAL end why is this local? */
static bool ix86_rtx_costs (rtx, int, int, int *);
static int min_insn_size (rtx);
static tree ix86_md_asm_clobbers (tree clobbers);
@@ -1030,6 +1068,13 @@ static void init_ext_80387_constants (void);
#undef TARGET_MS_BITFIELD_LAYOUT_P
#define TARGET_MS_BITFIELD_LAYOUT_P ix86_ms_bitfield_layout_p
+/* APPLE LOCAL begin why is this local? */
+#if TARGET_MACHO
+#undef TARGET_BINDS_LOCAL_P
+#define TARGET_BINDS_LOCAL_P ix86_binds_local_p
+#endif
+/* APPLE LOCAL end why is this local? */
+
#undef TARGET_ASM_OUTPUT_MI_THUNK
#define TARGET_ASM_OUTPUT_MI_THUNK x86_output_mi_thunk
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
@@ -1043,6 +1088,12 @@ static void init_ext_80387_constants (void);
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST ix86_address_cost
+/* APPLE LOCAL begin SSE stack alignment */
+#ifndef BASIC_STACK_BOUNDARY
+#define BASIC_STACK_BOUNDARY (32)
+#endif
+/* APPLE LOCAL end SSE stack alignment */
+
#undef TARGET_FIXED_CONDITION_CODE_REGS
#define TARGET_FIXED_CONDITION_CODE_REGS ix86_fixed_condition_code_regs
#undef TARGET_CC_MODES_COMPATIBLE
@@ -1203,6 +1254,12 @@ override_options (void)
SUBTARGET_OVERRIDE_OPTIONS;
#endif
+ /* APPLE LOCAL begin constant cfstrings */
+#ifdef SUBSUBTARGET_OVERRIDE_OPTIONS
+ SUBSUBTARGET_OVERRIDE_OPTIONS;
+#endif
+ /* APPLE LOCAL end constant cfstrings */
+
/* Set the default values for switches whose default depends on TARGET_64BIT
in case they weren't overwritten by command line options. */
if (TARGET_64BIT)
@@ -1426,9 +1483,11 @@ override_options (void)
The default of 128 bits is for Pentium III's SSE __m128, but we
don't want additional code to keep the stack aligned when
optimizing for code size. */
+ /* APPLE LOCAL begin SSE stack alignment */
ix86_preferred_stack_boundary = (optimize_size
- ? TARGET_64BIT ? 128 : 32
+ ? TARGET_64BIT ? 128 : BASIC_STACK_BOUNDARY
: 128);
+ /* APPLE LOCAL end SSE stack alignment */
if (ix86_preferred_stack_boundary_string)
{
i = atoi (ix86_preferred_stack_boundary_string);
@@ -1583,11 +1642,25 @@ override_options (void)
so it won't slow down the compilation and make x87 code slower. */
if (!TARGET_SCHEDULE)
flag_schedule_insns_after_reload = flag_schedule_insns = 0;
+
+ /* APPLE LOCAL begin dynamic-no-pic */
+ if (flag_pic == 1)
+ {
+ /* Darwin doesn't support -fpic. */
+ warning ("-fpic is not supported; -fPIC assumed");
+ flag_pic = 2;
+ }
+ /* APPLE LOCAL end dynamic-no-pic */
}
void
optimization_options (int level, int size ATTRIBUTE_UNUSED)
{
+ /* APPLE LOCAL begin disable strict aliasing; breaks too much existing code. */
+#if TARGET_MACHO
+ flag_strict_aliasing = 0;
+#endif
+ /* APPLE LOCAL end disable strict aliasing; breaks too much existing code. */
/* For -O2 and beyond, turn off -fschedule-insns by default. It tends to
make the problem with not enough registers even worse. */
#ifdef INSN_SCHEDULING
@@ -1595,6 +1668,14 @@ optimization_options (int level, int size ATTRIBUTE_UNUSED)
flag_schedule_insns = 0;
#endif
+ /* APPLE LOCAL begin pragma fenv */
+ /* Trapping math is not needed by many users, and is expensive.
+ C99 permits us to default it off and we do that. It is
+ turned on when <fenv.h> is included (see darwin_pragma_fenv
+ in darwin-c.c). */
+ flag_trapping_math = 0;
+ /* APPLE LOCAL end pragma fenv */
+
/* The default values of these switches depend on the TARGET_64BIT
that is not known at this moment. Mark these values with 2 and
let user the to override these. In case there is no command line option
@@ -5891,7 +5972,19 @@ output_pic_addr_const (FILE *file, rtx x, int code)
if (SYMBOL_REF_DECL (x))
mark_decl_referenced (SYMBOL_REF_DECL (x));
+ /* APPLE LOCAL begin stubify optimized symbols */
+#if TARGET_MACHO
+ {
+ const char *name = XSTR (x, 0);
+ if (MACHOPIC_INDIRECT
+ && machopic_classify_symbol (x) == MACHOPIC_UNDEFINED_FUNCTION)
+ name = machopic_indirection_name (x, /*stub_p=*/true);
+ assemble_name (file, name);
+ }
+#else
assemble_name (file, XSTR (x, 0));
+#endif
+ /* APPLE LOCAL end stubify optimized symbols */
if (!TARGET_MACHO && code == 'P' && ! SYMBOL_REF_LOCAL_P (x))
fputs ("@PLT", file);
break;
@@ -13235,6 +13328,12 @@ ix86_init_builtins (void)
{
if (TARGET_MMX)
ix86_init_mmx_sse_builtins ();
+
+ /* APPLE LOCAL begin constant cfstrings */
+#ifdef SUBTARGET_INIT_BUILTINS
+ SUBTARGET_INIT_BUILTINS;
+#endif
+ /* APPLE LOCAL end constant cfstrings */
}
/* Set up all the MMX/SSE builtins. This is not called if TARGET_MMX
@@ -15190,6 +15289,21 @@ ix86_memory_move_cost (enum machine_mode mode, enum reg_class class, int in)
}
}
+/* APPLE LOCAL begin why is this local? */
+#if TARGET_MACHO
+/* Cross-module name binding. Darwin does not support overriding
+ functions at dynamic-link time. */
+
+static bool
+ix86_binds_local_p (tree decl)
+{
+ /* APPLE LOCAL kext treat vtables as overridable */
+ return default_binds_local_p_1 (decl,
+ flag_apple_kext && lang_hooks.vtable_p (decl));
+}
+#endif
+/* APPLE LOCAL end why is this local? */
+
/* Compute a (partial) cost for rtx X. Return true if the complete
cost has been computed, and false if subexpressions should be
scanned. In either case, *TOTAL contains the cost result. */
@@ -15873,6 +15987,14 @@ x86_field_alignment (tree field, int computed)
if (TARGET_64BIT || TARGET_ALIGN_DOUBLE)
return computed;
+ /* APPLE LOCAL begin mac68k alignment */
+ if (TARGET_ALIGN_MAC68K)
+ {
+ if (computed >= 128)
+ return computed;
+ return MIN (computed, 16);
+ }
+ /* APPLE LOCAL end mac68k alignment */
mode = TYPE_MODE (TREE_CODE (type) == ARRAY_TYPE
? get_inner_array_type (type) : type);
if (mode == DFmode || mode == DCmode
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 5c2046a49d7..f886e8fcc6d 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -792,7 +792,15 @@ extern int x86_prefetch_sse;
#define PARM_BOUNDARY BITS_PER_WORD
/* Boundary (in *bits*) on which stack pointer should be aligned. */
-#define STACK_BOUNDARY BITS_PER_WORD
+/* APPLE LOCAL begin compiler should obey -mpreferred-stack-boundary (radar 3232990) */
+/* prefer * #define STACK_BOUNDARY ((ix86_preferred_stack_boundary > 128) ? 128 : ix86_preferred_stack_boundary) */
+/* We're going to extremes to yield a result of indeterminite
+ signedness here; this macro will be expanded in signed and
+ unsigned contexts, and mixed signedness induces fatal
+ warnings. Radar 3941684. */
+#define STACK_BOUNDARY ((ix86_preferred_stack_boundary >= 128) ? 128 : \
+ (ix86_preferred_stack_boundary == 64) ? 64 : 32)
+/* APPLE LOCAL end compiler should obey -mpreferred-stack-boundary (radar 3232990) */
/* Boundary (in *bits*) on which the stack pointer prefers to be
aligned; the compiler cannot rely on having this alignment. */
@@ -843,7 +851,8 @@ extern int x86_prefetch_sse;
#define BIGGEST_FIELD_ALIGNMENT 32
#endif
#else
-#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
+/* APPLE LOCAL Macintosh alignment */
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED, FIRST_FIELD_P) \
x86_field_alignment (FIELD, COMPUTED)
#endif
diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h
index 0447d9e1fc4..13902ab3b59 100644
--- a/gcc/config/rs6000/altivec.h
+++ b/gcc/config/rs6000/altivec.h
@@ -36,17 +36,18 @@
#error Use the "-maltivec" flag to enable PowerPC AltiVec support
#endif
-/* If __APPLE_ALTIVEC__ is defined, the compiler supports 'vector',
- 'pixel' and 'bool' as context-sensitive AltiVec keywords (in
- non-AltiVec contexts, they revert to their original meanings,
- if any), so we do not need to define them as macros. */
+/* APPLE LOCAL begin AltiVec */
+/* If __APPLE_ALTIVEC__ is defined, the compiler has internally
+ synthesized the definitions contained in this header. */
-#if !defined(__APPLE_ALTIVEC__)
+#if defined(__APPLE_ALTIVEC__)
+#warning Ignoring <altivec.h> because "-faltivec" specified
+#else
/* You are allowed to undef these for C++ compatibility. */
#define vector __vector
#define pixel __pixel
#define bool __bool
-#endif
+/* APPLE LOCAL end AltiVec */
/* Condition register codes for AltiVec predicates. */
@@ -11569,5 +11570,7 @@ __ch (__bin_args_eq (__vector float, (a1), __vector float, (a2)), \
#endif /* __cplusplus */
+/* APPLE LOCAL AltiVec */
+#endif /* __APPLE_ALTIVEC__ */
#endif /* _ALTIVEC_H */
diff --git a/gcc/config/rs6000/builtin.ops b/gcc/config/rs6000/builtin.ops
new file mode 100644
index 00000000000..a28e35654fc
--- /dev/null
+++ b/gcc/config/rs6000/builtin.ops
@@ -0,0 +1,297 @@
+# APPLE LOCAL file AltiVec
+# ops-to-gp -gcc vec.ops builtin.ops
+# @ betype betype-code type-spelling
+@ @ float BETYPE_R4 float
+@ @ ushort BETYPE_U4 unsigned=short
+@ @ uint BETYPE_U4 unsigned=int
+@ @ ulong BETYPE_U4 unsigned=long
+@ @ immed_u2 U2 0..3
+@ @ immed_u4 U4 0..15
+@ @ immed_s5 I5 -16..15
+@ @ immed_u5 U5 0..31
+@ @ int BETYPE_I4 int
+@ @ long BETYPE_I4 long
+@ @ ptr PTR void=*
+@ @ v16 BETYPE_V16 vec_type
+@ @ void BETYPE_I4 void
+# fetype betype [code [spelling]]
+@ float_ptr ptr i float=*
+@ const_float_ptr ptr i float=*
+@ const_volatile_float_ptr ptr i float=*
+@ int int i
+@ int_ptr ptr i int=*
+@ long_ptr ptr i long=*
+@ const_int_ptr ptr i int=*
+@ const_long_ptr ptr i long=*
+@ const_volatile_int_ptr ptr i int=*
+@ const_volatile_long_ptr ptr i long=*
+@ immed_s5 immed_s5 A
+@ immed_u5 immed_u5 B
+@ immed_u4 immed_u4 C
+@ immed_u2 immed_u2 D
+@ cc24f int j=24=f
+@ cc24fd int j=24=f=d
+@ cc24fr int j=24=f=r
+@ cc24t int j=24=t
+@ cc24td int j=24=t=d
+@ cc24tr int j=24=t=r
+@ cc26f int j=26=f
+@ cc26fd int j=26=f=d
+@ cc26fr int j=26=f=r
+@ cc26t int j=26=t
+@ cc26td int j=26=t=d
+@ cc26tr int j=26=t=r
+@ short_ptr ptr i short=*
+@ signed_char_ptr ptr i signed=char=*
+@ unsigned_char_ptr ptr i unsigned=char=*
+@ unsigned_short_ptr ptr i unsigned=short=*
+@ unsigned_int_ptr ptr i unsigned=int=*
+@ unsigned_long_ptr ptr i unsigned=long=*
+@ const_short_ptr ptr i short=*
+@ const_signed_char_ptr ptr i signed=char=*
+@ const_unsigned_char_ptr ptr i unsigned=char=*
+@ const_unsigned_short_ptr ptr i unsigned=short=*
+@ const_unsigned_int_ptr ptr i unsigned=int=*
+@ const_unsigned_long_ptr ptr i unsigned=long=*
+@ const_volatile_short_ptr ptr i short=*
+@ const_volatile_signed_char_ptr ptr i signed=char=*
+@ const_volatile_unsigned_char_ptr ptr i unsigned=char=*
+@ const_volatile_unsigned_short_ptr ptr i unsigned=short=*
+@ const_volatile_unsigned_int_ptr ptr i unsigned=int=*
+@ const_volatile_unsigned_long_ptr ptr i unsigned=long=*
+@ vec_b16 v16 x vec_b16
+@ vec_b16_load_op v16 xl vec_b16
+@ vec_b16_ptr ptr i vec_b16=*
+@ const_vec_b16_ptr ptr i vec_b16=*
+@ vec_b32 v16 x vec_b32
+@ vec_b32_load_op v16 xl vec_b32
+@ vec_b32_ptr ptr i vec_b32=*
+@ const_vec_b32_ptr ptr i vec_b32=*
+@ vec_b8 v16 x vec_b8
+@ vec_b8_load_op v16 xl vec_b8
+@ vec_b8_ptr ptr i vec_b8=*
+@ const_vec_b8_ptr ptr i vec_b8=*
+@ vec_f32 v16 x vec_f32
+@ vec_f32_load_op v16 xl vec_f32
+@ vec_f32_ptr ptr i vec_f32=*
+@ const_vec_f32_ptr ptr i vec_f32=*
+@ vec_p16 v16 x vec_p16
+@ vec_p16_load_op v16 xl vec_p16
+@ vec_p16_ptr ptr i vec_p16=*
+@ const_vec_p16_ptr ptr i vec_p16=*
+@ vec_s16 v16 x vec_s16
+@ vec_s16_load_op v16 xl vec_s16
+@ vec_s16_ptr ptr i vec_s16=*
+@ const_vec_s16_ptr ptr i vec_s16=*
+@ vec_s32 v16 x vec_s32
+@ vec_s32_load_op v16 xl vec_s32
+@ vec_s32_ptr ptr i vec_s32=*
+@ const_vec_s32_ptr ptr i vec_s32=*
+@ vec_s8 v16 x vec_s8
+@ vec_s8_load_op v16 xl vec_s8
+@ vec_s8_ptr ptr i vec_s8=*
+@ const_vec_s8_ptr ptr i vec_s8=*
+@ vec_u16 v16 x vec_u16
+@ vec_u16_load_op v16 xl vec_u16
+@ vec_u16_ptr ptr i vec_u16=*
+@ const_vec_u16_ptr ptr i vec_u16=*
+@ vec_u32 v16 x vec_u32
+@ vec_u32_load_op v16 xl vec_u32
+@ vec_u32_ptr ptr i vec_u32=*
+@ const_vec_u32_ptr ptr i vec_u32=*
+@ vec_u8 v16 x vec_u8
+@ vec_u8_load_op v16 xl vec_u8
+@ vec_u8_ptr ptr i vec_u8=*
+@ const_vec_u8_ptr ptr i vec_u8=*
+@ void_store_op void s
+@ volatile_void void v
+@ volatile_void_load_op void vl
+@ volatile_void_store_op void vs
+@ volatile_vec_u16 v16 vx vec_u16
+@ char_ptr ptr i char=*
+@ const_char_ptr ptr i char=*
+# @ @ instruction type
+@ @ @ MOP_mfvscr fxu
+@ @ @ MOP_mtvscr fxu
+@ @ @ MOP_dss load
+@ @ @ MOP_dssall load
+@ @ @ MOP_dst load
+@ @ @ MOP_dstst load
+@ @ @ MOP_dststt load
+@ @ @ MOP_dstt load
+@ @ @ MOP_lvebx load
+@ @ @ MOP_lvehx load
+@ @ @ MOP_lvewx load
+@ @ @ MOP_lvsl load
+@ @ @ MOP_lvsr load
+@ @ @ MOP_lvx load
+@ @ @ MOP_lvxl load
+@ @ @ MOP_stvebx store
+@ @ @ MOP_stvehx store
+@ @ @ MOP_stvewx store
+@ @ @ MOP_stvx store
+@ @ @ MOP_stvxl store
+@ @ @ MOP_vaddcuw simple
+@ @ @ MOP_vaddfp fp
+@ @ @ MOP_vaddsbs simple
+@ @ @ MOP_vaddshs simple
+@ @ @ MOP_vaddsws simple
+@ @ @ MOP_vaddubm simple
+@ @ @ MOP_vaddubs simple
+@ @ @ MOP_vadduhm simple
+@ @ @ MOP_vadduhs simple
+@ @ @ MOP_vadduwm simple
+@ @ @ MOP_vadduws simple
+@ @ @ MOP_vand simple
+@ @ @ MOP_vandc simple
+@ @ @ MOP_vavgsb simple
+@ @ @ MOP_vavgsh simple
+@ @ @ MOP_vavgsw simple
+@ @ @ MOP_vavgub simple
+@ @ @ MOP_vavguh simple
+@ @ @ MOP_vavguw simple
+@ @ @ MOP_vcfsx fp
+@ @ @ MOP_vcfux fp
+@ @ @ MOP_vcmpbfp simple
+@ @ @ MOP_vcmpbfpD simple
+@ @ @ MOP_vcmpeqfp simple
+@ @ @ MOP_vcmpeqfpD simple
+@ @ @ MOP_vcmpequb simple
+@ @ @ MOP_vcmpequbD simple
+@ @ @ MOP_vcmpequh simple
+@ @ @ MOP_vcmpequhD simple
+@ @ @ MOP_vcmpequw simple
+@ @ @ MOP_vcmpequwD simple
+@ @ @ MOP_vcmpgefp simple
+@ @ @ MOP_vcmpgefpD simple
+@ @ @ MOP_vcmpgtfp simple
+@ @ @ MOP_vcmpgtfpD simple
+@ @ @ MOP_vcmpgtsb simple
+@ @ @ MOP_vcmpgtsbD simple
+@ @ @ MOP_vcmpgtsh simple
+@ @ @ MOP_vcmpgtshD simple
+@ @ @ MOP_vcmpgtsw simple
+@ @ @ MOP_vcmpgtswD simple
+@ @ @ MOP_vcmpgtub simple
+@ @ @ MOP_vcmpgtubD simple
+@ @ @ MOP_vcmpgtuh simple
+@ @ @ MOP_vcmpgtuhD simple
+@ @ @ MOP_vcmpgtuw simple
+@ @ @ MOP_vcmpgtuwD simple
+@ @ @ MOP_vctsxs fp
+@ @ @ MOP_vctuxs fp
+@ @ @ MOP_vexptefp fp
+@ @ @ MOP_vlogefp fp
+@ @ @ MOP_vmaddfp fp
+@ @ @ MOP_vmaxfp simple
+@ @ @ MOP_vmaxsb simple
+@ @ @ MOP_vmaxsh simple
+@ @ @ MOP_vmaxsw simple
+@ @ @ MOP_vmaxub simple
+@ @ @ MOP_vmaxuh simple
+@ @ @ MOP_vmaxuw simple
+@ @ @ MOP_vmhaddshs complex
+@ @ @ MOP_vmhraddshs complex
+@ @ @ MOP_vminfp simple
+@ @ @ MOP_vminsb simple
+@ @ @ MOP_vminsh simple
+@ @ @ MOP_vminsw simple
+@ @ @ MOP_vminub simple
+@ @ @ MOP_vminuh simple
+@ @ @ MOP_vminuw simple
+@ @ @ MOP_vmladduhm complex
+@ @ @ MOP_vmrghb perm
+@ @ @ MOP_vmrghh perm
+@ @ @ MOP_vmrghw perm
+@ @ @ MOP_vmrglb perm
+@ @ @ MOP_vmrglh perm
+@ @ @ MOP_vmrglw perm
+@ @ @ MOP_vmsummbm complex
+@ @ @ MOP_vmsumshm complex
+@ @ @ MOP_vmsumshs complex
+@ @ @ MOP_vmsumubm complex
+@ @ @ MOP_vmsumuhm complex
+@ @ @ MOP_vmsumuhs complex
+@ @ @ MOP_vmulesb complex
+@ @ @ MOP_vmulesh complex
+@ @ @ MOP_vmuleub complex
+@ @ @ MOP_vmuleuh complex
+@ @ @ MOP_vmulosb complex
+@ @ @ MOP_vmulosh complex
+@ @ @ MOP_vmuloub complex
+@ @ @ MOP_vmulouh complex
+@ @ @ MOP_vnmsubfp fp
+@ @ @ MOP_vnor simple
+@ @ @ MOP_vor simple
+@ @ @ MOP_vperm perm
+@ @ @ MOP_vpkpx perm
+@ @ @ MOP_vpkshss perm
+@ @ @ MOP_vpkshus perm
+@ @ @ MOP_vpkswss perm
+@ @ @ MOP_vpkswus perm
+@ @ @ MOP_vpkuhum perm
+@ @ @ MOP_vpkuhus perm
+@ @ @ MOP_vpkuwum perm
+@ @ @ MOP_vpkuwus perm
+@ @ @ MOP_vrefp fp
+@ @ @ MOP_vrfim fp
+@ @ @ MOP_vrfin fp
+@ @ @ MOP_vrfip fp
+@ @ @ MOP_vrfiz fp
+@ @ @ MOP_vrlb simple
+@ @ @ MOP_vrlh simple
+@ @ @ MOP_vrlw simple
+@ @ @ MOP_vrsqrtefp fp
+@ @ @ MOP_vsel simple
+@ @ @ MOP_vsl simple
+@ @ @ MOP_vslb simple
+@ @ @ MOP_vsldoi perm
+@ @ @ MOP_vslh simple
+@ @ @ MOP_vslo perm_bug
+@ @ @ MOP_vslw simple
+@ @ @ MOP_vspltb perm
+@ @ @ MOP_vsplth perm
+@ @ @ MOP_vspltisb perm
+@ @ @ MOP_vspltish perm
+@ @ @ MOP_vspltisw perm
+@ @ @ MOP_vspltw perm
+@ @ @ MOP_vsr simple
+@ @ @ MOP_vsrab simple
+@ @ @ MOP_vsrah simple
+@ @ @ MOP_vsraw simple
+@ @ @ MOP_vsrb simple
+@ @ @ MOP_vsrh simple
+@ @ @ MOP_vsro perm_bug
+@ @ @ MOP_vsrw simple
+@ @ @ MOP_vsubcuw simple
+@ @ @ MOP_vsubfp fp
+@ @ @ MOP_vsubsbs simple
+@ @ @ MOP_vsubshs simple
+@ @ @ MOP_vsubsws simple
+@ @ @ MOP_vsububm simple
+@ @ @ MOP_vsububs simple
+@ @ @ MOP_vsubuhm simple
+@ @ @ MOP_vsubuhs simple
+@ @ @ MOP_vsubuwm simple
+@ @ @ MOP_vsubuws simple
+@ @ @ MOP_vsum2sws complex
+@ @ @ MOP_vsum4sbs complex
+@ @ @ MOP_vsum4shs complex
+@ @ @ MOP_vsum4ubs complex
+@ @ @ MOP_vsumsws complex
+@ @ @ MOP_vupkhpx perm
+@ @ @ MOP_vupkhsb perm
+@ @ @ MOP_vupkhsh perm
+@ @ @ MOP_vupklpx perm
+@ @ @ MOP_vupklsb perm
+@ @ @ MOP_vupklsh perm
+@ @ @ MOP_vxor simple
+# The vec_abs and vec_abss operations identify their variants with insn_name.
+# Map these into a valid insn code (xfx_perm).
+@ @ @ 1 perm
+@ @ @ 2 perm
+@ @ @ 3 perm
+@ @ @ 4 perm
+@ @ @ 5 perm
+@ @ @ 6 perm
+@ @ @ 7 perm
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 51a52ef026e..b568a1e38b5 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -56,8 +56,9 @@
if (TARGET_64BIT) builtin_define ("__ppc64__"); \
builtin_define ("__POWERPC__"); \
builtin_define ("__NATURAL_ALIGNMENT__"); \
- builtin_define ("__MACH__"); \
- builtin_define ("__APPLE__"); \
+ /* APPLE LOCAL remove __MACH__ and __APPLE__ definitions -- put elsewhere */\
+ /* APPLE LOCAL constant cfstrings */ \
+ SUBTARGET_OS_CPP_BUILTINS (); \
} \
while (0)
@@ -106,6 +107,10 @@ do { \
error ("invalid option %qs", base); \
darwin_fix_and_continue = (base[0] != 'n'); \
} \
+ /* APPLE LOCAL begin longcall */ \
+ if (TARGET_64BIT) \
+ rs6000_longcall_switch = (char *)0; \
+ /* APPLE LOCAL end longcall */ \
} \
if (TARGET_64BIT && ! TARGET_POWERPC64) \
{ \
@@ -126,9 +131,12 @@ do { \
the kernel or some such. */
#define CC1_SPEC "\
+"/* APPLE LOCAL ignore -msse and -msse2 and other x86 options */"\
+%<msse %<msse2 %<march=pentium4 %<mcpu=pentium4 \
%{g: %{!fno-eliminate-unused-debug-symbols: -feliminate-unused-debug-symbols }} \
%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
-%{!static:%{!mdynamic-no-pic:-fPIC}}"
+"/* APPLE LOCAL -fast and PIC code. */"\
+%{!static:%{!fast:%{!fastf:%{!fastcp:%{!mdynamic-no-pic:-fPIC}}}}}"
#define DARWIN_SUBARCH_SPEC " \
%{m64: ppc64} \
@@ -165,7 +173,8 @@ do { \
#define SUBTARGET_OPTION_TRANSLATE_TABLE \
{ "-ffix-and-continue", "-mfix-and-continue" }, \
{ "-findirect-data", "-mfix-and-continue" }, \
- { "-faltivec", "-maltivec -include altivec.h" }, \
+ /* APPLE LOCAL AltiVec */ \
+ { "-faltivec", "-faltivec -mpim-altivec" }, \
{ "-fno-altivec", "-mno-altivec" }, \
{ "-Waltivec-long-deprecated", "-mwarn-altivec-long" }, \
{ "-Wno-altivec-long-deprecated", "-mno-warn-altivec-long" }
@@ -182,6 +191,24 @@ do { \
#undef RS6000_PIC_OFFSET_TABLE_REGNUM
#define RS6000_PIC_OFFSET_TABLE_REGNUM 31
+/* APPLE LOCAL begin -pg fix */
+/* -pg has a problem which is normally concealed by -fPIC;
+ either -mdynamic-no-pic or -static exposes the -pg problem, causing the
+ crash. FSF gcc for Darwin also has this bug. The problem is that -pg
+ causes several int registers to be saved and restored although they may
+ not actually be used (config/rs6000/rs6000.c:first_reg_to_save()). In the
+ rare case where none of them is actually used, a consistency check fails
+ (correctly). This cannot happen with -fPIC because the PIC register (R31)
+ is always "used" in the sense checked by the consistency check. The
+ easy fix, here, is therefore to mark R31 always "used" whenever -pg is on.
+ A better, but harder, fix would be to improve -pg's register-use
+ logic along the lines suggested by comments in the function listed above. */
+#undef PIC_OFFSET_TABLE_REGNUM
+#define PIC_OFFSET_TABLE_REGNUM ((flag_pic || profile_flag) \
+ ? RS6000_PIC_OFFSET_TABLE_REGNUM \
+ : INVALID_REGNUM)
+/* APPLE LOCAL end -pg fix */
+
/* Pad the outgoing args area to 16 bytes instead of the usual 8. */
#undef STARTING_FRAME_OFFSET
@@ -200,11 +227,35 @@ do { \
#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME \
"__TEXT,__unlikely,regular,pure_instructions"
+/* APPLE LOCAL begin long call hot cold */
+/* The following is used by hot/cold partitioning to determine whether to
+ unconditional branches are "long enough" to span the distance between
+ hot and cold sections (otherwise we have to use indirect jumps). It
+ is set based on the -mlongcall flag.
+ If -mlongcall is set, we use the indirect jumps (the macro below gets '0');
+ otherwise we use unconditional branches (the macro below gets '1'). */
+#define HAS_LONG_UNCOND_BRANCH (TARGET_LONG_BRANCH ? 0 : 1)
+/* APPLE LOCAL end long call hot cold */
+
+/* APPLE LOCAL begin long-branch */
/* Define cutoff for using external functions to save floating point.
- Currently on Darwin, always use inline stores. */
+ For Darwin, use the function for more than a few registers. */
+
+/* APPLE LOCAL begin inline FP save/restore (radar 3414605) */
+#undef FP_SAVE_INLINE
+#define FP_SAVE_INLINE(FIRST_REG) \
+(optimize >= 3 \
+|| ((FIRST_REG) > 60 && (FIRST_REG) < 64) \
+|| TARGET_LONG_BRANCH)
+/* APPLE LOCAL end inline FP save/restore (radar 3414605) */
+
+/* Define cutoff for using external functions to save vector registers. */
-#undef FP_SAVE_INLINE
-#define FP_SAVE_INLINE(FIRST_REG) ((FIRST_REG) < 64)
+#undef VECTOR_SAVE_INLINE
+#define VECTOR_SAVE_INLINE(FIRST_REG) \
+ (((FIRST_REG) >= LAST_ALTIVEC_REGNO - 1 && (FIRST_REG) <= LAST_ALTIVEC_REGNO) \
+ || TARGET_LONG_BRANCH)
+/* APPLE LOCAL end long-branch */
/* Darwin uses a function call if everything needs to be saved/restored. */
#undef WORLD_SAVE_P
@@ -271,11 +322,8 @@ do { \
#undef ASM_COMMENT_START
#define ASM_COMMENT_START ";"
-/* FP save and restore routines. */
-#define SAVE_FP_PREFIX "._savef"
-#define SAVE_FP_SUFFIX ""
-#define RESTORE_FP_PREFIX "._restf"
-#define RESTORE_FP_SUFFIX ""
+/* APPLE LOCAL reduce code size */
+/* Don't define SAVE_FP_PREFIX and friends */
/* This is how to output an assembler line that says to advance
the location counter to a multiple of 2**LOG bytes using the
@@ -353,30 +401,45 @@ do { \
? GENERAL_REGS \
: (CLASS))
-/* Fix for emit_group_load (): force large constants to be pushed via regs. */
-#define ALWAYS_PUSH_CONSTS_USING_REGS_P 1
-
-/* This now supports a natural alignment mode */
-/* Darwin word-aligns FP doubles but doubleword-aligns 64-bit ints. */
-#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED) \
- (TARGET_ALIGN_NATURAL ? (COMPUTED) : \
- (TYPE_MODE (TREE_CODE (TREE_TYPE (FIELD)) == ARRAY_TYPE \
- ? get_inner_array_type (FIELD) \
- : TREE_TYPE (FIELD)) == DFmode \
- ? MIN ((COMPUTED), 32) : (COMPUTED)))
-
-/* Darwin increases natural record alignment to doubleword if the first
- field is an FP double while the FP fields remain word aligned. */
-#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
- ((TREE_CODE (STRUCT) == RECORD_TYPE \
- || TREE_CODE (STRUCT) == UNION_TYPE \
- || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
- && TARGET_ALIGN_NATURAL == 0 \
- ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
- : (TREE_CODE (STRUCT) == VECTOR_TYPE \
- && ALTIVEC_VECTOR_MODE (TYPE_MODE (STRUCT))) \
- ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
- : MAX ((COMPUTED), (SPECIFIED)))
+/* APPLE LOCAL begin Macintosh alignment 2002-2-26 --ff */
+/* This now supports the Macintosh power, mac68k, and natural
+ alignment modes. It now has one more parameter than the standard
+ version of the ADJUST_FIELD_ALIGN macro.
+
+ The macro works as follows: We use the computed alignment of the
+ field if we are in the natural alignment mode or if the field is
+ a vector. Otherwise, if we are in the mac68k alignment mode, we
+ use the minimum of the computed alignment and 16 (pegging at
+ 2-byte alignment). If we are in the power mode, we peg at 32
+ (word alignment) unless it is the first field of the struct, in
+ which case we use the computed alignment. */
+#undef ADJUST_FIELD_ALIGN
+#define ADJUST_FIELD_ALIGN(FIELD, COMPUTED, FIRST_FIELD_P) \
+ (TARGET_ALIGN_NATURAL ? (COMPUTED) : \
+ (((COMPUTED) == RS6000_VECTOR_ALIGNMENT) \
+ ? RS6000_VECTOR_ALIGNMENT \
+ : (MIN ((COMPUTED), \
+ (TARGET_ALIGN_MAC68K ? 16 \
+ : ((FIRST_FIELD_P) ? (COMPUTED) \
+ : 32))))))
+
+#undef ROUND_TYPE_ALIGN
+/* Macintosh alignment modes require more complicated handling
+ of alignment, so we replace the macro with a call to a
+ out-of-line function. */
+union tree_node;
+extern unsigned round_type_align (union tree_node*, unsigned, unsigned); /* rs6000.c */
+#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
+ round_type_align(STRUCT, COMPUTED, SPECIFIED)
+/* APPLE LOCAL end Macintosh alignment 2002-2-26 --ff */
+
+/* APPLE LOCAL begin alignment */
+/* Make sure local alignments come from the type node, not the mode;
+ mode-based alignments are wrong for vectors. */
+#undef LOCAL_ALIGNMENT
+#define LOCAL_ALIGNMENT(TYPE, ALIGN) (MAX ((unsigned) ALIGN, \
+ TYPE_ALIGN (TYPE)))
+/* APPLE LOCAL end alignment */
/* Specify padding for the last element of a block move between
registers and memory. FIRST is nonzero if this is the only
@@ -388,6 +451,17 @@ do { \
support 64 bit PowerPC either, so this just keeps things happy. */
#define DOUBLE_INT_ASM_OP "\t.quad\t"
+/* APPLE LOCAL begin branch cost */
+#undef BRANCH_COST
+/* Better code is generated by saying conditional branches take 1 tick. */
+#define BRANCH_COST 1
+/* APPLE LOCAL end branch cost */
+
+/* APPLE LOCAL begin indirect calls in R12 */
+/* Address of indirect call must be computed here */
+#define MAGIC_INDIRECT_CALL_REG 12
+/* APPLE LOCAL end indirect calls in R12 */
+
/* For binary compatibility with 2.95; Darwin C APIs use bool from
stdbool.h, which was an int-sized enum in 2.95. Users can explicitly
choose to have sizeof(bool)==1 with the -mone-byte-bool switch. */
diff --git a/gcc/config/rs6000/darwin.md b/gcc/config/rs6000/darwin.md
index a0499c5c7aa..0e69db2df83 100644
--- a/gcc/config/rs6000/darwin.md
+++ b/gcc/config/rs6000/darwin.md
@@ -449,3 +449,61 @@ Boston, MA 02111-1307, USA. */
[(set_attr "type" "branch")
(set_attr "length" "4")])
+/* APPLE LOCAL begin 64-bit */
+(define_insn "*save_fpregs_with_label_di"
+ [(match_parallel 0 "any_parallel_operand"
+ [(clobber (match_operand:DI 1 "register_operand" "=l"))
+ (use (match_operand:DI 2 "call_operand" "s"))
+ (use (match_operand:DI 3 "" ""))
+ (set (match_operand:DF 4 "memory_operand" "=m")
+ (match_operand:DF 5 "gpc_reg_operand" "f"))])]
+ "TARGET_64BIT"
+ "*
+#if TARGET_MACHO
+ const char *picbase = machopic_function_base_name ();
+ operands[3] = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (picbase, -1));
+#endif
+ return \"bl %z2\\n%3:\";
+"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
+(define_insn "*save_vregs_di"
+ [(match_parallel 0 "any_parallel_operand"
+ [(clobber (match_operand:DI 1 "register_operand" "=l"))
+ (use (match_operand:DI 2 "call_operand" "s"))
+ (set (match_operand:V4SI 3 "any_operand" "=m")
+ (match_operand:V4SI 4 "register_operand" "v"))])]
+ "TARGET_64BIT"
+ "bl %z2"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
+(define_insn "*restore_vregs_di"
+ [(match_parallel 0 "any_parallel_operand"
+ [(clobber (match_operand:DI 1 "register_operand" "=l"))
+ (use (match_operand:DI 2 "call_operand" "s"))
+ (clobber (match_operand:DI 3 "gpc_reg_operand" "=r"))
+ (set (match_operand:V4SI 4 "register_operand" "=v")
+ (match_operand:V4SI 5 "any_operand" "m"))])]
+ "TARGET_64BIT"
+ "bl %z2")
+
+(define_insn "*save_vregs_with_label_di"
+ [(match_parallel 0 "any_parallel_operand"
+ [(clobber (match_operand:DI 1 "register_operand" "=l"))
+ (use (match_operand:DI 2 "call_operand" "s"))
+ (use (match_operand:DI 3 "" ""))
+ (set (match_operand:V4SI 4 "any_operand" "=m")
+ (match_operand:V4SI 5 "register_operand" "v"))])]
+ "TARGET_64BIT"
+ "*
+#if TARGET_MACHO
+ const char *picbase = machopic_function_base_name ();
+ operands[3] = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (picbase, -1));
+#endif
+ return \"bl %z2\\n%3:\";
+"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+/* APPLE LOCAL end 64-bit */
diff --git a/gcc/config/rs6000/ops-to-gp b/gcc/config/rs6000/ops-to-gp
new file mode 100755
index 00000000000..becb406749b
--- /dev/null
+++ b/gcc/config/rs6000/ops-to-gp
@@ -0,0 +1,620 @@
+#!/bin/sh
+# APPLE LOCAL file AltiVec
+# ops-to-gp -gcc vec.ops builtin.ops
+# Creates vec.h used by rs6000.c
+
+arg0=`basename $0`
+err() {
+ echo "$arg0: $*" 1>&2
+ exit 2
+}
+
+if [ $# -eq 0 ] ; then
+ echo "Usage: $arg0 [ -mcc | -gcc ] builtin-ops ..." 1>&2
+ exit 1
+fi
+
+MCC=1
+GCC=0
+suffix="gp"
+if [ "$1" = "-mcc" ] ; then
+ shift;
+elif [ "$1" = "-gcc" ] ; then
+ GCC=1
+ MCC=0
+ suffix="h"
+ shift;
+fi
+
+output=`basename $1 .ops`
+gperf="gperf -G -a -o -k1-15 -p -t -D -T -N Is_Builtin_Function $output.gp";
+
+# Lines in the ops file have the form
+# @ @ betype betype-code type-spelling
+# @ fetype betype [code]
+# @ @ @ instruction type
+# generic op1 op2 ... opn = result specific when configure [addressible
+# [instruction [const_ptr_ok [volatile_ptr_ok [transform [predicate]]]]]]
+
+# Sort the ops file to put it in a canonical order.
+sort -u $* | \
+
+# Add specific function uid's, make generic functions from specific
+# functions, validate the types used, compute default parameters, and
+# compute parts of the default transform and predicate functions.
+awk 'BEGIN {
+ i = 0
+ EQ = i++
+ RESULT = i++
+ SPECIFIC = i++
+ WHEN = i++
+ CONFIGURED = i++
+ ADDRESSIBLE = i++
+ INSTRUCTION = i++
+ CONST_PTR_OK = i++
+ VOLATILE_PTR_OK = i++
+ TRANSFORM = i++
+ PREDICATE = i++
+ n_lines = 1;
+ tree[3] = "Make_Folded_4tree";
+ tree[2] = "Make_Folded_3tree";
+ tree[1] = "Make_Folded_Btree";
+ tree[0] = "Make_Utree";
+ optimize["vec_sub"] = 1;
+ optimize["vec_subs"] = 1;
+ optimize["vec_xor"] = 1;
+ optimize["vec_andc"] = 1;
+ optimize["vec_avg"] = 2;
+ optimize["vec_or"] = 2;
+ optimize["vec_and"] = 2;
+ optimize["vec_max"] = 2;
+ optimize["vec_min"] = 2;
+ optimize["vec_sld"] = 3;
+ optimize["vec_splat_s8"] = 4;
+ optimize["vec_splat_s16"] = 5;
+ optimize["vec_splat_s32"] = 6;
+ optimize["vec_splat_u8"] = 4;
+ optimize["vec_splat_u16"] = 5;
+ optimize["vec_splat_u32"] = 6;
+ optimize["vec_cmpeq"] = 7;
+ optimize["vec_lvsl"] = 8;
+ optimize["vec_lvsr"] = 9;
+ # These operations need additional transformation. Key off the
+ # optimize attribute to identify them.
+ optimize["vec_cmplt"] = 10;
+ optimize["vec_cmple"] = 10;
+ optimize["vec_abs"] = 11;
+ optimize["vec_abss"] = 11;
+ }
+ function no_type(t) {
+ printf "%% Error: type %s not declared.\n", t;
+ status = 1;
+ exit;
+ }
+ # Record the type.
+ $1 == "@" {
+ if ($2 == "@") {
+ if ($3 == "@") {
+ # Definition of an instruction.
+ insn_type[$4] = $5; # type
+ } else {
+ # Definition of a betype.
+ becode[$3] = $4; # betype-code
+ bespell[$3] = $5; # type-spelling
+ gsub(/\=/, " ", bespell[$3]);
+ }
+ } else {
+ # Definition of a fetype.
+ print $0;
+ if (!becode[$3]) no_type($3); # Must have defined the betype.
+ betype[$2] = $3; # betype;
+ if (NF == 3)
+ code[$2] = "";
+ else
+ code[$2] = $4; # code
+ }
+ }
+ function no_equal(i,l) {
+ printf "%% Syntax error %d: %s\n", i, l;
+ status = 1;
+ exit;
+ }
+ function error(f,a) {
+ printf( ("%% error: " f), a);
+ status = 1;
+ exit;
+ }
+ # Ignore comment lines.
+ $1 != "#" && $1 != "@" {
+ # Generate the signature of the specific function, the predicate,
+ # the transform, the arguments to the transform function, the
+ # arguments to the predicate function, and the spelling of the
+ # function type.
+ signature = "";
+ predicate = "";
+ transform = "";
+ insn_code = "";
+ transform_args = "";
+ predicate_args = "";
+ function_type = "";
+ # First, consider the parameter types.
+ for (i = 2; $i != "=" && i < NF; i++) {
+ if ($i != "...") {
+ if (!betype[$i]) no_type($i);
+ signature = (signature " " $i);
+ predicate = (predicate "_" betype[$i]);
+ transform = (transform code[$i]);
+ transform_args = (transform_args ", ND_kid(t," i-1 ")");
+ predicate_args = (predicate_args " " becode[betype[$i]]);
+ if (function_type)
+ function_type = (function_type ", " bespell[betype[$i]]);
+ else
+ function_type = bespell[betype[$i]];
+ }
+ }
+ constraints = (transform "@");
+ # Check the syntax of the ops file.
+ if ($i != "=" || NF > i+PREDICATE || NF < i+CONFIGURE) no_equal(i,$0);
+ if (!betype[$(i+RESULT)]) no_type($(i+RESULT));
+ # Incorporate the result type.
+ if (i == 2) {
+ predicate = "_void";
+ function_type = "void";
+ }
+ signature = ($(i+SPECIFIC) signature);
+ predicate = sprintf("is_%s_func%s", betype[$(i+RESULT)], predicate);
+ predicate_args = (becode[betype[$(i+RESULT)]] predicate_args);
+ function_type = sprintf("(%s (*)(%s))", bespell[betype[$(i+RESULT)]], \
+ function_type);
+ if (substr(code[$(i+RESULT)], 1, 1) == "j") {
+ # Handle a jump asm. The code is expedted to be
+ # j={cc-bit-num}={cc-bit-value}[={r|d}]. The operation must have
+ # one operand if the code d is used and two operands otherwise.
+ # The transform function can implement the r code by reversing the
+ # two operands. In all cases, the first operand is a computed
+ # constant encoding both the bit number and the test.
+ n = split(code[$(i+RESULT)], jmp, "=");
+ if (jmp[n] == "d" && i != 3) error("%d operands", i-2);
+ if (jmp[n] != "d" && i != 4) error("%d operands", i-2);
+ if (jmp[n] == "r")
+ transform_args = ", ND_kid(t,2), ND_kid(t,1)";
+ transform_args = sprintf("%s(OP_VCMP%s%s", tree[i-2], \
+ toupper(jmp[3]), transform_args);
+ if (jmp[n] == "r")
+ transform = ("r" transform);
+ insn_code = sprintf("CODE_FOR_j_%d_%s_f%s", jmp[2], jmp[3], \
+ transform);
+ transform = sprintf("transform_j_%d_%s_f%s", jmp[2], jmp[3], \
+ transform);
+ } else {
+ transform_args = sprintf("%s(OP_%sASM%s%s", tree[i-2], \
+ toupper(code[$(i+RESULT)]), \
+ toupper(transform), transform_args);
+ insn_code = sprintf("CODE_FOR_%sf%s", code[$(i+RESULT)], transform);
+ transform = sprintf("transform_%sf%s", code[$(i+RESULT)], transform);
+ }
+ # Give a unique id to the signature
+ if (count[signature] == 0)
+ count[signature] = ++uid[$(i+SPECIFIC)];
+
+ # Compute the default instruction name
+ nf = split($(i+SPECIFIC), part, "_");
+ instruction = ("MOP_" part[nf]);
+
+ # Compute the insn_code, but use the instruction override if given.
+ if (NF >= i+INSTRUCTION)
+ instruction = $(i+INSTRUCTION);
+ if (insn_type[instruction])
+ insn_code = (insn_code "_" insn_type[instruction]);
+
+ # Allow the user to override the addressibility, instruction,
+ # const_ptr_ok, volatile_ptr_ok, transform, and predicate.
+ if (NF >= i+ADDRESSIBLE)
+ addressible = "";
+ else
+ addressible = "FALSE";
+
+ if (NF >= i+INSTRUCTION)
+ instruction = "";
+ else if (substr($1, 1, 4) == "vec_")
+ print "@ @3", instruction;
+
+ if (NF >= i+CONST_PTR_OK)
+ const_ptr_ok = "";
+ else
+ const_ptr_ok = "FALSE";
+
+ if (NF >= i+VOLATILE_PTR_OK)
+ volatile_ptr_ok = "";
+ else
+ volatile_ptr_ok = "FALSE";
+
+ if (NF >= i+TRANSFORM)
+ transform = "";
+ else
+ print "@ @1", transform, transform_args;
+
+ if (NF >= i+PREDICATE)
+ predicate = "";
+ else
+ print "@ @2", i-2, predicate, predicate_args, function_type;
+
+ if (optimize[$1])
+ optimize_method = optimize[$1];
+ else
+ optimize_method = "0";
+
+ # Record the line, addressibility, instruction, transform,
+ # predicate, and unique id.
+ line[n_lines++] = ($0 " " addressible " " instruction " " \
+ const_ptr_ok " " volatile_ptr_ok " " transform " " \
+ predicate " " insn_code " " constraints " " \
+ optimize_method " " count[signature]);
+ }
+ END {
+ if (status) exit;
+ # generic op1 op2 ... opn = result specific when configured
+ # addressable instruction const_ptr_ok volatile_ptr_ok
+ # transform predicate insn_code constraints optimize uid
+ SPECIFIC = 12
+ for (i = 1; i < n_lines; i++) {
+ nf = split(line[i], part);
+ specific = part[nf-SPECIFIC];
+
+ # Print the generic form.
+ printf "%s", part[1];
+ for (j = 2; j <= nf-SPECIFIC; j++) printf " %s", part[j];
+ if (uid[specific] > 1) printf ":%d", part[nf];
+ while (j < nf) printf " %s", part[j++];
+ printf "\n";
+
+ # Print the specific form.
+ printf "%s", specific;
+ for (j = 2; j <= nf-SPECIFIC; j++) printf " %s", part[j];
+ if (uid[specific] > 1) printf ":%d", part[nf];
+ while (j < nf) printf " %s", part[j++];
+ printf "\n";
+ }
+ }' | \
+
+# Strip out load and store qualifiers.
+sed -e 's/_load_op//g' -e 's/_store_op//g' | \
+
+# Sort the processed file and eliminate duplicates.
+sort -u | \
+
+# Append the count of each generic function to each line.
+awk 'function push() {
+ if (num)
+ for (i = 0; i < num; i++)
+ print line[i], num;
+ num = 0;
+ }
+ $1 == "@" {
+ print $0;
+ }
+ $1 != "@" {
+ if (last != $1)
+ push();
+ last = $1;
+ line[num++] = $0;
+ }
+ END {
+ push();
+ }' | \
+
+# Now compute the gperf input file.
+# Lines now have a fixed format
+# generic op1 ... opn = result specific instruction when configured
+# addressible const_ptr_ok volatile_ptr_ok transform predicate
+# insn_code constraints optimize count
+awk 'BEGIN {
+ MCC = '$MCC'
+ GCC = '$GCC'
+ i = 0;
+ COUNT = i++
+ OPTIMIZE = i++
+ CONSTRAINTS = i++
+ INSN_CODE = i++
+ PREDICATE = i++
+ TRANSFORM = i++
+ VOLATILE_PTR_OK = i++
+ CONST_PTR_OK = i++
+ INSTRUCTION = i++
+ ADDRESSIBLE = i++
+ CONFIGURED = i++
+ WHEN = i++
+ SPECIFIC = i++
+ RESULT = i++
+ EQ = i++
+ OPN = i++
+ NARGS = i++
+ if (MCC) {
+ print "%{";
+ print "/* Command-line: '"$gperf"' */";
+ MAXARGS = 5
+ }
+ if (GCC)
+ MAXARGS = 3
+ }
+ function write_test(tree, type, num) {
+ if (type == "PTR") {
+ printf "\n && TY_kind(%s) == KIND_POINTER", tree;
+ } else if (type == "I5") {
+ printf "\n && is_integer_type(%s)", tree;
+ printf "\n && Is_Const(ND_kid0(ND_kid(t,%d)), &tc)", num;
+ printf "\n && ((UINT32)Targ_To_Host(tc) + 16) < 32";
+ } else if (type == "U5") {
+ printf "\n && is_integer_type(%s)", tree;
+ printf "\n && Is_Const(ND_kid0(ND_kid(t,%d)), &tc)", num;
+ printf "\n && (UINT32)Targ_To_Host(tc) < 32";
+ } else if (type == "U4") {
+ printf "\n && is_integer_type(%s)", tree;
+ printf "\n && Is_Const(ND_kid0(ND_kid(t,%d)), &tc)", num;
+ printf "\n && (UINT32)Targ_To_Host(tc) < 16";
+ } else if (type == "U2") {
+ printf "\n && is_integer_type(%s)", tree;
+ printf "\n && Is_Const(ND_kid0(ND_kid(t,%d)), &tc)", num;
+ printf "\n && (UINT32)Targ_To_Host(tc) < 4";
+ } else if (type == "BETYPE_U4" || type == "BETYPE_I4") {
+ printf "\n && is_integer_type(%s)", tree;
+ } else {
+ printf "\n && Similar_Types(%s,", tree;
+ printf "\n\t\t Be_Type_Tbl(%s), IGNORE_QUALIFIERS)", type;
+ }
+ }
+ $1 == "@" {
+ if (MCC) {
+ if ($2 == "@1") {
+ # Write the predicate function from the given parameters.
+ # The format is:
+ # @ @1 transform_ifii Make_3tree(OP_IASMII, ND_kid(t,1), ND_kid(t,2)
+ print "";
+ print "/*ARGSUSED*/";
+ print "static void";
+ print $3 "(ND *func, ND *parent, ND *t, struct builtin *self)";
+ print "{";
+ printf " *t = *%s", $4;
+ for (i = 5; i <= NF; i++) printf " %s", $i;
+ print ",";
+ if (split($3,jmp,"_") == 5 && jmp[2] == "j")
+ printf "\t\t MK_I4CONST_ND((self->data << 5) + %d));\n", \
+ jmp[3];
+ else
+ print "\t\t MK_I4CONST_ND(self->data));";
+
+ print " Is_True(self->data > 0, (\"No implementation for %s\", self->name));";
+ print "}";
+ } else if ($2 == "@2") {
+ # Write the transform function from the given parameters.
+ # The format is:
+ # @ @2 2 is_int_func_int_int BETYPE_I4 BETYPE_I4 BETYPE_I4
+ # (int (*)(int, int))
+ print "";
+ print "/*ARGSUSED*/";
+ print "static BOOL";
+ print $4 "(ND *func, ND *parent, ND *t, struct builtin *self)";
+ print "{";
+ print " TCON tc;";
+ printf " if (ND_nkids(t) == %d", $3+1;
+ write_test("ST_type(ND_dec(func))", $5, "");
+ for (i = 1; i <= $3; i++) {
+ printf "\n && ND_name(ND_kid(t,%d)) == TO_VAL", i;
+ write_test(sprintf("The_Tree_Type(ND_kid(t,%d))", i), $(i+5), i);
+ }
+ print ")";
+ print " return TRUE;";
+ print " Error_Prt_Line (ND_linenum(t), ec_builtin_function_type, self->name,";
+ i = $3+6;
+ printf "\t\t \"%s", $i;
+ while (++i <= NF) printf " %s", $i;
+ print "\");";
+ print " return FALSE;";
+ print "}";
+ } else if ($2 == "@3") {
+ if (once++ == 0) printf "\n#ifndef HAVE_ALTIVEC\n";
+ printf "#define %s -1\n", $3;
+ } else {
+ if (once && twice++ == 0) printf "#endif /* HAVE_ALTIVEC */\n\n";
+ printf "extern struct a_type *T_%s;\n", $2;
+ }
+ }
+ next;
+ }
+ $1 == "%" {
+ print $0;
+ status = 1;
+ exit;
+ }
+ {
+ # Compute the signature of the generic function.
+ signature=$1;
+ for (i = 2; i <= NF-OPN; i++) {
+ if ($i != "...")
+ signature=(signature " " $i);
+ }
+
+ # Ensure that the signature is unique.
+ if (signature_line[signature]) {
+ print "Ambiguous signatures:";
+ print $0;
+ print line[signature_line[signature]];
+ }
+ signature_line[signature] = n_lines;
+
+ # Require that overloaded functions have the same attributes:
+ # number of arguments, when, configured, and addressible.
+ if (same_arg_count[$1] && same_arg_count[$1] != NF)
+ printf "%% number of arguments for %s varies: %d and %d\n", \
+ $1, NF-NARGS, same_arg_count[$1]-NARGS;
+ same_arg_count[$1] = NF;
+
+ if (same_when[$1] && same_when[$1] != $(NF-WHEN))
+ printf "%% when for %s varies: %s and %s\n", \
+ $1, $(NF-WHEN), same_when[$1];
+ same_when[$1] = $(NF-WHEN);
+
+ if (same_configured[$1] && same_configured[$1] != $(NF-CONFIGURED))
+ printf "%% configured for %s varies: %s and %s\n", \
+ $1, $(NF-CONFIGURED), same_configured[$1];
+ same_configured[$1] = $(NF-CONFIGURED);
+
+ if (same_addressible[$1] && same_addressible[$1] != $(NF-ADDRESSIBLE))
+ printf "%% addressible for %s varies: %s and %s\n", \
+ $1, $(NF-ADDRESSIBLE), same_addressible[$1];
+ else if (same_addressible[$1] && same_addressible[$1] != "FALSE")
+ printf "%% Overloaded function %s is addressible\n", $1
+ same_addressible[$1] = $(NF-ADDRESSIBLE);
+
+ # Record the line.
+ line[n_lines++] = $0;
+ }
+ function push(fcn, n) {
+ if (last) printf "};\n";
+ # Gcc3: declare as arrays of const pointers
+ if (fcn) printf "static const struct builtin *const O_%s[%d] = {\n", fcn, n;
+ last = fcn;
+ }
+ function mangle(name) {
+ if (split(name, names, ":") == 1)
+ return ("B_" names[1]);
+ return ("B" names[2] "_" names[1]);
+ }
+ END {
+ if (status) exit;
+
+ # Gcc3: Mark file as Apple local
+ printf "/* APPLE LOCAL file AltiVec */\n";
+ printf "/* This file is generated by ops-to-gp. Do not edit. */\n\n";
+ printf "/* To regenerate execute:\n";
+ printf " ops-to-gp -gcc vec.ops builtin.ops\n";
+ printf " with the current directory being gcc/config/rs6000. */\n\n";
+
+ # Output the description of each specific function.
+ uid = 0;
+ if (MCC) print "";
+ for (i = 0; i < n_lines; i++) {
+ nf = split(line[i], part);
+ fcn = part[nf-SPECIFIC];
+ if (!done[fcn]) {
+ printf "static const struct builtin %s = {", mangle(fcn);
+ if (GCC) printf " {";
+ ellipsis = 1;
+ for (j = 2; j <= nf-OPN; j++)
+ if (part[j] != "...") {
+ printf " &T_%s,", part[j];
+ } else {
+ ellipsis = -1;
+ printf " NULL,";
+ }
+ while (j++ <= MAXARGS+1)
+ printf " NULL,";
+ instruction = part[nf-INSTRUCTION];
+ if (substr(instruction, 1, 4) == "MOP_")
+ instruction = substr(instruction, 5);
+ if (substr(instruction, length(instruction)) == "D")
+ instruction = (substr(instruction, 1, length(instruction) - 1) ".");
+ # Gcc3: Prefix each specific instruction with a "*"
+ if (match (instruction, "^[a-zA-Z]") > 0)
+ instruction = "*" instruction;
+ if (GCC) printf " },";
+ if (GCC) printf " \"%s\",", substr(part[nf-CONSTRAINTS], 1, length(part[nf-CONSTRAINTS]) - 1);
+ printf " &T_%s,", part[nf-RESULT];
+ if (MCC) printf " \"%s\",", part[nf-SPECIFIC];
+ printf " %d,", ellipsis * (nf - NARGS);
+ if (MCC) {
+ printf " %s,", part[nf-WHEN];
+ printf " %s,", part[nf-ADDRESSIBLE];
+ printf " %s,", part[nf-CONST_PTR_OK];
+ printf " %s,", part[nf-VOLATILE_PTR_OK];
+ printf " %s,", part[nf-CONFIGURED];
+ printf " %s,", part[nf-INSTRUCTION];
+ printf " %s,", part[nf-TRANSFORM];
+ printf " %s", part[nf-PREDICATE];
+ } else if (GCC) {
+ printf " %s,", part[nf-CONST_PTR_OK];
+ printf " %s,", part[nf-VOLATILE_PTR_OK];
+ printf " %s,", part[nf-OPTIMIZE];
+ printf " \"%s\",", part[nf-SPECIFIC];
+ printf " \"%s\",", instruction;
+ printf " %s,", part[nf-INSN_CODE];
+ printf " B_UID(%d)", uid++;
+ }
+ printf " };\n";
+ }
+ done[fcn] = 1;
+ }
+
+ if (GCC) printf "#define LAST_B_UID B_UID(%d)\n", uid;
+
+ if (GCC) {
+ # Output the description of each specific function.
+ print "";
+ uid = 0;
+ for (i in done)
+ done[i] = "";
+ print "const struct builtin * const Builtin[] = {"
+ for (i = 0; i < n_lines; i++) {
+ nf = split(line[i], part);
+ fcn = part[nf-SPECIFIC];
+ if (!done[fcn]) {
+ printf " &%s,\n", mangle(fcn);
+ }
+ done[fcn] = 1;
+ }
+ print "};"
+ }
+
+ # Output the overload tables for each generic function.
+ print "";
+ for (i = 0; i < n_lines; i++) {
+ nf = split(line[i], part);
+ fcn = part[1];
+ if (last != fcn)
+ push(fcn, part[nf]);
+ printf " &%s,\n", mangle(part[nf-SPECIFIC]);
+ }
+ push("", 0);
+
+ # Output the builtin function structure.
+ print "";
+ if (MCC) {
+ print "%}";
+ print "struct overloadx {";
+ print " char *name;";
+ print " int fcns;";
+ print " int args;";
+ print " struct builtin **functions;";
+ print "};";
+ print "%%";
+ } else if (GCC) {
+ print "const struct overloadx Overload[] = {";
+ }
+
+ # Output the builtin function list and data.
+ uid = 0;
+ for (i = 0; i < n_lines; i++) {
+ nf = split(line[i], part);
+ fcn = part[1];
+ args = nf - NARGS;
+ if (part[nf-OPN] == "...") args = -args;
+ if (last != fcn) {
+ if (MCC) printf "%s, %d, %d, O_%s\n", fcn, part[nf], args, fcn;
+ if (GCC) printf " { \"%s\", %d, %d, O_%s, O_UID(%d) },\n", \
+ fcn, part[nf], args, fcn, uid++;
+ }
+ last = fcn;
+ }
+
+ if (GCC) {
+ print " { NULL, 0, 0, NULL, 0 }"
+ print "};";
+
+ printf "#define LAST_O_UID O_UID(%d)\n", uid;
+ }
+
+ }' > $output.$suffix
+
+if [ "$MCC" = "1" ] ; then
+ $gperf > $output.h
+fi
diff --git a/gcc/config/rs6000/rs6000-c.c b/gcc/config/rs6000/rs6000-c.c
index 5d36d5d28b3..a231e1756b1 100644
--- a/gcc/config/rs6000/rs6000-c.c
+++ b/gcc/config/rs6000/rs6000-c.c
@@ -30,6 +30,17 @@
#include "c-pragma.h"
#include "errors.h"
#include "tm_p.h"
+/* APPLE LOCAL begin AltiVec */
+#include "c-common.h"
+#include "cpplib.h"
+#include "../libcpp/internal.h"
+#include "target.h"
+#include "options.h"
+
+static cpp_hashnode *altivec_categorize_keyword (const cpp_token *);
+static void init_vector_keywords (cpp_reader *pfile);
+/* APPLE LOCAL end AltiVec */
+
/* Handle the machine specific pragma longcall. Its syntax is
@@ -78,6 +89,138 @@ rs6000_pragma_longcall (cpp_reader *pfile ATTRIBUTE_UNUSED)
#define builtin_define(TXT) cpp_define (pfile, TXT)
#define builtin_assert(TXT) cpp_assert (pfile, TXT)
+/* APPLE LOCAL begin AltiVec */
+/* Keep the AltiVec keywords handy for fast comparisons. */
+static GTY(()) cpp_hashnode *__vector_keyword;
+static GTY(()) cpp_hashnode *vector_keyword;
+static GTY(()) cpp_hashnode *__pixel_keyword;
+static GTY(()) cpp_hashnode *pixel_keyword;
+static GTY(()) cpp_hashnode *__bool_keyword;
+static GTY(()) cpp_hashnode *bool_keyword;
+static GTY(()) cpp_hashnode *_Bool_keyword;
+
+static GTY(()) cpp_hashnode *expand_bool_pixel; /* Preserved across calls. */
+
+static cpp_hashnode *
+altivec_categorize_keyword (const cpp_token *tok)
+{
+ if (tok->type == CPP_NAME)
+ {
+ cpp_hashnode *ident = tok->val.node;
+
+ if (ident == vector_keyword || ident == __vector_keyword)
+ return __vector_keyword;
+
+ if (ident == pixel_keyword || ident == __pixel_keyword)
+ return __pixel_keyword;
+
+ if (ident == bool_keyword || ident == _Bool_keyword
+ || ident == __bool_keyword)
+ return __bool_keyword;
+
+ return ident;
+ }
+
+ return 0;
+}
+
+/* Called to decide whether a conditional macro should be expanded.
+ Since we have exactly one such macro (i.e, 'vector'), we do not
+ need to examine the 'tok' parameter. */
+
+cpp_hashnode *
+rs6000_macro_to_expand (cpp_reader *pfile, const cpp_token *tok)
+{
+ static bool vector_keywords_init = false;
+ cpp_hashnode *expand_this = tok->val.node;
+ cpp_hashnode *ident;
+
+ if (!vector_keywords_init)
+ {
+ init_vector_keywords (pfile);
+ vector_keywords_init = true;
+ }
+
+ ident = altivec_categorize_keyword (tok);
+
+ if (ident == __vector_keyword)
+ {
+ tok = _cpp_peek_token (pfile, 0);
+ ident = altivec_categorize_keyword (tok);
+
+ if (ident == __pixel_keyword || ident == __bool_keyword)
+ {
+ expand_this = __vector_keyword;
+ expand_bool_pixel = ident;
+ }
+ else if (ident)
+ {
+ enum rid rid_code = (enum rid)(ident->rid_code);
+ if (ident->type == NT_MACRO)
+ {
+ (void)cpp_get_token (pfile);
+ tok = _cpp_peek_token (pfile, 0);
+ ident = altivec_categorize_keyword (tok);
+ rid_code = (enum rid)(ident->rid_code);
+ }
+
+ if (rid_code == RID_UNSIGNED || rid_code == RID_LONG
+ || rid_code == RID_SHORT || rid_code == RID_SIGNED
+ || rid_code == RID_INT || rid_code == RID_CHAR
+ || rid_code == RID_FLOAT)
+ {
+ expand_this = __vector_keyword;
+ /* If the next keyword is bool or pixel, it
+ will need to be expanded as well. */
+ tok = _cpp_peek_token (pfile, 1);
+ ident = altivec_categorize_keyword (tok);
+
+ if (ident == __pixel_keyword || ident == __bool_keyword)
+ expand_bool_pixel = ident;
+ }
+ }
+ }
+ else if (expand_bool_pixel
+ && (ident == __pixel_keyword || ident == __bool_keyword))
+ {
+ expand_this = expand_bool_pixel;
+ expand_bool_pixel = 0;
+ }
+
+ return expand_this;
+}
+
+static void
+init_vector_keywords (cpp_reader *pfile)
+{
+ /* Keywords without two leading underscores are context-sensitive, and hence
+ implemented as conditional macros, controlled by the rs6000_macro_to_expand()
+ function above. */
+ __vector_keyword = cpp_lookup (pfile, DSC ("__vector"));
+ __vector_keyword->flags |= NODE_CONDITIONAL;
+
+ __pixel_keyword = cpp_lookup (pfile, DSC ("__pixel"));
+ __pixel_keyword->flags |= NODE_CONDITIONAL;
+
+ __bool_keyword = cpp_lookup (pfile, DSC ("__bool"));
+ __bool_keyword->flags |= NODE_CONDITIONAL;
+
+ vector_keyword = cpp_lookup (pfile, DSC ("vector"));
+ vector_keyword->flags |= NODE_CONDITIONAL;
+
+ pixel_keyword = cpp_lookup (pfile, DSC ("pixel"));
+ pixel_keyword->flags |= NODE_CONDITIONAL;
+
+ _Bool_keyword = cpp_lookup (pfile, DSC ("_Bool"));
+ _Bool_keyword->flags |= NODE_CONDITIONAL;
+
+ bool_keyword = cpp_lookup (pfile, DSC ("bool"));
+ bool_keyword->flags |= NODE_CONDITIONAL;
+ return;
+}
+
+/* APPLE LOCAL end AltiVec */
+
void
rs6000_cpu_cpp_builtins (cpp_reader *pfile)
{
@@ -100,6 +243,25 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
builtin_define ("__vector=__attribute__((altivec(vector__)))");
builtin_define ("__pixel=__attribute__((altivec(pixel__))) unsigned short");
builtin_define ("__bool=__attribute__((altivec(bool__))) unsigned");
+
+ /* APPLE LOCAL begin AltiVec */
+ builtin_define ("vector=vector");
+ builtin_define ("pixel=pixel");
+ builtin_define ("_Bool=_Bool");
+ builtin_define ("bool=bool");
+ init_vector_keywords (pfile);
+
+ /* Indicate that the compiler supports Apple AltiVec syntax,
+ including context-sensitive keywords. */
+ if (rs6000_altivec_pim)
+ {
+ builtin_define ("__APPLE_ALTIVEC__");
+ builtin_define ("vec_step(T)=(sizeof (__typeof__(T)) / sizeof (__typeof__(T) __attribute__((altivec(element__)))))");
+ }
+
+ /* Enable context-sensitive macros. */
+ cpp_get_callbacks (pfile)->macro_to_expand = rs6000_macro_to_expand;
+ /* APPLE LOCAL end AltiVec */
}
if (TARGET_SPE)
builtin_define ("__SPE__");
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 4a4fcde8e2d..33940ad34d8 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -135,6 +135,8 @@ extern int mfcr_operation (rtx, enum machine_mode);
extern int mtcrf_operation (rtx, enum machine_mode);
extern int lmw_operation (rtx, enum machine_mode);
extern struct rtx_def *create_TOC_reference (rtx);
+/* APPLE LOCAL RTX_COST for multiply */
+extern int rs6000_rtx_mult_cost (rtx);
extern void rs6000_split_multireg_move (rtx, rtx);
extern void rs6000_emit_move (rtx, rtx, enum machine_mode);
extern rtx rs6000_legitimize_address (rtx, rtx, enum machine_mode);
@@ -206,12 +208,21 @@ extern int rs6000_tls_symbol_ref (rtx, enum machine_mode);
extern void rs6000_output_dwarf_dtprel (FILE*, int, rtx);
extern int rs6000_hard_regno_nregs (int, enum machine_mode);
extern void rs6000_conditional_register_usage (void);
+/* APPLE LOCAL AltiVec */
+extern tree rs6000_fold_builtin (tree, bool);
+/* APPLE LOCAL CW asm blocks */
+extern const char *rs6000_cw_asm_register_name (const char *, char *);
/* Declare functions in rs6000-c.c */
extern void rs6000_pragma_longcall (struct cpp_reader *);
extern void rs6000_cpu_cpp_builtins (struct cpp_reader *);
+/* APPLE LOCAL begin AltiVec */
+extern struct cpp_hashnode *rs6000_macro_to_expand (struct cpp_reader *,
+ const struct cpp_token *);
+/* APPLE LOCAL end AltiVec */
+
#if TARGET_MACHO
char *output_call (rtx, rtx *, int, int);
#endif
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 267a16131d1..9e79c0fe911 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -50,6 +50,8 @@
#include "target-def.h"
#include "langhooks.h"
#include "reload.h"
+/* APPLE LOCAL why is this needed? */
+#include "insn-addr.h"
#include "cfglayout.h"
#include "sched-int.h"
#include "tree-gimple.h"
@@ -60,6 +62,17 @@
#include "gstab.h" /* for N_SLINE */
#endif
+/* APPLE LOCAL begin pascal strings */
+#include "../../libcpp/internal.h"
+extern struct cpp_reader* parse_in;
+/* APPLE LOCAL end pascal strings */
+
+/* APPLE LOCAL begin Macintosh alignment */
+#ifndef TARGET_ALIGN_MAC68K
+#define TARGET_ALIGN_MAC68K 0
+#endif
+/* APPLE LOCAL end Macintosh alignment */
+
#ifndef TARGET_NO_PROTOTYPE
#define TARGET_NO_PROTOTYPE 0
#endif
@@ -257,6 +270,10 @@ static GTY(()) tree pixel_V8HI_type_node; /* __vector __pixel */
int rs6000_warn_altivec_long = 1; /* On by default. */
const char *rs6000_warn_altivec_long_switch;
+/* APPLE LOCAL begin AltiVec */
+int rs6000_altivec_pim = 0;
+const char *rs6000_altivec_pim_switch;
+/* APPLE LOCAL end AltiVec */
const char *rs6000_traceback_name;
static enum {
@@ -586,6 +603,12 @@ struct processor_costs ppc8540_cost = {
COSTS_N_INSNS (29), /* ddiv */
};
+/* APPLE LOCAL begin AltiVec */
+/* NB: We do not store the PIM operations/predicates in the
+ VECTOR_BUILTIN_FNS array. */
+static GTY(()) tree vector_builtin_fns[ALTIVEC_PIM__FIRST];
+/* APPLE LOCAL end AltiVec */
+
/* Instruction costs on POWER4 and POWER5 processors. */
static const
struct processor_costs power4_cost = {
@@ -724,6 +747,16 @@ static rtx altivec_expand_predicate_builtin (enum insn_code,
const char *, tree, rtx);
static rtx altivec_expand_lv_builtin (enum insn_code, tree, rtx);
static rtx altivec_expand_stv_builtin (enum insn_code, tree);
+/* APPLE LOCAL begin AltiVec */
+static tree altivec_cov_rt_12 (tree, tree);
+static tree altivec_cov_rt_2p (tree);
+static tree altivec_cov_rt_1d (tree);
+static tree altivec_cov_rt_1h (tree);
+static struct altivec_pim_info *altivec_ovl_resolve (struct altivec_pim_info *,
+ tree, tree);
+static tree altivec_convert_args (tree, tree);
+/* APPLE LOCAL end AltiVec */
+
static void rs6000_parse_abi_options (void);
static void rs6000_parse_alignment_option (void);
static void rs6000_parse_tls_size_option (void);
@@ -748,13 +781,27 @@ static int rs6000_get_some_local_dynamic_name_1 (rtx *, void *);
static rtx rs6000_complex_function_value (enum machine_mode);
static rtx rs6000_spe_function_arg (CUMULATIVE_ARGS *,
enum machine_mode, tree);
-static rtx rs6000_darwin64_function_arg (CUMULATIVE_ARGS *,
- enum machine_mode, tree, int);
+/* APPLE LOCAL begin mainline */
+static void rs6000_darwin64_record_arg_advance_flush (CUMULATIVE_ARGS *,
+ HOST_WIDE_INT);
+static void rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *,
+ tree, HOST_WIDE_INT);
+static void rs6000_darwin64_record_arg_flush (CUMULATIVE_ARGS *,
+ HOST_WIDE_INT,
+ rtx[], int *);
+static void rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *,
+ tree, HOST_WIDE_INT,
+ rtx[], int *);
+static rtx rs6000_darwin64_record_arg (CUMULATIVE_ARGS *, tree, int, bool);
+/* APPLE LOCAL end mainline */
static rtx rs6000_mixed_function_arg (enum machine_mode, tree, int);
static void rs6000_move_block_from_reg (int regno, rtx x, int nregs);
static void setup_incoming_varargs (CUMULATIVE_ARGS *,
enum machine_mode, tree,
int *, int);
+/* APPLE LOCAL begin Altivec */
+static bool skip_vec_args (tree, int, int*);
+/* APPLE LOCAL end Altivec */
static bool rs6000_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode,
tree, bool);
static int rs6000_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode,
@@ -768,6 +815,7 @@ static void rs6000_darwin_file_start (void);
#endif
static tree rs6000_build_builtin_va_list (void);
+
static tree rs6000_gimplify_va_arg (tree, tree, tree *, tree *);
static bool rs6000_must_pass_in_stack (enum machine_mode, tree);
static bool rs6000_vector_mode_supported_p (enum machine_mode);
@@ -936,6 +984,17 @@ static const char alt_reg_names[][8] =
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS rs6000_init_builtins
+
+/* APPLE LOCAL begin AltiVec */
+/* If we are running in Apple AltiVec (as opposed to FSF AltiVec) mode,
+ we will need to handle the Motorola PIM instructions ourselves instead
+ of relying on <altivec.h>. The rs6000_fold_builtin() routine will
+ rewrite the PIM instructions into the __builtin... (AldyVec)
+ instructions. */
+#undef TARGET_FOLD_BUILTIN
+#define TARGET_FOLD_BUILTIN rs6000_fold_builtin
+/* APPLE LOCAL end AltiVec */
+
#undef TARGET_EXPAND_BUILTIN
#define TARGET_EXPAND_BUILTIN rs6000_expand_builtin
@@ -983,6 +1042,11 @@ static const char alt_reg_names[][8] =
#undef TARGET_SETUP_INCOMING_VARARGS
#define TARGET_SETUP_INCOMING_VARARGS setup_incoming_varargs
+/* APPLE LOCAL begin Altivec */
+#undef TARGET_SKIP_VEC_ARGS
+#define TARGET_SKIP_VEC_ARGS skip_vec_args
+/* APPLE LOCAL end Altivec */
+
/* Always strict argument naming on rs6000. */
#undef TARGET_STRICT_ARGUMENT_NAMING
#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_true
@@ -1090,6 +1154,8 @@ rs6000_override_options (const char *default_cpu)
size_t i, j;
struct rs6000_cpu_select *ptr;
int set_masks;
+ /* APPLE LOCAL -fast */
+ enum processor_type mcpu_cpu = PROCESSOR_POWER4;
/* Simplifications for entries below. */
@@ -1173,6 +1239,13 @@ rs6000_override_options (const char *default_cpu)
const size_t ptt_size = ARRAY_SIZE (processor_target_table);
+ /* APPLE LOCAL begin -mmultiple/-mstring fixme */
+ /* Save current -mmultiple/-mno-multiple status. */
+ int multiple = TARGET_MULTIPLE;
+ /* Save current -mstring/-mno-string status. */
+ int string = TARGET_STRING;
+ /* APPLE LOCAL end -mmultiple/-mstring fixme */
+
/* Some OSs don't support saving the high part of 64-bit registers on
context switch. Other OSs don't support saving Altivec registers.
On those OSs, we don't touch the MASK_POWERPC64 or MASK_ALTIVEC
@@ -1206,6 +1279,18 @@ rs6000_override_options (const char *default_cpu)
rs6000_select[0].string = default_cpu;
rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT;
+ /* APPLE LOCAL begin -fast */
+ if (flag_fast || flag_fastf || flag_fastcp)
+ {
+ if (rs6000_select[1].string == (char *)0 && rs6000_select[2].string == (char *)0)
+ {
+ /* -mcpu and -mtune unspecified. Assume both are G5 */
+ set_target_switch ("tune=G5");
+ set_target_switch ("cpu=G5");
+ }
+ }
+ /* APPLE LOCAL end -fast */
+
for (i = 0; i < ARRAY_SIZE (rs6000_select); i++)
{
ptr = &rs6000_select[i];
@@ -1222,6 +1307,9 @@ rs6000_override_options (const char *default_cpu)
target_flags &= ~set_masks;
target_flags |= (processor_target_table[j].target_enable
& set_masks);
+ /* APPLE LOCAL begin -fast */
+ mcpu_cpu = processor_target_table[j].processor;
+ /* APPLE LOCAL end -fast */
}
break;
}
@@ -1231,13 +1319,115 @@ rs6000_override_options (const char *default_cpu)
}
}
+ /* APPLE LOCAL begin AltiVec */
+ /* If '-maltivec' has been specified or if anything else turns on
+ AltiVec, enable AltiVec optimizations, even if previously turned
+ off via '-faltivec'. */
+ if (TARGET_ALTIVEC)
+ flag_disable_opts_for_faltivec = 0;
+
+ /* Handle -m(no-)pim-altivec. */
+ if (rs6000_altivec_pim_switch)
+ {
+ const char *base = rs6000_altivec_pim_switch - strlen ("pim-altivec");;
+ while (base[-1] != 'm') base--;
+ if (*rs6000_altivec_pim_switch != '\0')
+ error ("invalid option `%s'", base);
+
+ rs6000_altivec_pim = (base[0] != 'n');
+ /* If '-faltivec' or '-mpim-altivec' has been specified and we
+ have not already selected AltiVec codegen, disable certain
+ unsafe AltiVec optimizations so that the resulting binary can
+ run on a G3. These may be re-enabled by subsequently
+ specifying '-maltivec' or '-mcpu=xxx', where xxx supports
+ AltiVec instructions. */
+ if (rs6000_altivec_pim)
+ {
+ if (! TARGET_ALTIVEC)
+ {
+ flag_disable_opts_for_faltivec = 1;
+ target_flags |= MASK_ALTIVEC;
+ }
+ }
+ else
+ target_flags &= ~MASK_ALTIVEC;
+ }
+ /* APPLE LOCAL end AltiVec */
+
+ /* APPLE LOCAL begin -fast */
+ if (flag_fast || flag_fastf || flag_fastcp)
+ {
+ flag_gcse_sm = 1;
+ rs6000_sched_insert_nops = sched_finish_regroup_exact;
+ flag_unroll_loops = 1;
+ flag_tree_loop_linear = 1;
+ flag_strict_aliasing = 1;
+ flag_schedule_interblock = 1;
+ align_jumps_max_skip = 15;
+ align_loops_max_skip = 15;
+ align_functions = 16;
+ align_loops = 16;
+ align_jumps = 16;
+ set_fast_math_flags (1);
+ flag_reorder_blocks = 1;
+ /* APPLE LOCAL disable this until it works better. */
+ flag_speculative_prefetching = 0;
+ if (flag_branch_probabilities && !flag_exceptions)
+ flag_reorder_blocks_and_partition = 1;
+ if (!flag_pic)
+ set_target_switch ("dynamic-no-pic");
+
+ if (mcpu_cpu == PROCESSOR_POWER4)
+ {
+ set_target_switch ("powerpc-gpopt");
+ set_target_switch ("powerpc64");
+ }
+ if (flag_fast || flag_fastcp)
+ /* This doesn't work with NAG Fortran output. The gcc 3.5 C++ libraries
+ have been adjusted so that it now works with them. */
+ set_target_switch ("align-natural");
+ if (flag_fastf)
+ /* This applies Fortran argument semantics; for NAG Fortran output only. */
+ flag_argument_noalias = 2;
+ /* IMI flags */
+ disable_typechecking_for_spec_flag = 1;
+ flag_unit_at_a_time = 1;
+ }
+ /* APPLE LOCAL end -fast */
+
+ /* APPLE LOCAL rs6000_init_hard_regno_mode_ok must come AFTER setting of -fast flags */
+ rs6000_init_hard_regno_mode_ok ();
+
if (TARGET_E500)
rs6000_isel = 1;
+ /* APPLE LOCAL begin Disable string insns with -Os on Darwin (radar 3509006) */
/* If we are optimizing big endian systems for space, use the load/store
- multiple and string instructions. */
+ multiple instructions. */
if (BYTES_BIG_ENDIAN && optimize_size)
- target_flags |= ~target_flags_explicit & (MASK_MULTIPLE | MASK_STRING);
+ target_flags |= ~target_flags_explicit & MASK_MULTIPLE;
+
+ /* If we are optimizing big endian systems for space, use the
+ string instructions. But do not do this for Darwin, as the
+ kernel can't properly support some hardware that doesn't have
+ these instructions. It's not clear that the compiler is the
+ right place to fix this, but that's how it is for now. See
+ *extensive* discussion in Radar 3509006. */
+ if (BYTES_BIG_ENDIAN && optimize_size && DEFAULT_ABI != ABI_DARWIN)
+ target_flags |= MASK_STRING;
+ /* APPLE LOCAL end Disable string insns with -Os on Darwin (radar 3509006) */
+
+ /* APPLE LOCAL begin -mmultiple/-mstring fixme */
+ /* If -mmultiple or -mno-multiple was explicitly used, don't
+ override with the processor default */
+ if ((target_flags_explicit & MASK_MULTIPLE) != 0)
+ target_flags = (target_flags & ~MASK_MULTIPLE) | multiple;
+
+ /* If -mstring or -mno-string was explicitly used, don't override
+ with the processor default. */
+ if ((target_flags_explicit & MASK_STRING) != 0)
+ target_flags = (target_flags & ~MASK_STRING) | string;
+ /* APPLE LOCAL end -mmultiple/-mstring fixme */
/* Don't allow -mmultiple or -mstring on little endian systems
unless the cpu is a 750, because the hardware doesn't support the
@@ -1316,6 +1506,10 @@ rs6000_override_options (const char *default_cpu)
#if TARGET_MACHO
darwin_one_byte_bool = "";
#endif
+ /* APPLE LOCAL begin Macintosh alignment 2002-2-26 --ff */
+ /* Default to natural alignment, for better performance. */
+ rs6000_alignment_flags = MASK_ALIGN_NATURAL;
+ /* APPLE LOCAL end Macintosh alignment 2002-2-26 --ff */
}
/* Handle -mabi= options. */
@@ -1417,9 +1611,11 @@ rs6000_override_options (const char *default_cpu)
rs6000_sched_restricted_insns_priority =
atoi (rs6000_sched_restricted_insns_priority_str);
+ /* APPLE LOCAL begin only consider true dependency for grouping */
/* Handle -msched-costly-dep option. */
rs6000_sched_costly_dep
- = (rs6000_sched_groups ? store_to_load_dep_costly : no_dep_costly);
+ = (rs6000_sched_groups ? true_store_to_load_dep_costly : no_dep_costly);
+ /* APPLE LOCAL end only consider true dependency for grouping */
if (rs6000_sched_costly_dep_str)
{
if (! strcmp (rs6000_sched_costly_dep_str, "no"))
@@ -1511,6 +1707,12 @@ rs6000_override_options (const char *default_cpu)
if (DEFAULT_ABI != ABI_AIX)
targetm.calls.split_complex_arg = NULL;
+ /* APPLE LOCAL begin AltiVec */
+ /* Enable '(vector signed int)(a, b, c, d)' vector literal notation. */
+ if (TARGET_ALTIVEC)
+ targetm.cast_expr_as_vector_init = true;
+ /* APPLE LOCAL end AltiVec */
+
/* Initialize rs6000_cost with the appropriate target costs. */
if (optimize_size)
rs6000_cost = TARGET_POWERPC64 ? &size64_cost : &size32_cost;
@@ -1683,8 +1885,29 @@ rs6000_parse_alignment_option (void)
{
if (rs6000_alignment_string == 0)
return;
+ /* APPLE LOCAL begin Macintosh alignment 2002-2-26 --ff */
+ else if (! strcmp (rs6000_alignment_string, "mac68k"))
+ {
+ /* The old mac68k alignment has zero value for 64-bit work,
+ forbid its use. */
+ if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT)
+ error ("-malign-mac68k is not allowed for 64-bit Darwin");
+ rs6000_alignment_flags = MASK_ALIGN_MAC68K;
+ }
+ /* APPLE LOCAL end Macintosh alignment 2002-2-26 --ff */
else if (! strcmp (rs6000_alignment_string, "power"))
- rs6000_alignment_flags = MASK_ALIGN_POWER;
+ /* APPLE LOCAL begin mainline */
+ {
+ /* On 64-bit Darwin, power alignment is ABI-incompatible with
+ some C library functions, so warn about it. The flag may be
+ useful for performance studies from time to time though, so
+ don't disable it entirely. */
+ if (DEFAULT_ABI == ABI_DARWIN && TARGET_64BIT)
+ warning ("-malign-power is not supported for 64-bit Darwin;"
+ " it is incompatible with the installed C and C++ libraries");
+ rs6000_alignment_flags = MASK_ALIGN_POWER;
+ }
+ /* APPLE LOCAL end mainline */
else if (! strcmp (rs6000_alignment_string, "natural"))
rs6000_alignment_flags = MASK_ALIGN_NATURAL;
else
@@ -1712,6 +1935,30 @@ rs6000_parse_tls_size_option (void)
void
optimization_options (int level ATTRIBUTE_UNUSED, int size ATTRIBUTE_UNUSED)
{
+ /* APPLE LOCAL begin tweak default optimizations */
+ if (DEFAULT_ABI == ABI_DARWIN)
+ {
+ /* Turn these on only if specifically requested, not with -O* */
+ /* Strict aliasing breaks too much existing code */
+ flag_strict_aliasing = 0;
+ /* Block reordering causes code bloat, and very little speedup */
+ flag_reorder_blocks = 0;
+ /* Multi-basic-block scheduling loses badly when the compiler
+ misguesses which blocks are going to be executed, more than
+ it gains when it guesses correctly. Its guesses for cases
+ where interblock scheduling occurs (if-then-else's) are
+ little better than random, so disable this unless requested. */
+ flag_schedule_interblock = 0;
+ /* The Darwin libraries never set errno, so we might as well
+ avoid calling them when that's the only reason we would. */
+ flag_errno_math = 0;
+ /* Trapping math is not needed by many users, and is expensive.
+ C99 permits us to default it off and we do that. It is
+ turned on when <fenv.h> is included (see darwin_pragma_fenv
+ in darwin-c.c). */
+ flag_trapping_math = 0;
+ }
+ /* APPLE LOCAL end tweak default optimizations */
}
/* Do anything needed at the start of the asm file. */
@@ -1774,6 +2021,38 @@ rs6000_file_start (void)
toc_section ();
text_section ();
}
+
+ /* APPLE LOCAL begin lno */
+#if TARGET_MACHO
+ if (DEFAULT_ABI == ABI_DARWIN)
+ {
+ /* Emit declarations for all code sections at the beginning of the file; this
+ keeps them from being separated by data sections, which can lead to
+ out-of-range branches. Also align the unlikely text section properly; the
+ first real occurrence of this may be a label within a function, which does
+ not otherwise get aligned. */
+ if (flag_pic || MACHO_DYNAMIC_NO_PIC_P || flag_reorder_blocks_and_partition)
+ {
+ fprintf (asm_out_file, "\t.section __TEXT,__text,regular,pure_instructions\n");
+ if (flag_reorder_blocks_and_partition)
+ {
+ fprintf (asm_out_file, "\t.section __TEXT,__unlikely,regular,pure_instructions\n");
+ fprintf (asm_out_file, "\t.align 2\n");
+ }
+ if (MACHO_DYNAMIC_NO_PIC_P )
+ {
+ fprintf (asm_out_file, "\t.section __TEXT,__symbol_stub1,");
+ fprintf (asm_out_file, "symbol_stubs,pure_instructions,16\n");
+ }
+ else
+ {
+ fprintf (asm_out_file, "\t.section __TEXT,__picsymbolstub1,");
+ fprintf (asm_out_file, "symbol_stubs,pure_instructions,32\n");
+ }
+ }
+ }
+#endif
+ /* APPLE LOCAL end lno */
}
@@ -2966,6 +3245,11 @@ call_operand (rtx op, enum machine_mode mode)
return 0;
return (GET_CODE (op) == SYMBOL_REF
+ /* APPLE LOCAL begin accept hard R12 as target reg */
+#ifdef MAGIC_INDIRECT_CALL_REG
+ || (GET_CODE (op) == REG && REGNO (op) == MAGIC_INDIRECT_CALL_REG)
+#endif
+ /* APPLE LOCAL end accept hard R12 as target reg */
|| (GET_CODE (op) == REG
&& (REGNO (op) == LINK_REGISTER_REGNUM
|| REGNO (op) == COUNT_REGISTER_REGNUM
@@ -3862,6 +4146,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
}
#endif
+ /* APPLE LOCAL begin mainline 2005-03-04 */
/* Force ld/std non-word aligned offset into base register by wrapping
in offset 0. */
if (GET_CODE (x) == PLUS
@@ -3870,6 +4155,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
&& REG_MODE_OK_FOR_BASE_P (XEXP (x, 0), mode)
&& GET_CODE (XEXP (x, 1)) == CONST_INT
&& (INTVAL (XEXP (x, 1)) & 3) != 0
+ && !ALTIVEC_VECTOR_MODE (mode)
&& GET_MODE_SIZE (mode) >= UNITS_PER_WORD
&& TARGET_POWERPC64)
{
@@ -3880,6 +4166,7 @@ rs6000_legitimize_reload_address (rtx x, enum machine_mode mode,
*win = 1;
return x;
}
+ /* APPLE LOCAL end mainline 2005-03-04 */
if (GET_CODE (x) == PLUS
&& GET_CODE (XEXP (x, 0)) == REG
@@ -4318,6 +4605,57 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2)
return dest;
}
+/* APPLE LOCAL begin RTX_COST for multiply */
+int
+rs6000_rtx_mult_cost (rtx x)
+{
+ switch (rs6000_cpu)
+ {
+ case PROCESSOR_RIOS1:
+ case PROCESSOR_PPC405:
+ return (GET_CODE (XEXP (x, 1)) != CONST_INT
+ ? COSTS_N_INSNS (5)
+ : INTVAL (XEXP (x, 1)) >= -256 && INTVAL (XEXP (x, 1)) <= 255
+ ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4));
+ case PROCESSOR_RS64A:
+ return (GET_CODE (XEXP (x, 1)) != CONST_INT
+ ? GET_MODE (XEXP (x, 1)) != DImode
+ ? COSTS_N_INSNS (20) : COSTS_N_INSNS (34)
+ : INTVAL (XEXP (x, 1)) >= -256 && INTVAL (XEXP (x, 1)) <= 255
+ ? COSTS_N_INSNS (8) : COSTS_N_INSNS (12));
+ case PROCESSOR_RIOS2:
+ case PROCESSOR_MPCCORE:
+ case PROCESSOR_PPC604e:
+ return COSTS_N_INSNS (2);
+ case PROCESSOR_PPC601:
+ return COSTS_N_INSNS (5);
+ case PROCESSOR_PPC603:
+ case PROCESSOR_PPC7400:
+ case PROCESSOR_PPC750:
+ return (GET_CODE (XEXP (x, 1)) != CONST_INT
+ ? COSTS_N_INSNS (5)
+ : INTVAL (XEXP (x, 1)) >= -256 && INTVAL (XEXP (x, 1)) <= 255
+ ? COSTS_N_INSNS (2) : COSTS_N_INSNS (3));
+ case PROCESSOR_PPC7450:
+ return (GET_CODE (XEXP (x, 1)) != CONST_INT
+ ? COSTS_N_INSNS (4)
+ : COSTS_N_INSNS (3));
+ case PROCESSOR_PPC403:
+ case PROCESSOR_PPC604:
+ return COSTS_N_INSNS (4);
+ case PROCESSOR_PPC620:
+ case PROCESSOR_PPC630:
+ return (GET_CODE (XEXP (x, 1)) != CONST_INT
+ ? GET_MODE (XEXP (x, 1)) != DImode
+ ? COSTS_N_INSNS (5) : COSTS_N_INSNS (7)
+ : INTVAL (XEXP (x, 1)) >= -256 && INTVAL (XEXP (x, 1)) <= 255
+ ? COSTS_N_INSNS (3) : COSTS_N_INSNS (4));
+ default:
+ abort ();
+ }
+}
+/* APPLE LOCAL end RTX_COST for multiply */
+
/* Helper for the following. Get rid of [r+r] memory refs
in cases where it won't work (TImode, TFmode). */
@@ -4716,13 +5054,25 @@ rs6000_return_in_memory (tree type, tree fntype ATTRIBUTE_UNUSED)
{
/* In the darwin64 abi, try to use registers for larger structs
if possible. */
- if (AGGREGATE_TYPE_P (type)
- && rs6000_darwin64_abi
+ /* APPLE LOCAL begin mainline */
+ if (rs6000_darwin64_abi
&& TREE_CODE (type) == RECORD_TYPE
- && ((unsigned HOST_WIDE_INT) int_size_in_bytes (type) <= 32)
- && ((unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 0))
- return false;
+ && int_size_in_bytes (type) > 0)
+ {
+ CUMULATIVE_ARGS valcum;
+ rtx valret;
+ valcum.words = 0;
+ valcum.fregno = FP_ARG_MIN_REG;
+ valcum.vregno = ALTIVEC_ARG_MIN_REG;
+ /* Do a trial code generation as if this were going to be passed
+ as an argument; if any part goes in memory, we return NULL. */
+ valret = rs6000_darwin64_record_arg (&valcum, type, 1, true);
+ if (valret)
+ return false;
+ /* Otherwise fall through to more conventional ABI rules. */
+ }
+ /* APPLE LOCAL end mainline */
if (AGGREGATE_TYPE_P (type)
&& (TARGET_AIX_STRUCT_RET
|| (unsigned HOST_WIDE_INT) int_size_in_bytes (type) > 8))
@@ -4912,6 +5262,11 @@ function_arg_boundary (enum machine_mode mode, tree type)
|| (type && TREE_CODE (type) == VECTOR_TYPE
&& int_size_in_bytes (type) >= 16))
return 128;
+ /* APPLE LOCAL begin mainline */
+ else if (rs6000_darwin64_abi && mode == BLKmode
+ && type && TYPE_ALIGN (type) > 64)
+ return 128;
+ /* APPLE LOCAL end mainline */
else
return PARM_BOUNDARY;
}
@@ -4934,47 +5289,87 @@ rs6000_arg_size (enum machine_mode mode, tree type)
return (size + 7) >> 3;
}
-/* The darwin64 ABI calls for us to recurse down through structs,
- applying the same rules to struct elements as if a reference to
- each were being passed directly. */
+/* APPLE LOCAL begin mainline */
+/* Use this to flush pending int fields. */
static void
-darwin64_function_arg_advance (CUMULATIVE_ARGS *cum, tree type,
- int named, int depth)
+rs6000_darwin64_record_arg_advance_flush (CUMULATIVE_ARGS *cum,
+ HOST_WIDE_INT bitpos)
{
- tree f, ftype;
- int i, tot;
+ unsigned int startbit, endbit;
+ int intregs, intoffset;
+ enum machine_mode mode;
- switch (TREE_CODE (type))
- {
- case RECORD_TYPE:
- for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
- if (TREE_CODE (f) == FIELD_DECL)
- {
- ftype = TREE_TYPE (f);
- function_arg_advance (cum, TYPE_MODE (ftype), ftype,
- named, depth + 1);
- }
- break;
+ if (cum->intoffset == -1)
+ return;
- case ARRAY_TYPE:
- tot = int_size_in_bytes (type);
- if (tot <= 0)
- return;
- ftype = TREE_TYPE (type);
- tot /= int_size_in_bytes (ftype);
-
- for (i = 0; i < tot; ++i)
+ intoffset = cum->intoffset;
+ cum->intoffset = -1;
+
+ if (intoffset % BITS_PER_WORD != 0)
+ {
+ mode = mode_for_size (BITS_PER_WORD - intoffset % BITS_PER_WORD,
+ MODE_INT, 0);
+ if (mode == BLKmode)
{
- function_arg_advance (cum, TYPE_MODE (ftype), ftype,
- named, depth + 1);
+ /* We couldn't find an appropriate mode, which happens,
+ e.g., in packed structs when there are 3 bytes to load.
+ Back intoffset back to the beginning of the word in this
+ case. */
+ intoffset = intoffset & -BITS_PER_WORD;
}
- break;
-
- default:
- abort ();
}
+
+ startbit = intoffset & -BITS_PER_WORD;
+ endbit = (bitpos + BITS_PER_WORD - 1) & -BITS_PER_WORD;
+ intregs = (endbit - startbit) / BITS_PER_WORD;
+ cum->words += intregs;
+}
+
+/* The darwin64 ABI calls for us to recurse down through structs,
+ looking for elements passed in registers. Unfortunately, we have
+ to track int register count here also because of misalignments
+ in powerpc alignment mode. */
+
+static void
+rs6000_darwin64_record_arg_advance_recurse (CUMULATIVE_ARGS *cum,
+ tree type,
+ HOST_WIDE_INT startbitpos)
+{
+ tree f;
+
+ for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
+ if (TREE_CODE (f) == FIELD_DECL)
+ {
+ HOST_WIDE_INT bitpos = startbitpos;
+ tree ftype = TREE_TYPE (f);
+ enum machine_mode mode = TYPE_MODE (ftype);
+
+ if (DECL_SIZE (f) != 0
+ && host_integerp (bit_position (f), 1))
+ bitpos += int_bit_position (f);
+
+ /* ??? FIXME: else assume zero offset. */
+
+ if (TREE_CODE (ftype) == RECORD_TYPE)
+ rs6000_darwin64_record_arg_advance_recurse (cum, ftype, bitpos);
+ else if (USE_FP_FOR_ARG_P (cum, mode, ftype))
+ {
+ rs6000_darwin64_record_arg_advance_flush (cum, bitpos);
+ cum->fregno += (GET_MODE_SIZE (mode) + 7) >> 3;
+ cum->words += (GET_MODE_SIZE (mode) + 7) >> 3;
+ }
+ else if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, 1))
+ {
+ rs6000_darwin64_record_arg_advance_flush (cum, bitpos);
+ cum->vregno++;
+ cum->words += 2;
+ }
+ else if (cum->intoffset == -1)
+ cum->intoffset = bitpos;
+ }
}
+/* APPLE LOCAL end mainline */
/* Update the data in CUM to advance over an argument
of mode MODE and data type TYPE.
@@ -4988,6 +5383,10 @@ void
function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type, int named, int depth)
{
+/* APPLE LOCAL begin mainline */
+ int size;
+
+/* APPLE LOCAL end mainline */
/* Only tick off an argument if we're not recursing. */
if (depth == 0)
cum->nargs_prototype--;
@@ -5049,12 +5448,34 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
&& cum->sysv_gregno <= GP_ARG_MAX_REG)
cum->sysv_gregno++;
+ /* APPLE LOCAL begin mainline */
else if (rs6000_darwin64_abi
&& mode == BLKmode
- && (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == ARRAY_TYPE))
- darwin64_function_arg_advance (cum, type, named, depth);
-
+ && TREE_CODE (type) == RECORD_TYPE
+ && (size = int_size_in_bytes (type)) > 0)
+ {
+ /* Variable sized types have size == -1 and are
+ treated as if consisting entirely of ints.
+ Pad to 16 byte boundary if needed. */
+ if (TYPE_ALIGN (type) >= 2 * BITS_PER_WORD
+ && (cum->words % 2) != 0)
+ cum->words++;
+ /* For varargs, we can just go up by the size of the struct. */
+ if (!named)
+ cum->words += (size + 7) / 8;
+ else
+ {
+ /* It is tempting to say int register count just goes up by
+ sizeof(type)/8, but this is wrong in a case such as
+ { int; double; int; } [powerpc alignment]. We have to
+ grovel through the fields for these too. */
+ cum->intoffset = 0;
+ rs6000_darwin64_record_arg_advance_recurse (cum, type, 0);
+ rs6000_darwin64_record_arg_advance_flush (cum,
+ size * BITS_PER_UNIT);
+ }
+ }
+ /* APPLE LOCAL end mainline */
else if (DEFAULT_ABI == ABI_V4)
{
if (TARGET_HARD_FLOAT && TARGET_FPRS
@@ -5213,139 +5634,189 @@ rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
}
}
-/* For the darwin64 ABI, we want to construct a PARALLEL consisting of
- the register(s) to be used for each field and subfield of a struct
- being passed by value, along with the offset of where the
- register's value may be found in the block. */
+/* APPLE LOCAL begin mainline */
+/* A subroutine of rs6000_darwin64_record_arg. Assign the bits of the
+ structure between cum->intoffset and bitpos to integer registers. */
-static rtx
-rs6000_darwin64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
- tree type, int named)
+static void
+rs6000_darwin64_record_arg_flush (CUMULATIVE_ARGS *cum,
+ HOST_WIDE_INT bitpos, rtx rvec[], int *k)
{
- tree f, ftype, offset;
- rtx rvec[FIRST_PSEUDO_REGISTER], sub, suboff, roffset;
- int k = 0, i, j, bytepos, subbytepos, tot;
- CUMULATIVE_ARGS saved_cum = *cum;
- enum machine_mode submode;
+ enum machine_mode mode;
+ unsigned int regno;
+ unsigned int startbit, endbit;
+ int this_regno, intregs, intoffset;
+ rtx reg;
+
+ if (cum->intoffset == -1)
+ return;
+
+ intoffset = cum->intoffset;
+ cum->intoffset = -1;
+
+ /* If this is the trailing part of a word, try to only load that
+ much into the register. Otherwise load the whole register. Note
+ that in the latter case we may pick up unwanted bits. It's not a
+ problem at the moment but may wish to revisit. */
- switch (TREE_CODE (type))
+ if (intoffset % BITS_PER_WORD != 0)
{
- case RECORD_TYPE:
- for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
- if (TREE_CODE (f) == FIELD_DECL)
+ mode = mode_for_size (BITS_PER_WORD - intoffset % BITS_PER_WORD,
+ MODE_INT, 0);
+ if (mode == BLKmode)
+ {
+ /* We couldn't find an appropriate mode, which happens,
+ e.g., in packed structs when there are 3 bytes to load.
+ Back intoffset back to the beginning of the word in this
+ case. */
+ intoffset = intoffset & -BITS_PER_WORD;
+ mode = word_mode;
+ }
+ }
+ else
+ mode = word_mode;
+
+ startbit = intoffset & -BITS_PER_WORD;
+ endbit = (bitpos + BITS_PER_WORD - 1) & -BITS_PER_WORD;
+ intregs = (endbit - startbit) / BITS_PER_WORD;
+ this_regno = cum->words + intoffset / BITS_PER_WORD;
+
+ if (intregs > 0 && intregs > GP_ARG_NUM_REG - this_regno)
+ cum->use_stack = 1;
+
+ intregs = MIN (intregs, GP_ARG_NUM_REG - this_regno);
+ if (intregs <= 0)
+ return;
+
+ intoffset /= BITS_PER_UNIT;
+ do
+ {
+ regno = GP_ARG_MIN_REG + this_regno;
+ reg = gen_rtx_REG (mode, regno);
+ rvec[(*k)++] =
+ gen_rtx_EXPR_LIST (VOIDmode, reg, GEN_INT (intoffset));
+
+ this_regno += 1;
+ intoffset = (intoffset | (UNITS_PER_WORD-1)) + 1;
+ mode = word_mode;
+ intregs -= 1;
+ }
+ while (intregs > 0);
+}
+
+/* Recursive workhorse for the following. */
+
+static void
+rs6000_darwin64_record_arg_recurse (CUMULATIVE_ARGS *cum, tree type,
+ HOST_WIDE_INT startbitpos, rtx rvec[],
+ int *k)
+{
+ tree f;
+
+ for (f = TYPE_FIELDS (type); f ; f = TREE_CHAIN (f))
+ if (TREE_CODE (f) == FIELD_DECL)
+ {
+ HOST_WIDE_INT bitpos = startbitpos;
+ tree ftype = TREE_TYPE (f);
+ enum machine_mode mode = TYPE_MODE (ftype);
+
+ if (DECL_SIZE (f) != 0
+ && host_integerp (bit_position (f), 1))
+ bitpos += int_bit_position (f);
+
+ /* ??? FIXME: else assume zero offset. */
+
+ if (TREE_CODE (ftype) == RECORD_TYPE)
+ rs6000_darwin64_record_arg_recurse (cum, ftype, bitpos, rvec, k);
+ else if (cum->named && USE_FP_FOR_ARG_P (cum, mode, ftype))
{
- ftype = TREE_TYPE (f);
- offset = DECL_FIELD_OFFSET (f);
- bytepos = int_bit_position (f) / BITS_PER_UNIT;
- /* Force substructs to be handled as BLKmode even if
- they're small enough to be recorded as DImode, so we
- drill through to non-record fields. */
- submode = TYPE_MODE (ftype);
- if (TREE_CODE (ftype) == RECORD_TYPE)
- submode = BLKmode;
- sub = function_arg (cum, submode, ftype, named);
- if (sub == NULL_RTX)
- return NULL_RTX;
- if (GET_CODE (sub) == PARALLEL)
- {
- for (i = 0; i < XVECLEN (sub, 0); i++)
- {
- rtx subsub = XVECEXP (sub, 0, i);
- suboff = XEXP (subsub, 1);
- subbytepos = INTVAL (suboff);
- subbytepos += bytepos;
- roffset = gen_rtx_CONST_INT (SImode, subbytepos);
- subsub = XEXP (subsub, 0);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, subsub, roffset);
- }
- }
- else
+#if 0
+ switch (mode)
{
- roffset = gen_rtx_CONST_INT (SImode, bytepos);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
+ case SCmode: mode = SFmode; break;
+ case DCmode: mode = DFmode; break;
+ case TCmode: mode = TFmode; break;
+ default: break;
}
- /* Now do an arg advance to get all the cumulative arg
- stuff set correctly for the next subfield. Note that it
- has no lasting effect, because it is being done on a
- temporary copy of the cumulative arg data. */
- function_arg_advance (cum, submode, ftype, named, 1);
+#endif
+ rs6000_darwin64_record_arg_flush (cum, bitpos, rvec, k);
+ rvec[(*k)++]
+ = gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode, cum->fregno++),
+ GEN_INT (bitpos / BITS_PER_UNIT));
+ if (mode == TFmode)
+ cum->fregno++;
}
- break;
+ else if (cum->named && USE_ALTIVEC_FOR_ARG_P (cum, mode, ftype, 1))
+ {
+ rs6000_darwin64_record_arg_flush (cum, bitpos, rvec, k);
+ rvec[(*k)++]
+ = gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode, cum->vregno++),
+ GEN_INT (bitpos / BITS_PER_UNIT));
+ }
+ else if (cum->intoffset == -1)
+ cum->intoffset = bitpos;
+ }
+}
- case UNION_TYPE:
- tot = rs6000_arg_size (mode, type);
- if (tot <= 0)
- return NULL_RTX;
- bytepos = 0;
+/* For the darwin64 ABI, we want to construct a PARALLEL consisting of
+ the register(s) to be used for each field and subfield of a struct
+ being passed by value, along with the offset of where the
+ register's value may be found in the block. FP fields go in FP
+ register, vector fields go in vector registers, and everything
+ else goes in int registers, packed as in memory.
- for (j = 0; j < tot; ++j)
- {
- sub = gen_rtx_REG ((TARGET_64BIT ? DImode : SImode), GP_ARG_MIN_REG + cum->words++);
- roffset = gen_rtx_CONST_INT (SImode, bytepos);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
- if (cum->words >= GP_ARG_NUM_REG)
- break;
- bytepos += (TARGET_64BIT ? 8 : 4);
- }
- break;
+ This code is also used for function return values. RETVAL indicates
+ whether this is the case.
- case ARRAY_TYPE:
- tot = int_size_in_bytes (type);
- if (tot <= 0)
- return NULL_RTX;
- ftype = TREE_TYPE (type);
- tot /= int_size_in_bytes (ftype);
- bytepos = 0;
+ Much of this is taken from the Sparc V9 port, which has a similar
+ calling convention. */
- for (j = 0; j < tot; ++j)
- {
- /* Force substructs to be handled as BLKmode even if
- they're small enough to be recorded as DImode, so we
- drill through to non-record fields. */
- submode = TYPE_MODE (ftype);
- if (TREE_CODE (ftype) == RECORD_TYPE)
- submode = BLKmode;
- sub = function_arg (cum, submode, ftype, named);
- if (sub == NULL_RTX)
- return NULL_RTX;
- if (GET_CODE (sub) == PARALLEL)
- {
- for (i = 0; i < XVECLEN (sub, 0); i++)
- {
- rtx subsub = XVECEXP (sub, 0, i);
-
- suboff = XEXP (subsub, 1);
- subbytepos = INTVAL (suboff);
- subbytepos += bytepos;
- roffset = gen_rtx_CONST_INT (SImode, subbytepos);
- subsub = XEXP (subsub, 0);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, subsub, roffset);
- }
- }
- else
- {
- roffset = gen_rtx_CONST_INT (SImode, bytepos);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
- }
- /* Now do an arg advance to get all the cumulative arg
- stuff set correctly for the next subfield. Note that it
- has no lasting effect, because it is being done on a
- temporary copy of the cumulative arg data. */
- function_arg_advance (cum, submode, ftype, named, 1);
- bytepos += int_size_in_bytes (ftype);
- }
- break;
-
- default:
- abort ();
- }
-
- *cum = saved_cum;
- if (k > 0)
- return gen_rtx_PARALLEL (mode, gen_rtvec_v (k, rvec));
+static rtx
+rs6000_darwin64_record_arg (CUMULATIVE_ARGS *orig_cum, tree type,
+ int named, bool retval)
+{
+ rtx rvec[FIRST_PSEUDO_REGISTER];
+ int k = 1, kbase = 1;
+ HOST_WIDE_INT typesize = int_size_in_bytes (type);
+ /* This is a copy; modifications are not visible to our caller. */
+ CUMULATIVE_ARGS copy_cum = *orig_cum;
+ CUMULATIVE_ARGS *cum = &copy_cum;
+
+ /* Pad to 16 byte boundary if needed. */
+ if (!retval && TYPE_ALIGN (type) >= 2 * BITS_PER_WORD
+ && (cum->words % 2) != 0)
+ cum->words++;
+
+ cum->intoffset = 0;
+ cum->use_stack = 0;
+ cum->named = named;
+
+ /* Put entries into rvec[] for individual FP and vector fields, and
+ for the chunks of memory that go in int regs. Note we start at
+ element 1; 0 is reserved for an indication of using memory, and
+ may or may not be filled in below. */
+ rs6000_darwin64_record_arg_recurse (cum, type, 0, rvec, &k);
+ rs6000_darwin64_record_arg_flush (cum, typesize * BITS_PER_UNIT, rvec, &k);
+
+ /* If any part of the struct went on the stack put all of it there.
+ This hack is because the generic code for
+ FUNCTION_ARG_PARTIAL_NREGS cannot handle cases where the register
+ parts of the struct are not at the beginning. */
+ if (cum->use_stack)
+ {
+ if (retval)
+ return NULL_RTX; /* doesn't go in registers at all */
+ kbase = 0;
+ rvec[0] = gen_rtx_EXPR_LIST (VOIDmode, NULL_RTX, const0_rtx);
+ }
+ if (k > 1 || cum->use_stack)
+ return gen_rtx_PARALLEL (BLKmode, gen_rtvec_v (k - kbase, &rvec[kbase]));
else
return NULL_RTX;
}
+/* APPLE LOCAL end mainline */
/* Determine where to place an argument in 64-bit mode with 32-bit ABI. */
@@ -5454,17 +5925,16 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
return GEN_INT (cum->call_cookie);
}
- if (mode == BLKmode
- && rs6000_darwin64_abi
- && (TREE_CODE (type) == RECORD_TYPE
- || TREE_CODE (type) == UNION_TYPE
- || TREE_CODE (type) == ARRAY_TYPE))
+ /* APPLE LOCAL begin mainline */
+ if (rs6000_darwin64_abi && mode == BLKmode
+ && TREE_CODE (type) == RECORD_TYPE)
{
- rtx rslt = rs6000_darwin64_function_arg (cum, mode, type, named);
+ rtx rslt = rs6000_darwin64_record_arg (cum, type, named, false);
if (rslt != NULL_RTX)
return rslt;
/* Else fall through to usual handling. */
}
+ /* APPLE LOCAL end mainline */
if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named))
if (TARGET_64BIT && ! cum->prototype)
@@ -5701,6 +6171,14 @@ rs6000_arg_partial_bytes (CUMULATIVE_ARGS *cum, enum machine_mode mode,
&& cum->nargs_prototype >= 0)
return 0;
+ /* APPLE LOCAL begin mainline */
+ /* In this complicated case we just disable the partial_nregs code. */
+ if (rs6000_darwin64_abi && mode == BLKmode
+ && TREE_CODE (type) == RECORD_TYPE
+ && int_size_in_bytes (type) > 0)
+ return 0;
+ /* APPLE LOCAL end mainline */
+
align = function_arg_boundary (mode, type) / PARM_BOUNDARY - 1;
parm_offset = TARGET_32BIT ? 2 : 0;
align_words = cum->words + ((parm_offset - cum->words) & align);
@@ -5926,6 +6404,32 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
}
}
+/* APPLE LOCAL begin Altivec */
+/* This routine determins if an extra pass over argument list is needed
+ for vector aruments. It returns true, if current argument need be
+ skipped. This depends on if we are in the first iteration (to skip
+ vectors), or 2nd iteration (to skip non-vectors).
+*/
+
+static
+bool skip_vec_args(tree arg_type, int pass, int *last_pass)
+{
+ if (DEFAULT_ABI != ABI_DARWIN)
+ return false;
+
+ if (TREE_CODE (arg_type) == VECTOR_TYPE)
+ {
+ *last_pass = 2;
+ if (pass == 1)
+ return true;
+ }
+ else if (pass == 2)
+ return true;
+ return false;
+}
+/* APPLE LOCAL end Altivec */
+
+
/* Create the va_list data type. */
static tree
@@ -6217,12 +6721,117 @@ rs6000_gimplify_va_arg (tree valist, tree type, tree *pre_p, tree *post_p)
/* Builtins. */
+/* APPLE LOCAL begin Altivec */
#define def_builtin(MASK, NAME, TYPE, CODE) \
do { \
if ((MASK) & target_flags) \
- lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
+ vector_builtin_fns[(CODE)] = lang_hooks.builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, \
NULL, NULL_TREE); \
} while (0)
+/* APPLE LOCAL end Altivec */
+
+/* APPLE LOCAL begin AltiVec */
+/* The AltiVec PIM operations and predicates (used in Apple AltiVec mode)
+ are stored in ALTIVEC_PIM_TABLE below, each annotated with flags indicating
+ how its arguments should be matched and/or how its return type is to be
+ determined. */
+
+enum pim_flags
+{
+ /* CR6 predicate modifiers. Not used for operations. For predicates,
+ one of the following four values shall be prepended to the argument
+ list as an INTEGER_CST. */
+
+ pim_cr6_eq = 0, /* __CR6_EQ */
+ pim_cr6_ne = 1, /* __CR6_EQ_REV */
+ pim_cr6_lt = 2, /* __CR6_LT */
+ pim_cr6_ge = 3, /* __CR6_LT_REV */
+ pim_cr6_MASK = pim_cr6_eq | pim_cr6_ne | pim_cr6_lt | pim_cr6_ge,
+
+ /* Function overload argument matching. Operations and predicates with
+ multiple overload candidates will have multiple entries, listed
+ contiguously, in the ALTIVEC_PIM_TABLE below. When the
+ rs6000_fold_builtin() routine is called, it will first point at
+ the first entry. If any of the pim_ovl_... flags is set for this
+ entry, the argument(s) to rs6000_fold_builtin() will be type-checked
+ accordingly. If the check succeeds, the current entry will be
+ used to rewrite the PIM instruction into a __builtin instruction;
+ if the check fails, the next entry in ALTIVEC_PIM_TABLE is selected
+ and the pim_ovl_... type comparison is made again. */
+
+ pim_ovl_16 = 4, /* First argument must be a 16-element vector */
+ pim_ovl_16u = 8,
+ pim_ovl_8 = 12, /* First argument must be an 8-element vector */
+ pim_ovl_8u = 16,
+ pim_ovl_8p = 20, /* First argument must be a vector pixel */
+ pim_ovl_4 = 24, /* First argument must be a 4-element vector */
+ pim_ovl_4u = 28,
+ pim_ovl_4f = 32, /* First argument must be a vector float */
+ pim_ovl_16u_16u = 36, /* First two args must be unsigned 16-el vectors */
+ pim_ovl_8u_8u = 40,
+ pim_ovl_4u_4u = 44,
+ pim_ovl_pqi_2 = 48, /* Second argument must be a pointer to QI. */
+ pim_ovl_phi_2 = 52, /* Second argument must be a pointer to HI. */
+ pim_ovl_psi_2 = 56, /* Second argument must be a pointer to SI. */
+ pim_ovl_MASK = pim_ovl_16 | pim_ovl_16u | pim_ovl_8 | pim_ovl_8u
+ | pim_ovl_8p | pim_ovl_4 | pim_ovl_4u | pim_ovl_4f
+ | pim_ovl_16u_16u | pim_ovl_8u_8u | pim_ovl_4u_4u
+ | pim_ovl_pqi_2 | pim_ovl_phi_2 | pim_ovl_psi_2,
+
+ /* Return type computation. For some operations/predicates, the return
+ type is not always the same (in which case it will be stored
+ in the ALTIVEC_PIM_table), but rather is a function of the arguments
+ supplied. */
+
+ pim_rt_12 = 512, /* Covariant with first two arguments. */
+ pim_rt_2p = 1024, /* Covariant with pointee of second argument. */
+ pim_rt_1 = 1536, /* Covariant with first argument only. */
+ pim_rt_1d = 2048, /* Double the vector element size of first arg. */
+ pim_rt_1h = 2560, /* Halve the vector element size of first arg. */
+ pim_rt_MASK = pim_rt_12 | pim_rt_2p | pim_rt_1 | pim_rt_1d | pim_rt_1h,
+
+ /* Argument manipulation. Before the __builtin instructions are called,
+ the arguments may need to be rearranged. In addition, for all
+ predicates, one of the CR6 values will be prepended to the argument
+ list (see pim_cr6_... above). */
+
+ pim_manip_swap = 8192, /* Swap the first two arguments. */
+ pim_manip_dup = 16384, /* Duplicate first argument. */
+ pim_manip_MASK = pim_manip_swap | pim_manip_dup,
+
+ /* Mark the beginning of instruction groups. For our purposes, an
+ instruction group is the collection of overload candidates for
+ a particular instruction or predicate. For example, the entries
+ "vec_abss", "vec_abss.2" and "vec_abss.3" defined in
+ altivec_init_builtins() below constitute a group, as does the
+ singleton "vec_addc" entry. */
+
+ pim_group = 32768
+};
+
+struct altivec_pim_info GTY(())
+{
+ tree rettype; /* Return type (unless pim_rt_... flags are used). */
+ int insn; /* FUNCTION_DECL_CODE of the underlying '__builtin_...'. */
+ enum pim_flags flags; /* See 'enum pim_flags' above. */
+};
+
+static GTY(()) struct altivec_pim_info
+altivec_pim_table[ALTIVEC_PIM__LAST - ALTIVEC_PIM__FIRST + 1];
+
+#define def_pim_builtin(NAME, TYPE, INSN, FLAGS) \
+do { \
+ lang_hooks.builtin_function (NAME, int_ftype_ellipsis, pim_code, \
+ BUILT_IN_MD, NULL, NULL_TREE); \
+ \
+ altivec_pim_table[pim_code - ALTIVEC_PIM__FIRST].rettype = TYPE; \
+ altivec_pim_table[pim_code - ALTIVEC_PIM__FIRST].insn \
+ = ALTIVEC_BUILTIN_##INSN; \
+ altivec_pim_table[pim_code - ALTIVEC_PIM__FIRST].flags = FLAGS; \
+ \
+ ++pim_code; \
+} while (0)
+/* APPLE LOCAL end AltiVec */
/* Simple ternary operations: VECd = foo (VECa, VECb, VECc). */
@@ -6661,6 +7270,382 @@ static struct builtin_description bdesc_1arg[] =
{ 0, CODE_FOR_spe_evsubfusiaaw, "__builtin_spe_evsubfusiaaw", SPE_BUILTIN_EVSUBFUSIAAW },
};
+/* APPLE LOCAL begin AltiVec */
+/* Determine the return type from types T1 and T2 of the first two arguments.
+ This is required for some of the AltiVec PIM operations/predicates. */
+
+static tree
+altivec_cov_rt_12 (tree t1, tree t2)
+{
+ /* NB: The ordering of the following statements is important.
+ Matching of more specific types (e.g., 'vector pixel') should
+ precede matching of more general types, esp. if they subsume the
+ former (e.g., 'vector of 8 elements'). */
+
+#define RETURN_IF_EITHER_IS(TYPE) if (t1 == TYPE || t2 == TYPE) return TYPE
+
+ RETURN_IF_EITHER_IS (unsigned_V16QI_type_node);
+ RETURN_IF_EITHER_IS (V16QI_type_node);
+ RETURN_IF_EITHER_IS (bool_V16QI_type_node);
+ RETURN_IF_EITHER_IS (unsigned_V8HI_type_node);
+ RETURN_IF_EITHER_IS (pixel_V8HI_type_node);
+ RETURN_IF_EITHER_IS (V8HI_type_node);
+ RETURN_IF_EITHER_IS (bool_V8HI_type_node);
+ RETURN_IF_EITHER_IS (unsigned_V4SI_type_node);
+ RETURN_IF_EITHER_IS (V4SF_type_node);
+ RETURN_IF_EITHER_IS (V4SI_type_node);
+ RETURN_IF_EITHER_IS (bool_V4SI_type_node);
+
+#undef RETURN_IF_EITHER_IS
+
+ return NULL_TREE;
+}
+
+/* Determine the return type from the pointee type of argument type T.
+ This is required for some of the AltiVec PIM operations/predicates. */
+
+static tree
+altivec_cov_rt_2p (tree t)
+{
+ /* Must be a pointer. */
+
+ if (TREE_CODE (t) != POINTER_TYPE)
+ return NULL_TREE;
+
+ t = TYPE_MAIN_VARIANT (TREE_TYPE (t));
+
+ /* For pointers to vectors, the return type is the vector itself. */
+
+ if (TREE_CODE (t) == VECTOR_TYPE)
+ return t;
+
+ switch (TYPE_MODE (t))
+ {
+ case QImode:
+ return TYPE_UNSIGNED (t) ? unsigned_V16QI_type_node : V16QI_type_node;
+
+ case HImode:
+ return TYPE_UNSIGNED (t) ? unsigned_V8HI_type_node : V8HI_type_node;
+
+ case SImode:
+ return TYPE_UNSIGNED (t) ? unsigned_V4SI_type_node : V4SI_type_node;
+
+ case SFmode:
+ return V4SF_type_node;
+
+ default:
+ return NULL_TREE;
+ }
+}
+
+/* Determine the return type from type T by doubling the size of its
+ constituent vector elements. This is required for some of the AltiVec
+ PIM operations/predicates. */
+
+static tree
+altivec_cov_rt_1d (tree t)
+{
+ if (t == V16QI_type_node)
+ return V8HI_type_node;
+ else if (t == unsigned_V16QI_type_node)
+ return unsigned_V8HI_type_node;
+ else if (t == bool_V16QI_type_node)
+ return bool_V8HI_type_node;
+ else if (t == V8HI_type_node)
+ return V4SI_type_node;
+ else if (t == unsigned_V8HI_type_node || t == pixel_V8HI_type_node)
+ return unsigned_V4SI_type_node;
+ else if (t == bool_V8HI_type_node)
+ return bool_V4SI_type_node;
+ else
+ return NULL_TREE; /* Invalid argument. */
+}
+
+/* Determine the return type from type T by halving the size of its
+ constituent vector elements. This is required for some of the AltiVec
+ PIM operations/predicates. */
+
+static tree
+altivec_cov_rt_1h (tree t)
+{
+ if (t == V8HI_type_node)
+ return V16QI_type_node;
+ else if (t == unsigned_V8HI_type_node || t == pixel_V8HI_type_node)
+ return unsigned_V16QI_type_node;
+ else if (t == bool_V8HI_type_node)
+ return bool_V16QI_type_node;
+ else if (t == V4SI_type_node)
+ return V8HI_type_node;
+ else if (t == unsigned_V4SI_type_node)
+ return unsigned_V8HI_type_node;
+ else if (t == bool_V4SI_type_node)
+ return bool_V8HI_type_node;
+ else
+ return NULL_TREE; /* Invalid argument. */
+}
+
+/* Given the types T1 and T2 of the first two arguments, and INFO pointing
+ to the first of available overload candidates (in the ALTIVEC_PIM_TABLE)
+ for an AltiVec PIM operation or predicate, select a desired overload
+ candidate by incrementing and returning INFO as appropriate. If no
+ overload candidate is suitable, return NULL. */
+
+static struct altivec_pim_info *
+altivec_ovl_resolve (struct altivec_pim_info *info, tree t1, tree t2)
+{
+ /* Make sure we have all the types that we need. */
+ if (!t1 || (!t2 && (info->flags & pim_ovl_MASK) >= pim_ovl_16u_16u))
+ return 0;
+
+ /* Examine overload candidates in order, and return the first one
+ that matches. For this scheme to work, overload candidates must
+ be ordered from most to least type-specific. */
+ do
+ {
+ switch (info->flags & pim_ovl_MASK)
+ {
+
+#define OVL_MATCH(EXPR) if (EXPR) return info; break
+
+ case pim_ovl_16:
+ OVL_MATCH (TYPE_MODE (t1) == V16QImode);
+
+ case pim_ovl_16u:
+ OVL_MATCH (TYPE_MODE (t1) == V16QImode && TYPE_UNSIGNED (t1));
+
+ case pim_ovl_8:
+ OVL_MATCH (TYPE_MODE (t1) == V8HImode);
+
+ case pim_ovl_8u:
+ OVL_MATCH (TYPE_MODE (t1) == V8HImode && TYPE_UNSIGNED (t1));
+
+ case pim_ovl_8p:
+ OVL_MATCH (t1 == pixel_V8HI_type_node);
+
+ case pim_ovl_4:
+ OVL_MATCH (TYPE_MODE (t1) == V4SImode || TYPE_MODE (t1) == V4SFmode);
+
+ case pim_ovl_4u:
+ OVL_MATCH (TYPE_MODE (t1) == V4SImode && TYPE_UNSIGNED (t1));
+
+ case pim_ovl_4f:
+ OVL_MATCH (TYPE_MODE (t1) == V4SFmode);
+
+ case pim_ovl_16u_16u:
+ OVL_MATCH (t1 == unsigned_V16QI_type_node
+ || t2 == unsigned_V16QI_type_node);
+
+ case pim_ovl_8u_8u:
+ OVL_MATCH (t1 == unsigned_V8HI_type_node
+ || t1 == pixel_V8HI_type_node
+ || t2 == unsigned_V8HI_type_node
+ || t2 == pixel_V8HI_type_node);
+
+ case pim_ovl_4u_4u:
+ OVL_MATCH (t1 == unsigned_V4SI_type_node
+ || t2 == unsigned_V4SI_type_node);
+
+ case pim_ovl_pqi_2:
+ OVL_MATCH (TREE_CODE (t2) == POINTER_TYPE
+ && (TYPE_MODE (TREE_TYPE (t2)) == QImode
+ || TYPE_MODE (TREE_TYPE (t2)) == V16QImode));
+
+ case pim_ovl_phi_2:
+ OVL_MATCH (TREE_CODE (t2) == POINTER_TYPE
+ && (TYPE_MODE (TREE_TYPE (t2)) == HImode
+ || TYPE_MODE (TREE_TYPE (t2)) == V8HImode));
+
+ case pim_ovl_psi_2:
+ OVL_MATCH (TREE_CODE (t2) == POINTER_TYPE
+ && (TYPE_MODE (TREE_TYPE (t2)) == SImode
+ || TYPE_MODE (TREE_TYPE (t2)) == V4SImode
+ || TYPE_MODE (TREE_TYPE (t2)) == SFmode
+ || TYPE_MODE (TREE_TYPE (t2)) == V4SFmode));
+
+ default: /* Catch-all. */
+ return info;
+
+#undef OVL_MATCH
+ }
+ }
+ while (!((++info)->flags & pim_group)); /* Advance to next candidate. */
+
+ return NULL; /* No suitable overload candidate found. */
+}
+
+/* Convert each function argument in the ARGS list into a corresponding
+ type found in the TYPES list. This must be done before calling the
+ __builtin_... AltiVec instructions, whose declared argument types may differ
+ from what was passed to rs6000_fold_builtin(). */
+
+static tree
+altivec_convert_args (tree types, tree args)
+{
+ tree t, a;
+
+ for (t = types, a = args; t && a; t = TREE_CHAIN (t), a = TREE_CHAIN (a))
+ {
+ TREE_VALUE (a) = convert (TREE_VALUE (t), TREE_VALUE (a));
+
+ /* Suppress overflows, so that GIMPLE does not create temporary
+ variables on us. */
+ if (TREE_CODE (TREE_VALUE (a)) == INTEGER_CST)
+ {
+ TREE_OVERFLOW (TREE_VALUE (a)) = 0;
+ TREE_CONSTANT_OVERFLOW (TREE_VALUE (a)) = 0;
+ }
+ }
+
+ return args;
+}
+
+/* The following function rewrites EXP by substituting AltiVec PIM operations
+ or predicates with built-in instructions defined above. Type casts are
+ provided if needed. */
+
+tree
+rs6000_fold_builtin (tree exp, bool ARG_UNUSED (ignore))
+{
+ tree fndecl, arglist, rettype;
+ tree typ1 = NULL_TREE, typ2 = NULL_TREE;
+ int fcode, ovl_error = 0;
+ struct altivec_pim_info *info;
+
+ /* Bail out if not in Apple AltiVec mode. */
+ if (!rs6000_altivec_pim)
+ return NULL_TREE;
+
+ fndecl = get_callee_fndecl (exp);
+ fcode = DECL_FUNCTION_CODE (fndecl);
+
+ /* Bail out unless we are looking at one of the AltiVec PIM
+ operations/predicates. */
+
+ if (fcode < ALTIVEC_PIM__FIRST || fcode > ALTIVEC_PIM__LAST)
+ return NULL_TREE;
+
+ /* Point at the first (and possibly only) entry in ALTIVEC_PIM_TABLE
+ describing this PIM operation/predicate, and how to convert it to
+ a __builtin_... call. */
+
+ info = altivec_pim_table + (fcode - ALTIVEC_PIM__FIRST);
+
+ /* Separate out the argument types for further analysis. */
+
+ arglist = TREE_OPERAND (exp, 1);
+
+ if (arglist)
+ typ1 = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_VALUE (arglist)));
+
+ if (arglist && TREE_CHAIN (arglist))
+ typ2 = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arglist))));
+
+ /* Select from a list of overloaded functions, if needed. */
+
+ if (info->flags & pim_ovl_MASK)
+ {
+ info = altivec_ovl_resolve (info, typ1, typ2);
+
+ if (!info)
+ {
+ /* No suitable overload candidate was found! */
+ ovl_error = 1; /* We use this to indicate error. */
+ /* Point at the first overload candidate again. */
+ info = altivec_pim_table + (fcode - ALTIVEC_PIM__FIRST);
+ }
+ }
+
+ /* Determine the return type. */
+
+ switch (info->flags & pim_rt_MASK)
+ {
+ case pim_rt_12:
+ /* Return type is covariant with the first two arguments. */
+ rettype = altivec_cov_rt_12 (typ1, typ2);
+ break;
+
+ /* Return type is covariant with pointee of second argument. */
+ case pim_rt_2p:
+ rettype = altivec_cov_rt_2p (typ2);
+ break;
+
+ /* Return type is covariant with the first argument only. */
+ case pim_rt_1:
+ rettype = typ1;
+ break;
+
+ /* Return type is covariant with first argument, but with doubled
+ vector element sizes. */
+ case pim_rt_1d:
+ rettype = altivec_cov_rt_1d (typ1);
+ break;
+
+ /* Return type is covariant with first argument, but with halved
+ vector element sizes. */
+ case pim_rt_1h:
+ rettype = altivec_cov_rt_1h (typ1);
+ break;
+
+ default:
+ /* Retrieve return type to use from ALTIVEC_PIM_TABLE. */
+ rettype = info->rettype;
+ }
+
+ /* Rearrange arguments, as needed. */
+
+ switch (info->flags & pim_manip_MASK)
+ {
+ case pim_manip_swap:
+ if (!typ1 || !typ2)
+ rettype = NULL_TREE;
+ else
+ {
+ tree swap = TREE_VALUE (arglist);
+
+ TREE_VALUE (arglist) = TREE_VALUE (TREE_CHAIN (arglist));
+ TREE_VALUE (TREE_CHAIN (arglist)) = swap;
+ }
+
+ break;
+
+ case pim_manip_dup:
+ if (!typ1 || typ2)
+ rettype = NULL_TREE;
+ else
+ TREE_CHAIN (arglist) = tree_cons (NULL_TREE, TREE_VALUE (arglist),
+ NULL_TREE);
+
+ break;
+ }
+
+ /* For predicates, prepend the proper CR6 value to the argument list. */
+
+ if (fcode >= ALTIVEC_PIM_VEC_ALL_EQ)
+ arglist = tree_cons (NULL_TREE,
+ build_int_cst (NULL_TREE, info->flags & pim_cr6_MASK),
+ arglist);
+
+ /* If we could not properly determine an overload candidate or a return type,
+ issue an error. */
+
+ if (ovl_error || !rettype)
+ {
+ error ("invalid argument(s) for AltiVec operation or predicate");
+ /* Choose the return type for the first overload candidate, if
+ a type has been provided. Otherwise, use 'vector signed int'. */
+ rettype = info->rettype ? info->rettype : V4SI_type_node;
+ }
+
+ /* Retrieve the underlying AltiVec __builtin_... to call, and call it. */
+
+ fndecl = vector_builtin_fns [info->insn];
+ arglist = altivec_convert_args (TYPE_ARG_TYPES (TREE_TYPE (fndecl)),
+ arglist);
+
+ return convert (rettype, build_function_call_expr (fndecl, arglist));
+}
+/* APPLE LOCAL end AltiVec */
+
static rtx
rs6000_expand_unop_builtin (enum insn_code icode, tree arglist, rtx target)
{
@@ -7924,6 +8909,12 @@ rs6000_init_builtins (void)
altivec_init_builtins ();
if (TARGET_ALTIVEC || TARGET_SPE)
rs6000_common_init_builtins ();
+
+ /* APPLE LOCAL begin constant cfstrings */
+#ifdef SUBTARGET_INIT_BUILTINS
+ SUBTARGET_INIT_BUILTINS;
+#endif
+ /* APPLE LOCAL end constant cfstrings */
}
/* Search through a set of builtins and enable the mask bits.
@@ -8392,6 +9383,716 @@ altivec_init_builtins (void)
/* Record the decl. Will be used by rs6000_builtin_mask_for_load. */
altivec_builtin_mask_for_load = decl;
}
+
+ /* APPLE LOCAL begin AltiVec */
+ /* If Apple AltiVec is enabled, we need to define additional builtins
+ in lieu of what <altivec.h> provides for FSF AltiVec. */
+ if (rs6000_altivec_pim)
+ {
+ tree int_ftype_ellipsis = build_function_type (integer_type_node,
+ NULL_TREE);
+ int pim_code = ALTIVEC_PIM__FIRST;
+
+ /* NB: For overloaded operations/predicates, the pim_... flags specify
+ how to match up the argument types and how to determine the
+ return type, if necessary; the rs6000_fold_builtin() routine
+ does all this. */
+
+ /* PIM Operations. */
+
+ gcc_assert (pim_code == ALTIVEC_PIM_VEC_ABS);
+
+ def_pim_builtin ("vec_abs", V16QI_type_node, ABS_V16QI, pim_ovl_16 | pim_group);
+ def_pim_builtin ("vec_abs.2", V8HI_type_node, ABS_V8HI, pim_ovl_8);
+ def_pim_builtin ("vec_abs.3", V4SF_type_node, ABS_V4SF, pim_ovl_4f);
+ def_pim_builtin ("vec_abs.4", V4SI_type_node, ABS_V4SI, pim_ovl_4);
+
+ def_pim_builtin ("vec_abss", V16QI_type_node, ABSS_V16QI, pim_ovl_16 | pim_group);
+ def_pim_builtin ("vec_abss.2", V8HI_type_node, ABSS_V8HI, pim_ovl_8);
+ def_pim_builtin ("vec_abss.3", V4SI_type_node, ABSS_V4SI, pim_ovl_4);
+
+ def_pim_builtin ("vec_add", NULL_TREE, VADDUBM, pim_ovl_16 | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_add.2", NULL_TREE, VADDUHM, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_add.3", V4SF_type_node, VADDFP, pim_ovl_4f);
+ def_pim_builtin ("vec_add.4", NULL_TREE, VADDUWM, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_addc", unsigned_V4SI_type_node, VADDCUW, pim_group);
+
+ def_pim_builtin ("vec_adds", NULL_TREE, VADDUBS, pim_ovl_16u_16u | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_adds.2", NULL_TREE, VADDSBS, pim_ovl_16 | pim_rt_12);
+ def_pim_builtin ("vec_adds.3", NULL_TREE, VADDUHS, pim_ovl_8u_8u | pim_rt_12);
+ def_pim_builtin ("vec_adds.4", NULL_TREE, VADDSHS, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_adds.5", NULL_TREE, VADDUWS, pim_ovl_4u_4u | pim_rt_12);
+ def_pim_builtin ("vec_adds.6", NULL_TREE, VADDSWS, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_and", NULL_TREE, VAND, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_andc", NULL_TREE, VANDC, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_avg", NULL_TREE, VAVGUB, pim_ovl_16u | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_avg.2", NULL_TREE, VAVGSB, pim_ovl_16 | pim_rt_12);
+ def_pim_builtin ("vec_avg.3", NULL_TREE, VAVGUH, pim_ovl_8u | pim_rt_12);
+ def_pim_builtin ("vec_avg.4", NULL_TREE, VAVGSH, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_avg.5", NULL_TREE, VAVGUW, pim_ovl_4u | pim_rt_12);
+ def_pim_builtin ("vec_avg.6", NULL_TREE, VAVGSW, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_ceil", V4SF_type_node, VRFIP, pim_group);
+
+ def_pim_builtin ("vec_cmpb", V4SI_type_node, VCMPBFP, pim_group);
+
+ def_pim_builtin ("vec_cmpeq", bool_V16QI_type_node, VCMPEQUB, pim_ovl_16 | pim_group);
+ def_pim_builtin ("vec_cmpeq.2", bool_V8HI_type_node, VCMPEQUH, pim_ovl_8);
+ def_pim_builtin ("vec_cmpeq.3", bool_V4SI_type_node, VCMPEQFP, pim_ovl_4f);
+ def_pim_builtin ("vec_cmpeq.4", bool_V4SI_type_node, VCMPEQUW, pim_ovl_4);
+
+ def_pim_builtin ("vec_cmpge", bool_V4SI_type_node, VCMPGEFP, pim_group);
+
+ def_pim_builtin ("vec_cmpgt", bool_V16QI_type_node, VCMPGTUB, pim_ovl_16u | pim_group);
+ def_pim_builtin ("vec_cmpgt.2", bool_V16QI_type_node, VCMPGTSB, pim_ovl_16);
+ def_pim_builtin ("vec_cmpgt.3", bool_V8HI_type_node, VCMPGTUH, pim_ovl_8u);
+ def_pim_builtin ("vec_cmpgt.4", bool_V8HI_type_node, VCMPGTSH, pim_ovl_8);
+ def_pim_builtin ("vec_cmpgt.5", bool_V4SI_type_node, VCMPGTFP, pim_ovl_4f);
+ def_pim_builtin ("vec_cmpgt.6", bool_V4SI_type_node, VCMPGTUW, pim_ovl_4u);
+ def_pim_builtin ("vec_cmpgt.7", bool_V4SI_type_node, VCMPGTSW, pim_ovl_4);
+
+ def_pim_builtin ("vec_cmple", bool_V4SI_type_node, VCMPGEFP, pim_manip_swap | pim_group);
+
+ def_pim_builtin ("vec_cmplt", bool_V16QI_type_node, VCMPGTUB, pim_ovl_16u | pim_manip_swap | pim_group);
+ def_pim_builtin ("vec_cmplt.2", bool_V16QI_type_node, VCMPGTSB, pim_ovl_16 | pim_manip_swap);
+ def_pim_builtin ("vec_cmplt.3", bool_V8HI_type_node, VCMPGTUH, pim_ovl_8u | pim_manip_swap);
+ def_pim_builtin ("vec_cmplt.4", bool_V8HI_type_node, VCMPGTSH, pim_ovl_8 | pim_manip_swap);
+ def_pim_builtin ("vec_cmplt.5", bool_V4SI_type_node, VCMPGTFP, pim_ovl_4f | pim_manip_swap);
+ def_pim_builtin ("vec_cmplt.6", bool_V4SI_type_node, VCMPGTUW, pim_ovl_4u | pim_manip_swap);
+ def_pim_builtin ("vec_cmplt.7", bool_V4SI_type_node, VCMPGTSW, pim_ovl_4 | pim_manip_swap);
+
+ def_pim_builtin ("vec_ctf", V4SF_type_node, VCFUX, pim_ovl_4u | pim_group);
+ def_pim_builtin ("vec_ctf.2", V4SF_type_node, VCFSX, pim_ovl_4);
+
+ def_pim_builtin ("vec_cts", V4SI_type_node, VCTSXS, pim_ovl_4f | pim_group);
+
+ def_pim_builtin ("vec_ctu", unsigned_V4SI_type_node, VCTUXS, pim_ovl_4f | pim_group);
+
+ def_pim_builtin ("vec_dss", void_type_node, DSS, pim_group);
+
+ def_pim_builtin ("vec_dssall", void_type_node, DSSALL, pim_group);
+
+ def_pim_builtin ("vec_dst", void_type_node, DST, pim_group);
+
+ def_pim_builtin ("vec_dstst", void_type_node, DSTST, pim_group);
+
+ def_pim_builtin ("vec_dststt", void_type_node, DSTSTT, pim_group);
+
+ def_pim_builtin ("vec_dstt", void_type_node, DSTT, pim_group);
+
+ def_pim_builtin ("vec_expte", V4SF_type_node, VEXPTEFP, pim_group);
+
+ def_pim_builtin ("vec_floor", V4SF_type_node, VRFIM, pim_group);
+
+ def_pim_builtin ("vec_ld", NULL_TREE, LVX, pim_rt_2p | pim_group);
+
+ def_pim_builtin ("vec_lde", NULL_TREE, LVEBX, pim_ovl_pqi_2 | pim_rt_2p | pim_group);
+ def_pim_builtin ("vec_lde.2", NULL_TREE, LVEHX, pim_ovl_phi_2 | pim_rt_2p);
+ def_pim_builtin ("vec_lde.3", NULL_TREE, LVEWX, pim_ovl_psi_2 | pim_rt_2p);
+
+ def_pim_builtin ("vec_ldl", NULL_TREE, LVXL, pim_rt_2p | pim_group);
+
+ def_pim_builtin ("vec_loge", V4SF_type_node, VLOGEFP, pim_group);
+
+ def_pim_builtin ("vec_lvebx", NULL_TREE, LVEBX, pim_rt_2p | pim_group);
+ def_pim_builtin ("vec_lvehx", NULL_TREE, LVEHX, pim_rt_2p | pim_group);
+ def_pim_builtin ("vec_lvewx", NULL_TREE, LVEWX, pim_rt_2p | pim_group);
+
+ def_pim_builtin ("vec_lvsl", unsigned_V16QI_type_node, LVSL, pim_group);
+
+ def_pim_builtin ("vec_lvsr", unsigned_V16QI_type_node, LVSR, pim_group);
+
+ def_pim_builtin ("vec_lvx", NULL_TREE, LVX, pim_rt_2p | pim_group);
+
+ def_pim_builtin ("vec_lvxl", NULL_TREE, LVXL, pim_rt_2p | pim_group);
+
+ def_pim_builtin ("vec_madd", V4SF_type_node, VMADDFP, pim_group);
+
+ def_pim_builtin ("vec_madds", V8HI_type_node, VMHADDSHS, pim_group);
+
+ def_pim_builtin ("vec_max", NULL_TREE, VMAXUB, pim_ovl_16u_16u | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_max.2", NULL_TREE, VMAXSB, pim_ovl_16 | pim_rt_12);
+ def_pim_builtin ("vec_max.3", NULL_TREE, VMAXUH, pim_ovl_8u_8u | pim_rt_12);
+ def_pim_builtin ("vec_max.4", NULL_TREE, VMAXSH, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_max.5", NULL_TREE, VMAXFP, pim_ovl_4f | pim_rt_12);
+ def_pim_builtin ("vec_max.6", NULL_TREE, VMAXUW, pim_ovl_4u_4u | pim_rt_12);
+ def_pim_builtin ("vec_max.7", NULL_TREE, VMAXSW, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_mergeh", NULL_TREE, VMRGHB, pim_ovl_16 | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_mergeh.2", NULL_TREE, VMRGHH, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_mergeh.3", NULL_TREE, VMRGHW, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_mergel", NULL_TREE, VMRGLB, pim_ovl_16 | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_mergel.2", NULL_TREE, VMRGLH, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_mergel.3", NULL_TREE, VMRGLW, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_mfvscr", unsigned_V8HI_type_node, MFVSCR, pim_group);
+
+ def_pim_builtin ("vec_min", NULL_TREE, VMINUB, pim_ovl_16u_16u | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_min.2", NULL_TREE, VMINSB, pim_ovl_16 | pim_rt_12);
+ def_pim_builtin ("vec_min.3", NULL_TREE, VMINUH, pim_ovl_8u_8u | pim_rt_12);
+ def_pim_builtin ("vec_min.4", NULL_TREE, VMINSH, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_min.5", NULL_TREE, VMINFP, pim_ovl_4f | pim_rt_12);
+ def_pim_builtin ("vec_min.6", NULL_TREE, VMINUW, pim_ovl_4u_4u | pim_rt_12);
+ def_pim_builtin ("vec_min.7", NULL_TREE, VMINSW, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_mladd", unsigned_V8HI_type_node, VMLADDUHM, pim_ovl_8u_8u | pim_group);
+ def_pim_builtin ("vec_mladd.2", V8HI_type_node, VMLADDUHM, pim_ovl_8);
+
+ def_pim_builtin ("vec_mradds", V8HI_type_node, VMHRADDSHS, pim_group);
+
+ def_pim_builtin ("vec_msum", unsigned_V4SI_type_node, VMSUMUBM, pim_ovl_16u | pim_group);
+ def_pim_builtin ("vec_msum.2", V4SI_type_node, VMSUMMBM, pim_ovl_16);
+ def_pim_builtin ("vec_msum.3", unsigned_V4SI_type_node, VMSUMUHM, pim_ovl_8u);
+ def_pim_builtin ("vec_msum.4", V4SI_type_node, VMSUMSHM, pim_ovl_8);
+
+ def_pim_builtin ("vec_msums", unsigned_V4SI_type_node, VMSUMUHS, pim_ovl_8u | pim_group);
+ def_pim_builtin ("vec_msums.2", V4SI_type_node, VMSUMSHS, pim_ovl_8);
+
+ def_pim_builtin ("vec_mtvscr", void_type_node, MTVSCR, pim_group);
+
+ def_pim_builtin ("vec_mule", unsigned_V8HI_type_node, VMULEUB, pim_ovl_16u | pim_group);
+ def_pim_builtin ("vec_mule.2", V8HI_type_node, VMULESB, pim_ovl_16);
+ def_pim_builtin ("vec_mule.3", unsigned_V4SI_type_node, VMULEUH, pim_ovl_8u);
+ def_pim_builtin ("vec_mule.4", V4SI_type_node, VMULESH, pim_ovl_8);
+
+ def_pim_builtin ("vec_mulo", unsigned_V8HI_type_node, VMULOUB, pim_ovl_16u | pim_group);
+ def_pim_builtin ("vec_mulo.2", V8HI_type_node, VMULOSB, pim_ovl_16);
+ def_pim_builtin ("vec_mulo.3", unsigned_V4SI_type_node, VMULOUH, pim_ovl_8u);
+ def_pim_builtin ("vec_mulo.4", V4SI_type_node, VMULOSH, pim_ovl_8);
+
+ def_pim_builtin ("vec_nmsub", V4SF_type_node, VNMSUBFP, pim_group);
+
+ def_pim_builtin ("vec_nor", NULL_TREE, VNOR, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_or", NULL_TREE, VOR, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_pack", NULL_TREE, VPKUHUM, pim_ovl_8 | pim_rt_1h | pim_group);
+ def_pim_builtin ("vec_pack.2", NULL_TREE, VPKUWUM, pim_ovl_4 | pim_rt_1h);
+
+ def_pim_builtin ("vec_packpx", pixel_V8HI_type_node, VPKPX, pim_group);
+
+ def_pim_builtin ("vec_packs", unsigned_V16QI_type_node, VPKUHUS, pim_ovl_8u | pim_group);
+ def_pim_builtin ("vec_packs.2", V16QI_type_node, VPKSHSS, pim_ovl_8);
+ def_pim_builtin ("vec_packs.3", unsigned_V8HI_type_node, VPKUWUS, pim_ovl_4u);
+ def_pim_builtin ("vec_packs.4", V8HI_type_node, VPKSWSS, pim_ovl_4);
+
+ def_pim_builtin ("vec_packsu", unsigned_V16QI_type_node, VPKUHUS, pim_ovl_8u | pim_group);
+ def_pim_builtin ("vec_packsu.2", unsigned_V16QI_type_node, VPKSHUS, pim_ovl_8);
+ def_pim_builtin ("vec_packsu.3", unsigned_V8HI_type_node, VPKUWUS, pim_ovl_4u);
+ def_pim_builtin ("vec_packsu.4", unsigned_V8HI_type_node, VPKSWUS, pim_ovl_4);
+
+ def_pim_builtin ("vec_perm", V16QI_type_node, VPERM_4SI, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_re", V4SF_type_node, VREFP, pim_group);
+
+ def_pim_builtin ("vec_rl", NULL_TREE, VRLB, pim_ovl_16 | pim_rt_1 | pim_group);
+ def_pim_builtin ("vec_rl.2", NULL_TREE, VRLH, pim_ovl_8 | pim_rt_1);
+ def_pim_builtin ("vec_rl.3", NULL_TREE, VRLW, pim_ovl_4 | pim_rt_1);
+
+ def_pim_builtin ("vec_round", V4SF_type_node, VRFIN, pim_group);
+
+ def_pim_builtin ("vec_rsqrte", V4SF_type_node, VRSQRTEFP, pim_group);
+
+ def_pim_builtin ("vec_sel", NULL_TREE, VSEL_4SI, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_sl", NULL_TREE, VSLB, pim_ovl_16 | pim_rt_1 | pim_group);
+ def_pim_builtin ("vec_sl.2", NULL_TREE, VSLH, pim_ovl_8 | pim_rt_1);
+ def_pim_builtin ("vec_sl.3", NULL_TREE, VSLW, pim_ovl_4 | pim_rt_1);
+
+ def_pim_builtin ("vec_sld", NULL_TREE, VSLDOI_4SI, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_sll", NULL_TREE, VSL, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_slo", NULL_TREE, VSLO, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_splat", NULL_TREE, VSPLTB, pim_ovl_16 | pim_rt_1 | pim_group);
+ def_pim_builtin ("vec_splat.2", NULL_TREE, VSPLTH, pim_ovl_8 | pim_rt_1);
+ def_pim_builtin ("vec_splat.3", NULL_TREE, VSPLTW, pim_ovl_4 | pim_rt_1);
+
+ def_pim_builtin ("vec_splat_s8", V16QI_type_node, VSPLTISB, pim_group);
+
+ def_pim_builtin ("vec_splat_s16", V8HI_type_node, VSPLTISH, pim_group);
+
+ def_pim_builtin ("vec_splat_s32", V4SI_type_node, VSPLTISW, pim_group);
+
+ def_pim_builtin ("vec_splat_u8", unsigned_V16QI_type_node, VSPLTISB, pim_group);
+
+ def_pim_builtin ("vec_splat_u16", unsigned_V8HI_type_node, VSPLTISH, pim_group);
+
+ def_pim_builtin ("vec_splat_u32", unsigned_V4SI_type_node, VSPLTISW, pim_group);
+
+ def_pim_builtin ("vec_sr", NULL_TREE, VSRB, pim_ovl_16 | pim_rt_1 | pim_group);
+ def_pim_builtin ("vec_sr.2", NULL_TREE, VSRH, pim_ovl_8 | pim_rt_1);
+ def_pim_builtin ("vec_sr.3", NULL_TREE, VSRW, pim_ovl_4 | pim_rt_1);
+
+ def_pim_builtin ("vec_sra", NULL_TREE, VSRAB, pim_ovl_16 | pim_rt_1 | pim_group);
+ def_pim_builtin ("vec_sra.2", NULL_TREE, VSRAH, pim_ovl_8 | pim_rt_1);
+ def_pim_builtin ("vec_sra.3", NULL_TREE, VSRAW, pim_ovl_4 | pim_rt_1);
+
+ def_pim_builtin ("vec_srl", NULL_TREE, VSR, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_sro", NULL_TREE, VSRO, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_st", void_type_node, STVX, pim_group);
+
+ def_pim_builtin ("vec_ste", void_type_node, STVEBX, pim_ovl_16 | pim_group);
+ def_pim_builtin ("vec_ste.2", void_type_node, STVEHX, pim_ovl_8);
+ def_pim_builtin ("vec_ste.3", void_type_node, STVEWX, pim_ovl_4);
+
+ def_pim_builtin ("vec_stl", void_type_node, STVXL, pim_group);
+
+ def_pim_builtin ("vec_stvebx", void_type_node, STVEBX, pim_group);
+ def_pim_builtin ("vec_stvehx", void_type_node, STVEHX, pim_group);
+ def_pim_builtin ("vec_stvewx", void_type_node, STVEWX, pim_group);
+
+ def_pim_builtin ("vec_stvx", void_type_node, STVX, pim_group);
+
+ def_pim_builtin ("vec_stvxl", void_type_node, STVXL, pim_group);
+
+ def_pim_builtin ("vec_sub", NULL_TREE, VSUBUBM, pim_ovl_16 | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_sub.2", NULL_TREE, VSUBUHM, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_sub.3", NULL_TREE, VSUBFP, pim_ovl_4f | pim_rt_12);
+ def_pim_builtin ("vec_sub.4", NULL_TREE, VSUBUWM, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_subc", unsigned_V4SI_type_node, VSUBCUW, pim_group);
+
+ def_pim_builtin ("vec_subs", NULL_TREE, VSUBUBS, pim_ovl_16u_16u | pim_rt_12 | pim_group);
+ def_pim_builtin ("vec_subs.2", NULL_TREE, VSUBSBS, pim_ovl_16 | pim_rt_12);
+ def_pim_builtin ("vec_subs.3", NULL_TREE, VSUBUHS, pim_ovl_8u_8u | pim_rt_12);
+ def_pim_builtin ("vec_subs.4", NULL_TREE, VSUBSHS, pim_ovl_8 | pim_rt_12);
+ def_pim_builtin ("vec_subs.5", NULL_TREE, VSUBUWS, pim_ovl_4u_4u | pim_rt_12);
+ def_pim_builtin ("vec_subs.6", NULL_TREE, VSUBSWS, pim_ovl_4 | pim_rt_12);
+
+ def_pim_builtin ("vec_sum4s", unsigned_V4SI_type_node, VSUM4UBS, pim_ovl_16u | pim_group);
+ def_pim_builtin ("vec_sum4s.2", V4SI_type_node, VSUM4SBS, pim_ovl_16);
+ def_pim_builtin ("vec_sum4s.3", V4SI_type_node, VSUM4SHS, pim_ovl_8);
+
+ def_pim_builtin ("vec_sum2s", V4SI_type_node, VSUM2SWS, pim_group);
+
+ def_pim_builtin ("vec_sums", V4SI_type_node, VSUMSWS, pim_group);
+
+ def_pim_builtin ("vec_trunc", V4SF_type_node, VRFIZ, pim_group);
+
+ def_pim_builtin ("vec_unpackh", NULL_TREE, VUPKHSB, pim_ovl_16 | pim_rt_1d | pim_group);
+ def_pim_builtin ("vec_unpackh.2", NULL_TREE, VUPKHPX, pim_ovl_8p | pim_rt_1d);
+ def_pim_builtin ("vec_unpackh.3", NULL_TREE, VUPKHSH, pim_ovl_8 | pim_rt_1d);
+
+ def_pim_builtin ("vec_unpackl", NULL_TREE, VUPKLSB, pim_ovl_16 | pim_rt_1d | pim_group);
+ def_pim_builtin ("vec_unpackl.2", NULL_TREE, VUPKLPX, pim_ovl_8p | pim_rt_1d);
+ def_pim_builtin ("vec_unpackl.3", NULL_TREE, VUPKLSH, pim_ovl_8 | pim_rt_1d);
+
+ gcc_assert (pim_code == ALTIVEC_PIM_VEC_VADDCUW);
+
+ def_pim_builtin ("vec_vaddcuw", unsigned_V4SI_type_node, VADDCUW, pim_group);
+
+ def_pim_builtin ("vec_vaddfp", V4SF_type_node, VADDFP, pim_group);
+
+ def_pim_builtin ("vec_vaddsbs", NULL_TREE, VADDSBS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vaddshs", NULL_TREE, VADDSHS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vaddsws", NULL_TREE, VADDSWS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vaddubm", NULL_TREE, VADDUBM, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vaddubs", NULL_TREE, VADDUBS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vadduhm", NULL_TREE, VADDUHM, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vadduhs", NULL_TREE, VADDUHS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vadduwm", NULL_TREE, VADDUWM, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vadduws", NULL_TREE, VADDUWS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vand", NULL_TREE, VAND, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vandc", NULL_TREE, VANDC, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vavgsb", NULL_TREE, VAVGSB, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vavgsh", NULL_TREE, VAVGSH, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vavgsw", NULL_TREE, VAVGSW, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vavgub", NULL_TREE, VAVGUB, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vavguh", NULL_TREE, VAVGUH, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vavguw", NULL_TREE, VAVGUW, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vcfsx", V4SF_type_node, VCFSX, pim_group);
+
+ def_pim_builtin ("vec_vcfux", V4SF_type_node, VCFUX, pim_group);
+
+ def_pim_builtin ("vec_vcmpbfp", V4SI_type_node, VCMPBFP, pim_group);
+
+ def_pim_builtin ("vec_vcmpeqfp", bool_V4SI_type_node, VCMPEQFP, pim_group);
+
+ def_pim_builtin ("vec_vcmpequb", bool_V16QI_type_node, VCMPEQUB, pim_group);
+
+ def_pim_builtin ("vec_vcmpequh", bool_V8HI_type_node, VCMPEQUH, pim_group);
+
+ def_pim_builtin ("vec_vcmpequw", bool_V4SI_type_node, VCMPEQUW, pim_group);
+
+ def_pim_builtin ("vec_vcmpgefp", bool_V4SI_type_node, VCMPGEFP, pim_group);
+
+ def_pim_builtin ("vec_vcmpgtfp", bool_V4SI_type_node, VCMPGTFP, pim_group);
+
+ def_pim_builtin ("vec_vcmpgtsb", bool_V16QI_type_node, VCMPGTSB, pim_group);
+
+ def_pim_builtin ("vec_vcmpgtsh", bool_V8HI_type_node, VCMPGTSH, pim_group);
+
+ def_pim_builtin ("vec_vcmpgtsw", bool_V4SI_type_node, VCMPGTSW, pim_group);
+
+ def_pim_builtin ("vec_vcmpgtub", bool_V16QI_type_node, VCMPGTUB, pim_group);
+
+ def_pim_builtin ("vec_vcmpgtuh", bool_V8HI_type_node, VCMPGTUH, pim_group);
+
+ def_pim_builtin ("vec_vcmpgtuw", bool_V4SI_type_node, VCMPGTUW, pim_group);
+
+ def_pim_builtin ("vec_vctsxs", V4SI_type_node, VCTSXS, pim_group);
+
+ def_pim_builtin ("vec_vctuxs", unsigned_V4SI_type_node, VCTUXS, pim_group);
+
+ def_pim_builtin ("vec_vexptefp", V4SF_type_node, VEXPTEFP, pim_group);
+
+ def_pim_builtin ("vec_vlogefp", V4SF_type_node, VLOGEFP, pim_group);
+
+ def_pim_builtin ("vec_vmaddfp", V4SF_type_node, VMADDFP, pim_group);
+
+ def_pim_builtin ("vec_vmaxfp", NULL_TREE, VMAXFP, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmaxsb", NULL_TREE, VMAXSB, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmaxsh", NULL_TREE, VMAXSH, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmaxsw", NULL_TREE, VMAXSW, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmaxub", NULL_TREE, VMAXUB, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmaxuh", NULL_TREE, VMAXUH, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmaxuw", NULL_TREE, VMAXUW, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmhaddshs", V8HI_type_node, VMHADDSHS, pim_group);
+
+ def_pim_builtin ("vec_vmhraddshs", V8HI_type_node, VMHRADDSHS, pim_group);
+
+ def_pim_builtin ("vec_vminfp", NULL_TREE, VMINFP, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vminsb", NULL_TREE, VMINSB, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vminsh", NULL_TREE, VMINSH, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vminsw", NULL_TREE, VMINSW, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vminub", NULL_TREE, VMINUB, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vminuh", NULL_TREE, VMINUH, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vminuw", NULL_TREE, VMINUW, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmladduhm", NULL_TREE, VMLADDUHM, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmrghb", NULL_TREE, VMRGHB, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmrghh", NULL_TREE, VMRGHH, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmrghw", NULL_TREE, VMRGHW, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmrglb", NULL_TREE, VMRGLB, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmrglh", NULL_TREE, VMRGLH, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmrglw", NULL_TREE, VMRGLW, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vmsummbm", V4SI_type_node, VMSUMMBM, pim_group);
+
+ def_pim_builtin ("vec_vmsumshm", V4SI_type_node, VMSUMSHM, pim_group);
+
+ def_pim_builtin ("vec_vmsumshs", V4SI_type_node, VMSUMSHS, pim_group);
+
+ def_pim_builtin ("vec_vmsumubm", unsigned_V4SI_type_node, VMSUMUBM, pim_group);
+
+ def_pim_builtin ("vec_vmsumuhm", unsigned_V4SI_type_node, VMSUMUHM, pim_group);
+
+ def_pim_builtin ("vec_vmsumuhs", unsigned_V4SI_type_node, VMSUMUHS, pim_group);
+
+ def_pim_builtin ("vec_vmulesb", V8HI_type_node, VMULESB, pim_group);
+
+ def_pim_builtin ("vec_vmulesh", V4SI_type_node, VMULESH, pim_group);
+
+ def_pim_builtin ("vec_vmuleub", unsigned_V8HI_type_node, VMULEUB, pim_group);
+
+ def_pim_builtin ("vec_vmuleuh", unsigned_V4SI_type_node, VMULEUH, pim_group);
+
+ def_pim_builtin ("vec_vmulosb", V8HI_type_node, VMULOSB, pim_group);
+
+ def_pim_builtin ("vec_vmulosh", V4SI_type_node, VMULOSH, pim_group);
+
+ def_pim_builtin ("vec_vmuloub", unsigned_V8HI_type_node, VMULOUB, pim_group);
+
+ def_pim_builtin ("vec_vmulouh", unsigned_V4SI_type_node, VMULOUH, pim_group);
+
+ def_pim_builtin ("vec_vnmsubfp", V4SF_type_node, VNMSUBFP, pim_group);
+
+ def_pim_builtin ("vec_vnor", NULL_TREE, VNOR, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vor", NULL_TREE, VOR, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vperm", V16QI_type_node, VPERM_4SI, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vpkpx", pixel_V8HI_type_node, VPKPX, pim_group);
+
+ def_pim_builtin ("vec_vpkshss", V16QI_type_node, VPKSHSS, pim_group);
+
+ def_pim_builtin ("vec_vpkshus", unsigned_V16QI_type_node, VPKSHUS, pim_group);
+
+ def_pim_builtin ("vec_vpkswss", V8HI_type_node, VPKSWSS, pim_group);
+
+ def_pim_builtin ("vec_vpkswus", unsigned_V8HI_type_node, VPKSWUS, pim_group);
+
+ def_pim_builtin ("vec_vpkuhum", NULL_TREE, VPKUHUM, pim_rt_1h | pim_group);
+
+ def_pim_builtin ("vec_vpkuhus", unsigned_V16QI_type_node, VPKUHUS, pim_group);
+
+ def_pim_builtin ("vec_vpkuwum", NULL_TREE, VPKUWUM, pim_rt_1h | pim_group);
+
+ def_pim_builtin ("vec_vpkuwus", unsigned_V8HI_type_node, VPKUWUS, pim_group);
+
+ def_pim_builtin ("vec_vrefp", V4SF_type_node, VREFP, pim_group);
+
+ def_pim_builtin ("vec_vrfim", V4SF_type_node, VRFIM, pim_group);
+
+ def_pim_builtin ("vec_vrfin", V4SF_type_node, VRFIN, pim_group);
+
+ def_pim_builtin ("vec_vrfip", V4SF_type_node, VRFIP, pim_group);
+
+ def_pim_builtin ("vec_vrfiz", V4SF_type_node, VRFIZ, pim_group);
+
+ def_pim_builtin ("vec_vrlb", NULL_TREE, VRLB, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vrlh", NULL_TREE, VRLH, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vrlw", NULL_TREE, VRLW, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vrsqrtefp", V4SF_type_node, VRSQRTEFP, pim_group);
+
+ def_pim_builtin ("vec_vsel", NULL_TREE, VSEL_4SI, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsl", NULL_TREE, VSL, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vslb", NULL_TREE, VSLB, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsldoi", NULL_TREE, VSLDOI_4SI, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vslh", NULL_TREE, VSLH, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vslo", NULL_TREE, VSLO, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vslw", NULL_TREE, VSLW, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vspltb", NULL_TREE, VSPLTB, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsplth", NULL_TREE, VSPLTH, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vspltisb", V16QI_type_node, VSPLTISB, pim_group);
+
+ def_pim_builtin ("vec_vspltish", V8HI_type_node, VSPLTISH, pim_group);
+
+ def_pim_builtin ("vec_vspltisw", V4SI_type_node, VSPLTISW, pim_group);
+
+ def_pim_builtin ("vec_vspltw", NULL_TREE, VSPLTW, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsr", NULL_TREE, VSR, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsrab", NULL_TREE, VSRAB, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsrah", NULL_TREE, VSRAH, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsraw", NULL_TREE, VSRAW, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsrb", NULL_TREE, VSRB, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsrh", NULL_TREE, VSRH, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsro", NULL_TREE, VSRO, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsrw", NULL_TREE, VSRW, pim_rt_1 | pim_group);
+
+ def_pim_builtin ("vec_vsubcuw", unsigned_V4SI_type_node, VSUBCUW, pim_group);
+
+ def_pim_builtin ("vec_vsubfp", NULL_TREE, VSUBFP, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsubsbs", NULL_TREE, VSUBSBS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsubshs", NULL_TREE, VSUBSHS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsubsws", NULL_TREE, VSUBSWS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsububm", NULL_TREE, VSUBUBM, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsububs", NULL_TREE, VSUBUBS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsubuhm", NULL_TREE, VSUBUHM, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsubuhs", NULL_TREE, VSUBUHS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsubuwm", NULL_TREE, VSUBUWM, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsubuws", NULL_TREE, VSUBUWS, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_vsum4sbs", V4SI_type_node, VSUM4SBS, pim_group);
+
+ def_pim_builtin ("vec_vsum4shs", V4SI_type_node, VSUM4SHS, pim_group);
+
+ def_pim_builtin ("vec_vsum4ubs", unsigned_V4SI_type_node, VSUM4UBS, pim_group);
+
+ def_pim_builtin ("vec_vsum2sws", V4SI_type_node, VSUM2SWS, pim_group);
+
+ def_pim_builtin ("vec_vsumsws", V4SI_type_node, VSUMSWS, pim_group);
+
+ def_pim_builtin ("vec_vupkhpx", NULL_TREE, VUPKHPX, pim_rt_1d | pim_group);
+
+ def_pim_builtin ("vec_vupkhsb", NULL_TREE, VUPKHSB, pim_rt_1d | pim_group);
+
+ def_pim_builtin ("vec_vupkhsh", NULL_TREE, VUPKHSH, pim_rt_1d | pim_group);
+
+ def_pim_builtin ("vec_vupklpx", NULL_TREE, VUPKLPX, pim_rt_1d | pim_group);
+
+ def_pim_builtin ("vec_vupklsb", NULL_TREE, VUPKLSB, pim_rt_1d | pim_group);
+
+ def_pim_builtin ("vec_vupklsh", NULL_TREE, VUPKLSH, pim_rt_1d | pim_group);
+
+ def_pim_builtin ("vec_vxor", NULL_TREE, VXOR, pim_rt_12 | pim_group);
+
+ def_pim_builtin ("vec_xor", NULL_TREE, VXOR, pim_rt_12 | pim_group);
+
+ /* PIM Predicates. */
+
+ gcc_assert (pim_code == ALTIVEC_PIM_VEC_ALL_EQ);
+
+ def_pim_builtin ("vec_all_eq", integer_type_node, VCMPEQUB_P, pim_ovl_16 | pim_cr6_lt | pim_group);
+ def_pim_builtin ("vec_all_eq.2", integer_type_node, VCMPEQUH_P, pim_ovl_8 | pim_cr6_lt);
+ def_pim_builtin ("vec_all_eq.3", integer_type_node, VCMPEQFP_P, pim_ovl_4f | pim_cr6_lt);
+ def_pim_builtin ("vec_all_eq.4", integer_type_node, VCMPEQUW_P, pim_ovl_4 | pim_cr6_lt);
+
+ def_pim_builtin ("vec_all_ge", integer_type_node, VCMPGTUB_P, pim_ovl_16u_16u | pim_manip_swap | pim_cr6_eq | pim_group);
+ def_pim_builtin ("vec_all_ge.2", integer_type_node, VCMPGTSB_P, pim_ovl_16 | pim_manip_swap | pim_cr6_eq);
+ def_pim_builtin ("vec_all_ge.3", integer_type_node, VCMPGTUH_P, pim_ovl_8u_8u | pim_manip_swap | pim_cr6_eq);
+ def_pim_builtin ("vec_all_ge.4", integer_type_node, VCMPGTSH_P, pim_ovl_8 | pim_manip_swap | pim_cr6_eq);
+ def_pim_builtin ("vec_all_ge.5", integer_type_node, VCMPGEFP_P, pim_ovl_4f | pim_cr6_lt);
+ def_pim_builtin ("vec_all_ge.6", integer_type_node, VCMPGTUW_P, pim_ovl_4u_4u | pim_manip_swap | pim_cr6_eq);
+ def_pim_builtin ("vec_all_ge.7", integer_type_node, VCMPGTSW_P, pim_ovl_4 | pim_manip_swap | pim_cr6_eq);
+
+ def_pim_builtin ("vec_all_gt", integer_type_node, VCMPGTUB_P, pim_ovl_16u_16u | pim_cr6_lt | pim_group);
+ def_pim_builtin ("vec_all_gt.2", integer_type_node, VCMPGTSB_P, pim_ovl_16 | pim_cr6_lt);
+ def_pim_builtin ("vec_all_gt.3", integer_type_node, VCMPGTUH_P, pim_ovl_8u_8u | pim_cr6_lt);
+ def_pim_builtin ("vec_all_gt.4", integer_type_node, VCMPGTSH_P, pim_ovl_8 | pim_cr6_lt);
+ def_pim_builtin ("vec_all_gt.5", integer_type_node, VCMPGTFP_P, pim_ovl_4f | pim_cr6_lt);
+ def_pim_builtin ("vec_all_gt.6", integer_type_node, VCMPGTUW_P, pim_ovl_4u_4u | pim_cr6_lt);
+ def_pim_builtin ("vec_all_gt.7", integer_type_node, VCMPGTSW_P, pim_ovl_4 | pim_cr6_lt);
+
+ def_pim_builtin ("vec_all_in", integer_type_node, VCMPBFP_P, pim_cr6_eq | pim_group);
+
+ def_pim_builtin ("vec_all_le", integer_type_node, VCMPGTUB_P, pim_ovl_16u_16u | pim_cr6_eq | pim_group);
+ def_pim_builtin ("vec_all_le.2", integer_type_node, VCMPGTSB_P, pim_ovl_16 | pim_cr6_eq);
+ def_pim_builtin ("vec_all_le.3", integer_type_node, VCMPGTUH_P, pim_ovl_8u_8u | pim_cr6_eq);
+ def_pim_builtin ("vec_all_le.4", integer_type_node, VCMPGTSH_P, pim_ovl_8 | pim_cr6_eq);
+ def_pim_builtin ("vec_all_le.5", integer_type_node, VCMPGEFP_P, pim_ovl_4f | pim_manip_swap | pim_cr6_lt);
+ def_pim_builtin ("vec_all_le.6", integer_type_node, VCMPGTUW_P, pim_ovl_4u_4u | pim_cr6_eq);
+ def_pim_builtin ("vec_all_le.7", integer_type_node, VCMPGTSW_P, pim_ovl_4 | pim_cr6_eq);
+
+ def_pim_builtin ("vec_all_lt", integer_type_node, VCMPGTUB_P, pim_ovl_16u_16u | pim_manip_swap | pim_cr6_lt | pim_group);
+ def_pim_builtin ("vec_all_lt.2", integer_type_node, VCMPGTSB_P, pim_ovl_16 | pim_manip_swap | pim_cr6_lt);
+ def_pim_builtin ("vec_all_lt.3", integer_type_node, VCMPGTUH_P, pim_ovl_8u_8u | pim_manip_swap | pim_cr6_lt);
+ def_pim_builtin ("vec_all_lt.4", integer_type_node, VCMPGTSH_P, pim_ovl_8 | pim_manip_swap | pim_cr6_lt);
+ def_pim_builtin ("vec_all_lt.5", integer_type_node, VCMPGTFP_P, pim_ovl_4f | pim_manip_swap | pim_cr6_lt);
+ def_pim_builtin ("vec_all_lt.6", integer_type_node, VCMPGTUW_P, pim_ovl_4u_4u | pim_manip_swap | pim_cr6_lt);
+ def_pim_builtin ("vec_all_lt.7", integer_type_node, VCMPGTSW_P, pim_ovl_4 | pim_manip_swap | pim_cr6_lt);
+
+ def_pim_builtin ("vec_all_nan", integer_type_node, VCMPEQFP_P, pim_manip_dup | pim_cr6_eq | pim_group);
+
+ def_pim_builtin ("vec_all_ne", integer_type_node, VCMPEQUB_P, pim_ovl_16 | pim_cr6_eq | pim_group);
+ def_pim_builtin ("vec_all_ne.2", integer_type_node, VCMPEQUH_P, pim_ovl_8 | pim_cr6_eq);
+ def_pim_builtin ("vec_all_ne.3", integer_type_node, VCMPEQFP_P, pim_ovl_4f | pim_cr6_eq);
+ def_pim_builtin ("vec_all_ne.4", integer_type_node, VCMPEQUW_P, pim_ovl_4 | pim_cr6_eq);
+
+ def_pim_builtin ("vec_all_nge", integer_type_node, VCMPGEFP_P, pim_cr6_eq | pim_group);
+
+ def_pim_builtin ("vec_all_ngt", integer_type_node, VCMPGTFP_P, pim_cr6_eq | pim_group);
+
+ def_pim_builtin ("vec_all_nle", integer_type_node, VCMPGEFP_P, pim_manip_swap | pim_cr6_eq | pim_group);
+
+ def_pim_builtin ("vec_all_nlt", integer_type_node, VCMPGEFP_P, pim_manip_swap | pim_cr6_eq | pim_group);
+
+ def_pim_builtin ("vec_all_numeric", integer_type_node, VCMPEQFP_P, pim_manip_dup | pim_cr6_lt | pim_group);
+
+ def_pim_builtin ("vec_any_eq", integer_type_node, VCMPEQUB_P, pim_ovl_16 | pim_cr6_ne | pim_group);
+ def_pim_builtin ("vec_any_eq.2", integer_type_node, VCMPEQUH_P, pim_ovl_8 | pim_cr6_ne);
+ def_pim_builtin ("vec_any_eq.3", integer_type_node, VCMPEQFP_P, pim_ovl_4f | pim_cr6_ne);
+ def_pim_builtin ("vec_any_eq.4", integer_type_node, VCMPEQUW_P, pim_ovl_4 | pim_cr6_ne);
+
+ def_pim_builtin ("vec_any_ge", integer_type_node, VCMPGTUB_P, pim_ovl_16u_16u | pim_manip_swap | pim_cr6_ge | pim_group);
+ def_pim_builtin ("vec_any_ge.2", integer_type_node, VCMPGTSB_P, pim_ovl_16 | pim_manip_swap | pim_cr6_ge);
+ def_pim_builtin ("vec_any_ge.3", integer_type_node, VCMPGTUH_P, pim_ovl_8u_8u | pim_manip_swap | pim_cr6_ge);
+ def_pim_builtin ("vec_any_ge.4", integer_type_node, VCMPGTSH_P, pim_ovl_8 | pim_manip_swap | pim_cr6_ge);
+ def_pim_builtin ("vec_any_ge.5", integer_type_node, VCMPGEFP_P, pim_ovl_4f | pim_cr6_ne);
+ def_pim_builtin ("vec_any_ge.6", integer_type_node, VCMPGTUW_P, pim_ovl_4u_4u | pim_manip_swap | pim_cr6_ge);
+ def_pim_builtin ("vec_any_ge.7", integer_type_node, VCMPGTSW_P, pim_ovl_4 | pim_manip_swap | pim_cr6_ge);
+
+ def_pim_builtin ("vec_any_gt", integer_type_node, VCMPGTUB_P, pim_ovl_16u_16u | pim_cr6_ne | pim_group);
+ def_pim_builtin ("vec_any_gt.2", integer_type_node, VCMPGTSB_P, pim_ovl_16 | pim_cr6_ne);
+ def_pim_builtin ("vec_any_gt.3", integer_type_node, VCMPGTUH_P, pim_ovl_8u_8u | pim_cr6_ne);
+ def_pim_builtin ("vec_any_gt.4", integer_type_node, VCMPGTSH_P, pim_ovl_8 | pim_cr6_ne);
+ def_pim_builtin ("vec_any_gt.5", integer_type_node, VCMPGTFP_P, pim_ovl_4f | pim_cr6_ne);
+ def_pim_builtin ("vec_any_gt.6", integer_type_node, VCMPGTUW_P, pim_ovl_4u_4u | pim_cr6_ne);
+ def_pim_builtin ("vec_any_gt.7", integer_type_node, VCMPGTSW_P, pim_ovl_4 | pim_cr6_ne);
+
+ def_pim_builtin ("vec_any_le", integer_type_node, VCMPGTUB_P, pim_ovl_16u_16u | pim_cr6_ge | pim_group);
+ def_pim_builtin ("vec_any_le.2", integer_type_node, VCMPGTSB_P, pim_ovl_16 | pim_cr6_ge);
+ def_pim_builtin ("vec_any_le.3", integer_type_node, VCMPGTUH_P, pim_ovl_8u_8u | pim_cr6_ge);
+ def_pim_builtin ("vec_any_le.4", integer_type_node, VCMPGTSH_P, pim_ovl_8 | pim_cr6_ge);
+ def_pim_builtin ("vec_any_le.5", integer_type_node, VCMPGEFP_P, pim_ovl_4f | pim_manip_swap | pim_cr6_ne);
+ def_pim_builtin ("vec_any_le.6", integer_type_node, VCMPGTUW_P, pim_ovl_4u_4u | pim_cr6_ge);
+ def_pim_builtin ("vec_any_le.7", integer_type_node, VCMPGTSW_P, pim_ovl_4 | pim_cr6_ge);
+
+ def_pim_builtin ("vec_any_lt", integer_type_node, VCMPGTUB_P, pim_ovl_16u_16u | pim_manip_swap | pim_cr6_ne | pim_group);
+ def_pim_builtin ("vec_any_lt.2", integer_type_node, VCMPGTSB_P, pim_ovl_16 | pim_manip_swap | pim_cr6_ne);
+ def_pim_builtin ("vec_any_lt.3", integer_type_node, VCMPGTUH_P, pim_ovl_8u_8u | pim_manip_swap | pim_cr6_ne);
+ def_pim_builtin ("vec_any_lt.4", integer_type_node, VCMPGTSH_P, pim_ovl_8 | pim_manip_swap | pim_cr6_ne);
+ def_pim_builtin ("vec_any_lt.5", integer_type_node, VCMPGTFP_P, pim_ovl_4f | pim_manip_swap | pim_cr6_ne);
+ def_pim_builtin ("vec_any_lt.6", integer_type_node, VCMPGTUW_P, pim_ovl_4u_4u | pim_manip_swap | pim_cr6_ne);
+ def_pim_builtin ("vec_any_lt.7", integer_type_node, VCMPGTSW_P, pim_ovl_4 | pim_manip_swap | pim_cr6_ne);
+
+ def_pim_builtin ("vec_any_nan", integer_type_node, VCMPEQFP_P, pim_manip_dup | pim_cr6_ge | pim_group);
+
+ def_pim_builtin ("vec_any_ne", integer_type_node, VCMPEQUB_P, pim_ovl_16 | pim_cr6_ge | pim_group);
+ def_pim_builtin ("vec_any_ne.2", integer_type_node, VCMPEQUH_P, pim_ovl_8 | pim_cr6_ge);
+ def_pim_builtin ("vec_any_ne.3", integer_type_node, VCMPEQFP_P, pim_ovl_4f | pim_cr6_ge);
+ def_pim_builtin ("vec_any_ne.4", integer_type_node, VCMPEQUW_P, pim_ovl_4 | pim_cr6_ge);
+
+ def_pim_builtin ("vec_any_nge", integer_type_node, VCMPGEFP_P, pim_cr6_ge | pim_group);
+
+ def_pim_builtin ("vec_any_ngt", integer_type_node, VCMPGTFP_P, pim_cr6_ge | pim_group);
+
+ def_pim_builtin ("vec_any_nle", integer_type_node, VCMPGEFP_P, pim_manip_swap | pim_cr6_ge | pim_group);
+
+ def_pim_builtin ("vec_any_nlt", integer_type_node, VCMPGEFP_P, pim_manip_swap | pim_cr6_ge | pim_group);
+
+ def_pim_builtin ("vec_any_numeric", integer_type_node, VCMPEQFP_P, pim_manip_dup | pim_cr6_ne | pim_group);
+
+ def_pim_builtin ("vec_any_out", integer_type_node, VCMPBFP_P, pim_cr6_ne | pim_group);
+
+ gcc_assert (pim_code == ALTIVEC_PIM__LAST + 1);
+ }
+ /* APPLE LOCAL end AltiVec */
}
static void
@@ -8925,6 +10626,8 @@ expand_block_clear (rtx operands[])
int offset;
int clear_bytes;
int clear_step;
+ /* APPLE LOCAL Altivec 3840704 */
+ bool cpu_altivec = TARGET_ALTIVEC && ! flag_disable_opts_for_faltivec;
/* If this is not a fixed size move, just call memcpy */
if (! constp)
@@ -8940,11 +10643,23 @@ expand_block_clear (rtx operands[])
if (bytes <= 0)
return 1;
+ /* APPLE LOCAL begin Altivec 3840704 */
+ {
+ static bool warned;
+ if (flag_disable_opts_for_faltivec && align >= 128 && ! warned)
+ {
+ warned = true;
+ warning ("vectorised memset disabled due to use of -faltivec without -maltivec");
+ }
+ }
+ /* APPLE LOCAL end Altivec 3840704 */
+
/* Use the builtin memset after a point, to avoid huge code bloat.
When optimize_size, avoid any significant code bloat; calling
memset is about 4 instructions, so allow for one instruction to
load zero and three to do clearing. */
- if (TARGET_ALTIVEC && align >= 128)
+ /* APPLE LOCAL Altivec 3840704 */
+ if (cpu_altivec && align >= 128)
clear_step = 16;
else if (TARGET_POWERPC64 && align >= 32)
clear_step = 8;
@@ -8961,7 +10676,8 @@ expand_block_clear (rtx operands[])
enum machine_mode mode = BLKmode;
rtx dest;
- if (bytes >= 16 && TARGET_ALTIVEC && align >= 128)
+ /* APPLE LOCAL Altivec 3840704 */
+ if (bytes >= 16 && cpu_altivec && align >= 128)
{
clear_bytes = 16;
mode = V4SImode;
@@ -9052,9 +10768,24 @@ expand_block_move (rtx operands[])
enum machine_mode mode = BLKmode;
rtx src, dest;
+ /* APPLE LOCAL begin Altivec 3840704 */
+ {
+ static bool warned;
+ if (flag_disable_opts_for_faltivec && bytes >= 16 && align >= 128
+ && ! warned)
+ {
+ warned = true;
+ warning ("vectorised memcpy disabled due to use of -faltivec without -maltivec");
+ }
+ }
+ /* APPLE LOCAL end Altivec 3840704 */
+
/* Altivec first, since it will be faster than a string move
when it applies, and usually not significantly larger. */
- if (TARGET_ALTIVEC && bytes >= 16 && align >= 128)
+ /* APPLE LOCAL begin Altivec 3840704 */
+ if (TARGET_ALTIVEC && ! flag_disable_opts_for_faltivec
+ && bytes >= 16 && align >= 128)
+ /* APPLE LOCAL end Altivec 3840704 */
{
move_bytes = 16;
mode = V4SImode;
@@ -10315,7 +12046,11 @@ rs6000_got_register (rtx value ATTRIBUTE_UNUSED)
static struct machine_function *
rs6000_init_machine_status (void)
{
- return ggc_alloc_cleared (sizeof (machine_function));
+ /* APPLE LOCAL begin volatile pic base reg in leaves */
+ machine_function *mf = (machine_function *) ggc_alloc_cleared (sizeof (machine_function));
+ mf->substitute_pic_base_reg = INVALID_REGNUM;
+ return mf;
+ /* APPLE LOCAL end volatile pic base reg in leaves */
}
/* These macros test for integers and extract the low-order bits. */
@@ -11988,10 +13723,14 @@ rs6000_emit_vector_select (rtx dest, rtx op1, rtx op2, rtx mask)
temp = gen_reg_rtx (dest_mode);
+ /* APPLE LOCAL begin AV */
+ /* Fix op1 and op2 order. */
t = gen_rtx_fmt_ee (SET, VOIDmode, temp,
gen_rtx_fmt_Ei (UNSPEC, dest_mode,
- gen_rtvec (3, op1, op2, mask),
+ gen_rtvec (3, op2, op1, mask),
vsel_insn_index));
+ /* APPLE LOCAL end AV */
+
emit_insn (t);
emit_move_insn (dest, temp);
return;
@@ -12266,6 +14005,10 @@ rs6000_emit_minmax (rtx dest, enum rtx_code code, rtx op0, rtx op1)
else
target = emit_conditional_move (dest, c, op0, op1, mode,
op1, op0, mode, 0);
+ /* APPLE LOCAL begin pragma fenv 3943021 */
+ if (flag_trapping_math && target == NULL_RTX)
+ return;
+ /* APPLE LOCAL end pragma fenv 3943021 */
if (target == NULL_RTX)
abort ();
if (target != dest)
@@ -12444,6 +14187,8 @@ first_reg_to_save (void)
#if TARGET_MACHO
if (flag_pic
&& current_function_uses_pic_offset_table
+ /* APPLE LOCAL volatile pic base reg in leaves */
+ && cfun->machine->substitute_pic_base_reg == INVALID_REGNUM
&& first_reg > RS6000_PIC_OFFSET_TABLE_REGNUM)
return RS6000_PIC_OFFSET_TABLE_REGNUM;
#endif
@@ -12755,9 +14500,8 @@ rs6000_stack_info (void)
&& !FP_SAVE_INLINE (info_ptr->first_fp_reg_save))
|| info_ptr->first_altivec_reg_save <= LAST_ALTIVEC_REGNO
|| (DEFAULT_ABI == ABI_V4 && current_function_calls_alloca)
- || (DEFAULT_ABI == ABI_DARWIN
- && flag_pic
- && current_function_uses_pic_offset_table)
+ /* APPLE LOCAL but why? */
+ /* Test for flag_pic, abi, current_function deleted deliberately. */
|| info_ptr->calls_p)
{
info_ptr->lr_save_p = 1;
@@ -12916,7 +14660,8 @@ rs6000_stack_info (void)
+ ehrd_size
+ info_ptr->cr_size
+ info_ptr->lr_size
- + info_ptr->vrsave_size
+ /* APPLE LOCAL fix redundant add? */
+ /* FIXME: the FSF does "+ info_ptr->vrsave_size" here, shouldn't we? */
+ info_ptr->toc_size,
save_align);
@@ -13203,16 +14948,33 @@ rs6000_return_addr (int count, rtx frame)
}
/* Say whether a function is a candidate for sibcall handling or not.
- We do not allow indirect calls to be optimized into sibling calls.
+ APPLE LOCAL sibling calls
+
Also, we can't do it if there are any vector parameters; there's
nowhere to put the VRsave code so it works; note that functions with
vector parameters are required to have a prototype, so the argument
type info must be available here. (The tail recursion case can work
with vector parameters, but there's no way to distinguish here.) */
+
+/* APPLE LOCAL begin sibling calls
+ On Darwin only, indirect calls may be sibcalls. This is enabled
+ primarily by target-specific logic in calls.c.
+ APPLE LOCAL end sibling calls */
static bool
rs6000_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED)
{
tree type;
+ /* APPLE LOCAL begin long-branch */
+ if (TARGET_LONG_BRANCH)
+ return 0;
+ /* APPLE LOCAL end long-branch */
+
+ /* APPLE LOCAL begin indirect sibcalls */
+ /* This goes with a lot of local changes in expand_call. */
+ if (DEFAULT_ABI == ABI_DARWIN && !decl)
+ return true;
+ /* APPLE LOCAL end indirect sibcalls */
+
if (decl)
{
if (TARGET_ALTIVEC_VRSAVE)
@@ -13827,6 +15589,131 @@ generate_set_vrsave (rtx reg, rs6000_stack_t *info, int epiloguep)
return insn;
}
+/* APPLE LOCAL begin special ObjC method use of R12 */
+static int objc_method_using_pic = 0;
+
+/* Determine whether a name is an ObjC method. */
+static int name_encodes_objc_method_p (const char *piclabel_name)
+{
+ return (piclabel_name[0] == '*' && piclabel_name[1] == '"'
+ ? (piclabel_name[2] == 'L'
+ && (piclabel_name[3] == '+' || piclabel_name[3] == '-'))
+ : (piclabel_name[1] == 'L'
+ && (piclabel_name[2] == '+' || piclabel_name[2] == '-')));
+}
+/* APPLE LOCAL end special ObjC method use of R12 */
+
+/* APPLE LOCAL begin recompute PIC register use */
+/* Sometimes a function has references that require the PIC register,
+ but optimization removes them all. To catch this case
+ recompute current_function_uses_pic_offset_table here.
+ This may allow us to eliminate the prologue and epilogue. */
+
+static int
+recompute_PIC_register_use (void)
+{
+ if (DEFAULT_ABI == ABI_DARWIN
+ && flag_pic && current_function_uses_pic_offset_table
+ && !cfun->machine->ra_needs_full_frame)
+ {
+ rtx insn;
+ current_function_uses_pic_offset_table = 0;
+ push_topmost_sequence ();
+ for (insn = get_insns (); insn != NULL; insn = NEXT_INSN (insn))
+ if ( reg_mentioned_p (pic_offset_table_rtx, insn))
+ {
+ current_function_uses_pic_offset_table = 1;
+ break;
+ }
+ pop_topmost_sequence ();
+ }
+ return 0;
+}
+/* APPLE LOCAL end recompute PIC register use */
+
+/* APPLE LOCAL begin volatile pic base reg in leaves */
+/* If this is a leaf function and we used any pic-based references,
+ see if there is an unused volatile reg we can use instead of R31.
+ If so set substitute_pic_base_reg to this reg, set its reg_ever_used
+ bit (to avoid confusing later calls to alloc_volatile_reg), and
+ make a pass through the existing RTL, substituting the new reg for
+ the old one wherever it appears.
+ Logically this is a void function; it is int so it can be used to
+ initialize a dummy variable, thus getting executed ahead of other
+ initializations. Technicolour yawn. */
+
+/* ALLOC_VOLATILE_REG allocates a volatile register AFTER all gcc
+ register allocations have been done; we use it to reserve an
+ unused reg for holding VRsave. Returns -1 in case of failure (all
+ volatile regs are in use.) */
+/* Note, this is called from both the prologue and epilogue code,
+ with the assumption that it will return the same result both
+ times! Since the register arrays are not changed in between
+ this is valid, if a bit fragile. */
+/* In future we may also use this to grab an unused volatile reg to
+ hold the PIC base reg in the event that the current function makes
+ no procedure calls; this was done in 2.95. */
+static int
+alloc_volatile_reg (void)
+{
+ if (current_function_is_leaf
+ && reload_completed
+ && !cfun->machine->ra_needs_full_frame)
+ {
+ int r;
+ for (r = 10; r >= 2; --r)
+ if (! fixed_regs[r] && ! regs_ever_live[r])
+ return r;
+ }
+
+ return -1; /* fail */
+}
+
+static int
+try_leaf_pic_optimization (void)
+{
+ if ( DEFAULT_ABI==ABI_DARWIN
+ && flag_pic && current_function_uses_pic_offset_table
+ && current_function_is_leaf
+ && !cfun->machine->ra_needs_full_frame )
+ {
+ int reg = alloc_volatile_reg ();
+ if ( reg != -1 )
+ {
+ /* Run through the insns, changing references to the original
+ PIC_OFFSET_TABLE_REGNUM to our new one. */
+ rtx insn;
+ const int nregs = PIC_OFFSET_TABLE_REGNUM + 1;
+ rtx *reg_map = (rtx *) xmalloc (nregs * sizeof (rtx));
+ memset (reg_map, 0, nregs * sizeof (rtx));
+ reg_map[PIC_OFFSET_TABLE_REGNUM] = gen_rtx_REG (SImode, reg);
+
+ push_topmost_sequence ();
+ for (insn = get_insns (); insn != NULL; insn = NEXT_INSN (insn))
+ {
+ if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
+ {
+ replace_regs (PATTERN (insn), reg_map, nregs, 1);
+ replace_regs (REG_NOTES (insn), reg_map, nregs, 1);
+ }
+ else if (GET_CODE (insn) == CALL_INSN)
+ {
+ if ( !SIBLING_CALL_P (insn))
+ abort ();
+ }
+ }
+ pop_topmost_sequence ();
+ free (reg_map);
+
+ regs_ever_live[reg] = 1;
+ regs_ever_live[PIC_OFFSET_TABLE_REGNUM] = 0;
+ cfun->machine->substitute_pic_base_reg = reg;
+ }
+ }
+ return 0;
+}
+/* APPLE LOCAL end volatile pic base reg in leaves */
+
/* Save a register into the frame, and emit RTX_FRAME_RELATED_P notes.
Save REGNO into [FRAME_REG + OFFSET] in mode MODE. */
@@ -13902,6 +15789,10 @@ gen_frame_mem_offset (enum machine_mode mode, rtx reg, int offset)
void
rs6000_emit_prologue (void)
{
+ /* APPLE LOCAL recompute PIC register use */
+ int dummy ATTRIBUTE_UNUSED = recompute_PIC_register_use ();
+ /* APPLE LOCAL volatile pic base reg in leaves */
+ int ignored ATTRIBUTE_UNUSED = try_leaf_pic_optimization ();
rs6000_stack_t *info = rs6000_stack_info ();
enum machine_mode reg_mode = Pmode;
int reg_size = TARGET_32BIT ? 4 : 8;
@@ -13913,6 +15804,14 @@ rs6000_emit_prologue (void)
int saving_FPRs_inline;
int using_store_multiple;
HOST_WIDE_INT sp_offset = 0;
+ /* APPLE LOCAL begin callers_lr_already_saved */
+ int callers_lr_already_saved = 0;
+#if TARGET_MACHO
+ int lr_already_set_up_for_pic = 0;
+#endif
+ /* APPLE LOCAL end callers_lr_already_saved */
+ /* APPLE LOCAL special ObjC method use of R12 */
+ objc_method_using_pic = 0;
if (TARGET_FIX_AND_CONTINUE)
{
@@ -13962,6 +15861,31 @@ rs6000_emit_prologue (void)
rs6000_emit_stack_tie ();
}
+ /* APPLE LOCAL begin special ObjC method use of R12 */
+#if TARGET_MACHO
+ if (DEFAULT_ABI == ABI_DARWIN
+ && current_function_uses_pic_offset_table && flag_pic)
+ {
+ const char *piclabel_name = machopic_function_base_name ();
+
+ if (name_encodes_objc_method_p (piclabel_name)
+ /* If we're saving vector or FP regs via a function call,
+ then don't bother with this ObjC R12 optimization.
+ This test also eliminates world_save. */
+ && (info->first_altivec_reg_save > LAST_ALTIVEC_REGNO
+ || VECTOR_SAVE_INLINE (info->first_altivec_reg_save))
+ && (info->first_fp_reg_save == 64
+ || FP_SAVE_INLINE (info->first_fp_reg_save)))
+ {
+ /* We cannot output the label now; there seems to be no
+ way to prevent cfgcleanup from deleting it. It is done
+ in rs6000_output_function_prologue with fprintf! */
+ objc_method_using_pic = 1;
+ }
+ }
+#endif /* TARGET_MACHO */
+ /* APPLE LOCAL end special ObjC method use of R12 */
+
/* Handle world saves specially here. */
if (WORLD_SAVE_P (info))
{
@@ -14166,7 +16090,12 @@ rs6000_emit_prologue (void)
{
rtx set;
- cr_save_rtx = gen_rtx_REG (SImode, 12);
+ /* APPLE LOCAL begin special ObjC method use of R12 */
+ /* For Darwin, use R2, so we don't clobber the special ObjC
+ method use of R12. R11 has a special meaning for Ada, so we
+ can't use that. */
+ cr_save_rtx = gen_rtx_REG (SImode, DEFAULT_ABI == ABI_DARWIN ? 2 : 12);
+ /* APPLE LOCAL end special ObjC method use of R12 */
insn = emit_insn (gen_movesi_from_cr (cr_save_rtx));
RTX_FRAME_RELATED_P (insn) = 1;
/* Now, there's no way that dwarf2out_frame_debug_expr is going
@@ -14201,17 +16130,62 @@ rs6000_emit_prologue (void)
char rname[30];
const char *alloc_rname;
rtvec p;
- p = rtvec_alloc (2 + 64 - info->first_fp_reg_save);
+ /* APPLE LOCAL begin reduce code size */
+
+ int gen_following_label = 0;
+ int count = 0;
- RTVEC_ELT (p, 0) = gen_rtx_CLOBBER (VOIDmode,
- gen_rtx_REG (Pmode,
- LINK_REGISTER_REGNUM));
+ if (current_function_uses_pic_offset_table && flag_pic
+#ifdef INSN_SCHEDULING
+ /* Prevent the compiler from crashing
+ while scheduling insns after global_alloc! */
+ && (optimize == 0 || !flag_schedule_insns_after_reload)
+#endif
+ /* If this is the last CALL in the prolog, then we've got our PC.
+ If we're saving AltiVec regs via a function, we're not last. */
+ && (info->first_altivec_reg_save > LAST_ALTIVEC_REGNO
+ || VECTOR_SAVE_INLINE (info->first_altivec_reg_save)))
+ gen_following_label = lr_already_set_up_for_pic = 1;
+ /* APPLE LOCAL end reduce code size */
+
+ /* APPLE LOCAL begin +2 (could be conditionalized) */
+ p = rtvec_alloc (2 + 64 - info->first_fp_reg_save + 2
+ + gen_following_label);
+ /* APPLE LOCAL end +2 (could be conditionalized) */
+
+ /* APPLE LOCAL begin reduce code size */
+ /* 0 -> count++ */
+ RTVEC_ELT (p, count++) = gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_REG (Pmode,
+ LINK_REGISTER_REGNUM));
+#if TARGET_MACHO
+ /* We have to calculate the offset into saveFP to where we must
+ call (!!) SAVEFP also saves the caller's LR -- placed into
+ R0 above -- into 8(R1). SAVEFP/RESTOREFP should never be
+ called to save or restore only F31. */
+
+ if (info->lr_save_offset != (POINTER_SIZE / 4) || info->first_fp_reg_save == 63)
+ abort ();
+
+ sprintf (rname, "*saveFP%s%.0d ; save f%d-f31",
+ (info->first_fp_reg_save - 32 == 14 ? "" : "+"),
+ (info->first_fp_reg_save - 46) * 4,
+ info->first_fp_reg_save - 32);
+#else
+ /* APPLE LOCAL end reduce code size */
sprintf (rname, "%s%d%s", SAVE_FP_PREFIX,
info->first_fp_reg_save - 32, SAVE_FP_SUFFIX);
+ /* APPLE LOCAL reduce code size */
+#endif /* TARGET_MACHO */
alloc_rname = ggc_strdup (rname);
- RTVEC_ELT (p, 1) = gen_rtx_USE (VOIDmode,
+ /* APPLE LOCAL reduce code size */
+ RTVEC_ELT (p, count++) = gen_rtx_USE (VOIDmode,
gen_rtx_SYMBOL_REF (Pmode,
alloc_rname));
+ /* APPLE LOCAL begin reduce code size */
+ if (gen_following_label)
+ RTVEC_ELT (p, count++) = gen_rtx_USE (VOIDmode, const0_rtx);
+ /* APPLE LOCAL end reduce code size */
for (i = 0; i < 64 - info->first_fp_reg_save; i++)
{
rtx addr, reg, mem;
@@ -14222,11 +16196,32 @@ rs6000_emit_prologue (void)
mem = gen_rtx_MEM (DFmode, addr);
set_mem_alias_set (mem, rs6000_sr_alias_set);
- RTVEC_ELT (p, i + 2) = gen_rtx_SET (VOIDmode, mem, reg);
+ /* APPLE LOCAL reduce code size */
+ RTVEC_ELT (p, count++) = gen_rtx_SET (VOIDmode, mem, reg);
}
+ /* APPLE LOCAL begin C++ EH and setjmp (radar 2866661) */
+#if TARGET_MACHO
+ /* Darwin version of these functions stores R0. */
+ RTVEC_ELT (p, count++) = gen_rtx_USE (VOIDmode, gen_rtx_REG (Pmode, 0));
+
+ /* If we saved LR, *tell* people about it! */
+ if (info->lr_save_p)
+ {
+ rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
+ GEN_INT (info->lr_save_offset + sp_offset));
+ rtx mem = gen_rtx_MEM (Pmode, addr);
+ /* This should not be of rs6000_sr_alias_set, because of
+ __builtin_return_address. */
+ RTVEC_ELT (p, count++) = gen_rtx_SET (Pmode, mem,
+ gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM));
+ }
+#endif
+ /* APPLE LOCAL end C++ EH and setjmp (radar 2866661) */
insn = emit_insn (gen_rtx_PARALLEL (VOIDmode, p));
rs6000_frame_related (insn, frame_ptr_rtx, info->total_size,
NULL_RTX, NULL_RTX);
+ /* APPLE LOCAL callers_lr_already_saved */
+ callers_lr_already_saved = 1;
}
/* Save GPRs. This is done as a PARALLEL if we are using
@@ -14264,7 +16259,13 @@ rs6000_emit_prologue (void)
&& TARGET_TOC && TARGET_MINIMAL_TOC)))
|| (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM
&& ((DEFAULT_ABI == ABI_V4 && flag_pic != 0)
- || (DEFAULT_ABI == ABI_DARWIN && flag_pic))))
+ /* APPLE LOCAL begin volatile pic base reg in leaves */
+ || (DEFAULT_ABI == ABI_DARWIN && flag_pic
+ && ((current_function_uses_pic_offset_table
+ && cfun->machine->substitute_pic_base_reg
+ == INVALID_REGNUM)
+ || cfun->machine->ra_needs_full_frame)))))
+ /* APPLE LOCAL end volatile pic base reg in leaves */
{
rtx addr, reg, mem;
reg = gen_rtx_REG (reg_mode, info->first_gp_reg_save + i);
@@ -14346,8 +16347,20 @@ rs6000_emit_prologue (void)
}
}
+ /* APPLE LOCAL begin special ObjC method use of R12 */
+ if (objc_method_using_pic)
+ rs6000_maybe_dead (
+ emit_move_insn (gen_rtx_REG (Pmode,
+ cfun->machine->substitute_pic_base_reg
+ == INVALID_REGNUM
+ ? PIC_OFFSET_TABLE_REGNUM
+ : cfun->machine->substitute_pic_base_reg),
+ gen_rtx_REG (Pmode, 12)));
+ /* APPLE LOCAL end special ObjC method use of R12 */
+
/* Save lr if we used it. */
- if (!WORLD_SAVE_P (info) && info->lr_save_p)
+ /* APPLE LOCAL callers_lr_already_saved */
+ if (!WORLD_SAVE_P (info) && info->lr_save_p && !callers_lr_already_saved)
{
rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
GEN_INT (info->lr_save_offset + sp_offset));
@@ -14441,17 +16454,38 @@ rs6000_emit_prologue (void)
#if TARGET_MACHO
if (DEFAULT_ABI == ABI_DARWIN
+ /* APPLE LOCAL special ObjC method use of R12 */
+ && !objc_method_using_pic
&& flag_pic && current_function_uses_pic_offset_table)
{
rtx lr = gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM);
rtx src = machopic_function_base_sym ();
- rs6000_maybe_dead (emit_insn (gen_load_macho_picbase (lr, src)));
+ /* APPLE LOCAL begin save and restore LR */
+ /* Save and restore LR locally around this call (in R0). */
+ if (!info->lr_save_p)
+ rs6000_maybe_dead (emit_move_insn (gen_rtx_REG (Pmode, 0), lr));
+ /* APPLE LOCAL end save and restore LR */
+
+ /* APPLE LOCAL begin performance enhancement */
+ if (!lr_already_set_up_for_pic)
+ rs6000_maybe_dead (emit_insn ((TARGET_64BIT
+ ? gen_load_macho_picbase_di (lr, src)
+ : gen_load_macho_picbase (lr, src))));
+ /* APPLE LOCAL end performance enhancement */
+ /* APPLE LOCAL begin volatile pic base reg in leaves */
insn = emit_move_insn (gen_rtx_REG (Pmode,
- RS6000_PIC_OFFSET_TABLE_REGNUM),
+ (cfun->machine->substitute_pic_base_reg
+ == INVALID_REGNUM)
+ ? RS6000_PIC_OFFSET_TABLE_REGNUM
+ : cfun->machine->substitute_pic_base_reg),
lr);
rs6000_maybe_dead (insn);
+
+ if (!info->lr_save_p)
+ rs6000_maybe_dead (emit_move_insn (lr, gen_rtx_REG (Pmode, 0)));
+ /* APPLE LOCAL end volatile pic base reg in leaves */
}
#endif
}
@@ -14467,6 +16501,8 @@ rs6000_output_function_prologue (FILE *file,
if (TARGET_DEBUG_STACK)
debug_stack_info (info);
+ /* APPLE LOCAL do not extern fp save/restore */
+#if !TARGET_MACHO
/* Write .extern for any function we will call to save and restore
fp values. */
if (info->first_fp_reg_save < 64
@@ -14475,6 +16511,8 @@ rs6000_output_function_prologue (FILE *file,
SAVE_FP_PREFIX, info->first_fp_reg_save - 32, SAVE_FP_SUFFIX,
RESTORE_FP_PREFIX, info->first_fp_reg_save - 32,
RESTORE_FP_SUFFIX);
+ /* APPLE LOCAL do not extern fp save/restore */
+#endif /* !TARGET_MACHO */
/* Write .extern for AIX common mode routines, if needed. */
if (! TARGET_POWER && ! TARGET_POWERPC && ! common_mode_defined)
@@ -14488,6 +16526,17 @@ rs6000_output_function_prologue (FILE *file,
common_mode_defined = 1;
}
+ /* APPLE LOCAL begin special ObjC method use of R12 */
+#if TARGET_MACHO
+ if ( HAVE_prologue && DEFAULT_ABI == ABI_DARWIN && objc_method_using_pic )
+ {
+ /* APPLE FIXME isn't there an asm macro to do all this? */
+ const char* piclabel = machopic_function_base_name ();
+ fprintf(file, "%s:\n", (*piclabel == '*') ? piclabel + 1 : piclabel);
+ }
+#endif
+ /* APPLE LOCAL end special ObjC method use of R12 */
+
if (! HAVE_prologue)
{
start_sequence ();
@@ -14562,6 +16611,8 @@ rs6000_emit_epilogue (int sibcall)
using_mfcr_multiple = (rs6000_cpu == PROCESSOR_PPC601
|| rs6000_cpu == PROCESSOR_PPC603
|| rs6000_cpu == PROCESSOR_PPC750
+ /* APPLE LOCAL ? */
+ || rs6000_cpu == PROCESSOR_PPC7400
|| optimize_size);
if (WORLD_SAVE_P (info))
@@ -14749,7 +16800,10 @@ rs6000_emit_epilogue (int sibcall)
set_mem_alias_set (mem, rs6000_sr_alias_set);
- emit_move_insn (gen_rtx_REG (SImode, 12), mem);
+ /* APPLE LOCAL begin use R11 because of ObjC use of R12 in sibcall to CTR */
+ emit_move_insn (gen_rtx_REG (SImode,
+ DEFAULT_ABI == ABI_DARWIN ? 11 : 12), mem);
+ /* APPLE LOCAL end use R11 because of ObjC use of R12 in sibcall to CTR */
}
/* Set LR here to try to overlap restores below. */
@@ -14821,7 +16875,14 @@ rs6000_emit_epilogue (int sibcall)
&& TARGET_TOC && TARGET_MINIMAL_TOC)))
|| (i+info->first_gp_reg_save == RS6000_PIC_OFFSET_TABLE_REGNUM
&& ((DEFAULT_ABI == ABI_V4 && flag_pic != 0)
- || (DEFAULT_ABI == ABI_DARWIN && flag_pic))))
+ /* APPLE LOCAL begin darwin native */
+ || (DEFAULT_ABI == ABI_DARWIN && flag_pic
+ && ((current_function_uses_pic_offset_table
+ && cfun->machine->substitute_pic_base_reg
+ == INVALID_REGNUM)
+ || cfun->machine->ra_needs_full_frame)))))
+
+ /* APPLE LOCAL end darwin native */
{
rtx addr = gen_rtx_PLUS (Pmode, frame_reg_rtx,
GEN_INT (info->gp_save_offset
@@ -14875,7 +16936,9 @@ rs6000_emit_epilogue (int sibcall)
/* If we saved cr, restore it here. Just those that were used. */
if (info->cr_save_p)
{
- rtx r12_rtx = gen_rtx_REG (SImode, 12);
+ /* APPLE LOCAL use R11 because of ObjC use of R12 in sibcall to CTR */
+ /* APPLE LOCAL silly name retained to minimize deviation from FSF */
+ rtx r12_rtx = gen_rtx_REG (SImode, DEFAULT_ABI == ABI_DARWIN ? 11 : 12);
int count = 0;
if (using_mfcr_multiple)
@@ -14975,8 +17038,25 @@ rs6000_emit_epilogue (int sibcall)
char rname[30];
const char *alloc_rname;
+ /* APPLE LOCAL begin Reduce code size / improve performance */
+#if TARGET_MACHO
+ /* We have to calculate the offset into RESTFP to where we must
+ call (!!) RESTFP also restores the caller's LR from 8(R1).
+ RESTFP should *never* be called to restore only F31. */
+
+ if (info->lr_save_offset != (POINTER_SIZE / 4) || info->first_fp_reg_save == 63)
+ abort ();
+
+ sprintf (rname, "*restFP%s%.0d ; restore f%d-f31",
+ (info->first_fp_reg_save - 32 == 14 ? "" : "+"),
+ (info->first_fp_reg_save - 46) * 4,
+ info->first_fp_reg_save - 32);
+#else
+ /* APPLE LOCAL end Reduce code size / improve performance */
sprintf (rname, "%s%d%s", RESTORE_FP_PREFIX,
info->first_fp_reg_save - 32, RESTORE_FP_SUFFIX);
+ /* APPLE LOCAL Reduce code size / improve performance */
+#endif /* TARGET_MACHO */
alloc_rname = ggc_strdup (rname);
RTVEC_ELT (p, 2) = gen_rtx_USE (VOIDmode,
gen_rtx_SYMBOL_REF (Pmode,
@@ -16585,8 +18665,22 @@ rs6000_is_costly_dependence (rtx insn, rtx next, rtx link, int cost,
&& (!link || (int) REG_NOTE_KIND (link) == 0))
/* Prevent load after store in the same group if it is a true
dependence. */
+ /* APPLE LOCAL begin nop on true-dependence. */
+ {
+ if (GET_CODE (PATTERN (next)) == SET && GET_CODE (PATTERN (insn)) == SET)
+ {
+ rtx load_mem = SET_SRC (PATTERN (next));
+ rtx sto_mem = SET_DEST (PATTERN (insn));
+ if (GET_CODE (load_mem) == MEM && GET_CODE (sto_mem) == MEM)
+ /* Only consider those true-depenedence cases that memory conflict
+ can be determined. Exclude cases, where true-dependency was decided
+ because memory conflict could not be determined from aliasing info. */
+ return must_true_dependence (load_mem, sto_mem);
+ }
return true;
-
+ }
+ /* APPLE LOCAL end nop on true-dependence. */
+
/* The flag is set to X; dependences with latency >= X are considered costly,
and will not be scheduled in the same group. */
if (rs6000_sched_costly_dep <= max_dep_latency
@@ -17166,6 +19260,13 @@ rs6000_handle_altivec_attribute (tree *node,
switch (altivec_type)
{
+ /* APPLE LOCAL begin AltiVec */
+ case 'e':
+ /* Return the constituent element type. */
+ result = (ALTIVEC_VECTOR_MODE (mode) ? TREE_TYPE (type) : type);
+ break;
+ /* APPLE LOCAL end AltiVec */
+
case 'v':
unsigned_p = TYPE_UNSIGNED (type);
switch (mode)
@@ -17206,8 +19307,12 @@ rs6000_handle_altivec_attribute (tree *node,
default: break;
}
- if (result && result != type && TYPE_READONLY (type))
- result = build_qualified_type (result, TYPE_QUAL_CONST);
+ /* APPLE LOCAL begin AltiVec */
+ /* Propagate qualifiers attached to the element type
+ onto the vector type. */
+ if (result && result != type && TYPE_QUALS (type))
+ result = build_qualified_type (result, TYPE_QUALS (type));
+ /* APPLE LOCAL end AltiVec */
*no_add_attrs = true; /* No need to hang on to the attribute. */
@@ -17516,9 +19621,11 @@ macho_branch_islands (void)
strcat (tmp_buf, label);
strcat (tmp_buf, "_pic\n");
strcat (tmp_buf, label);
- strcat (tmp_buf, "_pic:\n\tmflr r11\n");
+ /* APPLE LOCAL indirect calls in R12 */
+ strcat (tmp_buf, "_pic:\n\tmflr r12\n");
- strcat (tmp_buf, "\taddis r11,r11,ha16(");
+ /* APPLE LOCAL indirect calls in R12 */
+ strcat (tmp_buf, "\taddis r12,r12,ha16(");
strcat (tmp_buf, name_buf);
strcat (tmp_buf, " - ");
strcat (tmp_buf, label);
@@ -17526,7 +19633,8 @@ macho_branch_islands (void)
strcat (tmp_buf, "\tmtlr r0\n");
- strcat (tmp_buf, "\taddi r12,r11,lo16(");
+ /* APPLE LOCAL indirect calls in R12 */
+ strcat (tmp_buf, "\taddi r12,r12,lo16(");
strcat (tmp_buf, name_buf);
strcat (tmp_buf, " - ");
strcat (tmp_buf, label);
@@ -17592,12 +19700,59 @@ output_call (rtx insn, rtx *operands, int dest_operand_number,
int cookie_operand_number)
{
static char buf[256];
+ /* APPLE LOCAL begin long-branch */
+ const char *far_call_instr_str=NULL, *near_call_instr_str=NULL;
+ rtx pattern;
+
+ switch (GET_CODE (insn))
+ {
+ case CALL_INSN:
+ far_call_instr_str = "jbsr";
+ near_call_instr_str = "bl";
+ pattern = NULL_RTX;
+ break;
+ case JUMP_INSN:
+ far_call_instr_str = "jmp";
+ near_call_instr_str = "b";
+ pattern = NULL_RTX;
+ break;
+ case INSN:
+ pattern = PATTERN (insn);
+ break;
+ default:
+ gcc_unreachable ();
+ break;
+ }
+ /* APPLE LOCAL end long-branch */
+
if (GET_CODE (operands[dest_operand_number]) == SYMBOL_REF
&& (INTVAL (operands[cookie_operand_number]) & CALL_LONG))
{
tree labelname;
tree funname = get_identifier (XSTR (operands[dest_operand_number], 0));
+ /* APPLE LOCAL begin long-branch */
+ /* This insn represents a prologue or epilogue. */
+ if ((pattern != NULL_RTX) && GET_CODE (pattern) == PARALLEL)
+ {
+ rtx parallel_first_op = XVECEXP (pattern, 0, 0);
+ switch (GET_CODE (parallel_first_op))
+ {
+ case CLOBBER: /* Prologue: a call to save_world. */
+ far_call_instr_str = "jbsr";
+ near_call_instr_str = "bl";
+ break;
+ case RETURN: /* Epilogue: a call to rest_world. */
+ far_call_instr_str = "jmp";
+ near_call_instr_str = "b";
+ break;
+ default:
+ abort();
+ break;
+ }
+ }
+ /* APPLE LOCAL end long-branch */
+
if (no_previous_def (funname))
{
int line_number = 0;
@@ -17607,7 +19762,13 @@ output_call (rtx insn, rtx *operands, int dest_operand_number,
CODE_LABEL_NUMBER (label_rtx));
label_buf = temp_buf[0] == '*' ? temp_buf + 1 : temp_buf;
labelname = get_identifier (label_buf);
- for (; insn && GET_CODE (insn) != NOTE; insn = PREV_INSN (insn));
+ /* APPLE LOCAL begin 3910248, 3915171 */
+ for (;
+ insn && (GET_CODE (insn) != NOTE
+ || NOTE_LINE_NUMBER (insn) < 0);
+ insn = PREV_INSN (insn))
+ ;
+ /* APPLE LOCAL end 3910248, 3915171 */
if (insn)
line_number = NOTE_LINE_NUMBER (insn);
add_compiler_branch_island (labelname, funname, line_number);
@@ -17820,6 +19981,130 @@ rs6000_darwin_file_start (void)
#endif /* TARGET_MACHO */
+/* APPLE LOCAL begin Macintosh alignment 2002-1-22 --ff */
+/* Return the alignment of a struct based on the Macintosh PowerPC
+ alignment rules. In general the alignment of a struct is
+ determined by the greatest alignment of its elements. However, the
+ PowerPC rules cause the alignment of a struct to peg at word
+ alignment except when the first field has greater than word
+ (32-bit) alignment, in which case the alignment is determined by
+ the alignment of the first field. */
+
+unsigned
+round_type_align (tree the_struct, unsigned computed, unsigned specified)
+{
+ if (TREE_CODE (the_struct) == VECTOR_TYPE
+ && ALTIVEC_VECTOR_MODE (TYPE_MODE (the_struct)))
+ {
+ /* All vectors are (at least) 16-byte aligned. A struct or
+ union with a vector element is also 16-byte aligned. */
+ return MAX (RS6000_VECTOR_ALIGNMENT, MAX (computed, specified));
+ }
+
+ if (TREE_CODE (the_struct) == RECORD_TYPE
+ || TREE_CODE (the_struct) == UNION_TYPE
+ || TREE_CODE (the_struct) == QUAL_UNION_TYPE)
+ {
+ tree first_field = TYPE_FIELDS (the_struct);
+
+ /* Skip past static fields, enums, and constant fields that are
+ not really a part of the record layout. */
+ while ((first_field != 0)
+ && (TREE_CODE (first_field) != FIELD_DECL))
+ first_field = TREE_CHAIN (first_field);
+
+ if (first_field != 0)
+ {
+ /* If other-than-default alignment (which includes mac68k
+ mode) is in effect, then no adjustments to the alignment
+ should be necessary. Ditto if the struct has the
+ __packed__ attribute. */
+ if (TYPE_PACKED (the_struct) || TARGET_ALIGN_MAC68K
+ || TARGET_ALIGN_NATURAL || maximum_field_alignment != 0)
+ /* Do nothing */ ;
+ else
+ {
+ /* The following code handles Macintosh PowerPC
+ alignment. The implementation is complicated by the
+ fact that BIGGEST_ALIGNMENT is 128 when AltiVec is
+ enabled and 32 when it is not. So when AltiVec is
+ not enabled, alignment is generally limited to word
+ alignment. Consequently, the alignment of unions has
+ to be recalculated if AltiVec is not enabled.
+
+ Below we explicitly test for fields with greater than
+ word alignment: doubles, long longs, and structs and
+ arrays with greater than word alignment. */
+ unsigned val;
+ tree field_type;
+
+ val = MAX (computed, specified);
+
+ if (TREE_CODE (the_struct) == UNION_TYPE && !TARGET_ALTIVEC)
+ {
+ tree field = first_field;
+
+ while (field != 0)
+ {
+ /* Don't consider statics, enums and constant fields
+ which are not really a part of the record. */
+ if (TREE_CODE (field) != FIELD_DECL)
+ {
+ field = TREE_CHAIN (field);
+ continue;
+ }
+ field_type = TREE_TYPE(field);
+ if (TREE_CODE (TREE_TYPE (field)) == ARRAY_TYPE)
+ field_type = get_inner_array_type (field);
+ else
+ field_type = TREE_TYPE (field);
+ val = MAX (TYPE_ALIGN (field_type), val);
+ if (FLOAT_TYPE_P (field_type)
+ && TYPE_MODE (field_type) == DFmode)
+ val = MAX (RS6000_DOUBLE_ALIGNMENT, val);
+ else if (INTEGRAL_TYPE_P (field_type)
+ && TYPE_MODE (field_type) == DImode)
+ val = MAX (RS6000_LONGLONG_ALIGNMENT, val);
+ field = TREE_CHAIN (field);
+ }
+ }
+ else
+ {
+ if (TREE_CODE (TREE_TYPE (first_field)) == ARRAY_TYPE)
+ field_type = get_inner_array_type (first_field);
+ else
+ field_type = TREE_TYPE (first_field);
+
+ if (field_type == error_mark_node)
+ return val;
+ val = MAX (TYPE_ALIGN (field_type), val);
+
+ if (FLOAT_TYPE_P (field_type)
+ && TYPE_MODE (field_type) == DFmode)
+ val = MAX (RS6000_DOUBLE_ALIGNMENT, val);
+ else if (INTEGRAL_TYPE_P (field_type)
+ && TYPE_MODE (field_type) == DImode)
+ val = MAX (RS6000_LONGLONG_ALIGNMENT, val);
+ }
+
+ return val;
+ }
+ } /* first_field != 0 */
+
+ /* Ensure all MAC68K structs are at least 16-bit aligned.
+ Unless the struct has __attribute__ ((packed)). */
+
+ if (TARGET_ALIGN_MAC68K && ! TYPE_PACKED (the_struct))
+ {
+ if (computed < 16)
+ computed = 16;
+ }
+ } /* RECORD_TYPE, etc */
+
+ return (MAX (computed, specified));
+}
+/* APPLE LOCAL end Macintosh alignment 2002-1-22 --ff */
+
#if TARGET_ELF
static unsigned int
rs6000_elf_section_type_flags (tree decl, const char *name, int reloc)
@@ -18142,7 +20427,10 @@ rs6000_xcoff_file_end (void)
static bool
rs6000_binds_local_p (tree decl)
{
- return default_binds_local_p_1 (decl, 0);
+ /* APPLE LOCAL begin kext treat vtables as overridable */
+ return default_binds_local_p_1 (decl,
+ flag_apple_kext && lang_hooks.vtable_p (decl));
+ /* APPLE LOCAL end kext treat vtables as overridable */
}
#endif
@@ -18605,128 +20893,8 @@ rs6000_complex_function_value (enum machine_mode mode)
return gen_rtx_PARALLEL (mode, gen_rtvec (2, r1, r2));
}
-/* Compose a PARALLEL for a darwin64 struct being returned by
- value. */
-
-static rtx
-rs6000_darwin64_function_value (CUMULATIVE_ARGS *cum, tree valtype)
-{
- tree f, ftype;
- rtx rvec[FIRST_PSEUDO_REGISTER], sub, roffset, suboff;
- int k = 0, bytepos, tot, elt, i, subbytepos;
- enum machine_mode fmode;
-
- switch (TREE_CODE (valtype))
- {
- case RECORD_TYPE:
- for (f = TYPE_FIELDS (valtype); f ; f = TREE_CHAIN (f))
- if (TREE_CODE (f) == FIELD_DECL)
- {
- ftype = TREE_TYPE (f);
- fmode = TYPE_MODE (ftype);
- bytepos = int_bit_position (f) / BITS_PER_UNIT;
- if (USE_FP_FOR_ARG_P (cum, fmode, ftype))
- {
- sub = gen_rtx_REG (fmode, cum->fregno++);
- cum->sysv_gregno++;
- }
- else if (USE_ALTIVEC_FOR_ARG_P (cum, fmode, ftype, 1))
- {
- sub = gen_rtx_REG (fmode, cum->vregno++);
- cum->sysv_gregno++;
- }
- else if (fmode == BLKmode
- && (TREE_CODE (ftype) == RECORD_TYPE
- || TREE_CODE (ftype) == ARRAY_TYPE))
- sub = rs6000_darwin64_function_value (cum, ftype);
- else
- sub = gen_rtx_REG (fmode, cum->sysv_gregno++);
- if (sub == NULL_RTX)
- return sub;
- else if (GET_CODE (sub) == PARALLEL)
- {
- for (i = 0; i < XVECLEN (sub, 0); i++)
- {
- rtx subsub = XVECEXP (sub, 0, i);
-
- suboff = XEXP (subsub, 1);
- subbytepos = INTVAL (suboff);
- subbytepos += bytepos;
- roffset = gen_rtx_CONST_INT (SImode, subbytepos);
- subsub = XEXP (subsub, 0);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, subsub, roffset);
- }
- }
- else
- {
- roffset = gen_rtx_CONST_INT (SImode, bytepos);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
- }
- }
- if (k > 0)
- return gen_rtx_PARALLEL (TYPE_MODE (valtype), gen_rtvec_v (k, rvec));
- else
- return NULL_RTX;
-
- case ARRAY_TYPE:
- /* If passing by value won't work, give up. */
- if (int_size_in_bytes (valtype) <= 0)
- return NULL_RTX;
- ftype = TREE_TYPE (valtype);
- fmode = TYPE_MODE (ftype);
- tot = int_size_in_bytes (valtype) / int_size_in_bytes (ftype);
- bytepos = 0;
- for (elt = 0; elt < tot; ++elt)
- {
- if (USE_FP_FOR_ARG_P (cum, fmode, ftype))
- {
- sub = gen_rtx_REG (fmode, cum->fregno++);
- cum->sysv_gregno++;
- }
- else if (USE_ALTIVEC_FOR_ARG_P (cum, fmode, ftype, 1))
- {
- sub = gen_rtx_REG (fmode, cum->vregno++);
- cum->sysv_gregno++;
- }
- else if (fmode == BLKmode
- && (TREE_CODE (ftype) == RECORD_TYPE
- || TREE_CODE (ftype) == ARRAY_TYPE))
- sub = rs6000_darwin64_function_value (cum, ftype);
- else
- sub = gen_rtx_REG (fmode, cum->sysv_gregno++);
- if (sub == NULL_RTX)
- return sub;
- else if (GET_CODE (sub) == PARALLEL)
- {
- for (i = 0; i < XVECLEN (sub, 0); i++)
- {
- rtx subsub = XVECEXP (sub, 0, i);
-
- suboff = XEXP (subsub, 1);
- subbytepos = INTVAL (suboff);
- subbytepos += bytepos;
- roffset = gen_rtx_CONST_INT (SImode, subbytepos);
- subsub = XEXP (subsub, 0);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, subsub, roffset);
- }
- }
- else
- {
- roffset = gen_rtx_CONST_INT (SImode, bytepos);
- rvec[k++] = gen_rtx_EXPR_LIST (VOIDmode, sub, roffset);
- }
- bytepos += int_size_in_bytes (ftype);
- }
- if (k > 0)
- return gen_rtx_PARALLEL (TYPE_MODE (valtype), gen_rtvec_v (k, rvec));
- else
- return NULL_RTX;
-
- default:
- abort ();
- }
-}
-
+/* APPLE LOCAL begin mainline remove rs6000_darwin64_function_value */
+/* APPLE LOCAL end mainline remove rs6000_darwin64_function_value */
/* Define how to find the value returned by a function.
VALTYPE is the data type of the value (as a tree).
If the precise function being called is known, FUNC is its FUNCTION_DECL;
@@ -18744,23 +20912,26 @@ rs6000_function_value (tree valtype, tree func ATTRIBUTE_UNUSED)
unsigned int regno;
/* Special handling for structs in darwin64. */
+ /* APPLE LOCAL begin mainline */
if (rs6000_darwin64_abi
&& TYPE_MODE (valtype) == BLKmode
- && (TREE_CODE (valtype) == RECORD_TYPE
- || TREE_CODE (valtype) == ARRAY_TYPE))
+ && TREE_CODE (valtype) == RECORD_TYPE
+ && int_size_in_bytes (valtype) > 0)
{
CUMULATIVE_ARGS valcum;
rtx valret;
- valcum.sysv_gregno = GP_ARG_RETURN;
+ valcum.words = 0;
valcum.fregno = FP_ARG_MIN_REG;
valcum.vregno = ALTIVEC_ARG_MIN_REG;
- valret = rs6000_darwin64_function_value (&valcum, valtype);
+ /* Do a trial code generation as if this were going to be passed as
+ an argument; if any part goes in memory, we return NULL. */
+ valret = rs6000_darwin64_record_arg (&valcum, valtype, 1, true);
if (valret)
return valret;
/* Otherwise fall through to standard ABI rules. */
}
-
+ /* APPLE LOCAL end mainline */
if (TARGET_32BIT && TARGET_POWERPC64 && TYPE_MODE (valtype) == DImode)
{
/* Long long return value need be split in -mpowerpc64, 32bit ABI. */
@@ -18934,6 +21105,43 @@ rs6000_dbx_register_number (unsigned int regno)
abort ();
}
+/* APPLE LOCAL begin CW asm blocks */
+/* Translate some register names seen in CW asm into GCC standard
+ forms. */
+
+const char *
+rs6000_cw_asm_register_name (const char *regname, char *buf)
+{
+ /* SP is a valid reg name, but asm doesn't like it yet, so translate. */
+ if (strcmp (regname, "sp") == 0)
+ return "r1";
+ if (decode_reg_name (regname) >= 0)
+ return regname;
+ /* Change "gpr0" to "r0". */
+ if (regname[0] == 'g'
+ && regname[1] == 'p'
+ && decode_reg_name (regname + 2) >= 0)
+ return regname + 2;
+ /* Change "fp0" to "f0". */
+ if (regname[0] == 'f' && regname[1] == 'p')
+ {
+ buf[0] = 'f';
+ strcpy (buf + 1, regname + 2);
+ if (decode_reg_name (buf) >= 0)
+ return buf;
+ }
+ if (regname[0] == 's'
+ && regname[1] == 'p'
+ && regname[2] == 'r'
+ )
+ /* Temp hack, return it as a number. */
+ return regname + 3;
+ if (strcmp (regname, "RTOC") == 0)
+ return "r2";
+ return NULL;
+}
+/* APPLE LOCAL end CW asm blocks */
+
/* target hook eh_return_filter_mode */
static enum machine_mode
rs6000_eh_return_filter_mode (void)
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 1a2d12df2ce..5099d87cca2 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -205,6 +205,11 @@ extern int target_flags;
0x00100000, and sysv4.h uses 0x00800000 -> 0x40000000.
0x80000000 is not available because target_flags is signed. */
+/* APPLE LOCAL begin long-branch */
+/* gen call addr in register for >64M range */
+#define MASK_LONG_BRANCH 0x00200000
+/* APPLE LOCAL end long-branch */
+
#define TARGET_POWER (target_flags & MASK_POWER)
#define TARGET_POWER2 (target_flags & MASK_POWER2)
#define TARGET_POWERPC (target_flags & MASK_POWERPC)
@@ -223,6 +228,8 @@ extern int target_flags;
#define TARGET_SCHED_PROLOG (target_flags & MASK_SCHED_PROLOG)
#define TARGET_ALTIVEC (target_flags & MASK_ALTIVEC)
#define TARGET_AIX_STRUCT_RET (target_flags & MASK_AIX_STRUCT_RET)
+/* APPLE LOCAL long-branch */
+#define TARGET_LONG_BRANCH (target_flags & MASK_LONG_BRANCH)
/* Define TARGET_MFCRF if the target assembler supports the optional
field operand for mfcr and the target processor supports the
@@ -468,6 +475,11 @@ enum group_termination
{"longcall", &rs6000_longcall_switch, \
N_("Avoid all range limits on call instructions"), 0}, \
{"no-longcall", &rs6000_longcall_switch, "", 0}, \
+ /* APPLE LOCAL begin long-branch */ \
+ {"long-branch", &rs6000_longcall_switch, \
+ N_("Avoid all range limits on call instructions"), 0}, \
+ {"no-long-branch", &rs6000_longcall_switch, "", 0}, \
+ /* APPLE LOCAL end long-branch */ \
{"warn-altivec-long", &rs6000_warn_altivec_long_switch, \
N_("Warn about deprecated 'vector long ...' AltiVec type usage"), 0}, \
{"no-warn-altivec-long", &rs6000_warn_altivec_long_switch, "", 0}, \
@@ -479,6 +491,11 @@ enum group_termination
N_("Specify alignment of structure fields default/natural"), 0}, \
{"prioritize-restricted-insns=", &rs6000_sched_restricted_insns_priority_str, \
N_("Specify scheduling priority for dispatch slot restricted insns"), 0}, \
+ /* APPLE LOCAL begin AltiVec */ \
+ {"pim-altivec", &rs6000_altivec_pim_switch, \
+ N_("Enable use of Motorola AltiVec PIM operations and predicates"), 0}, \
+ {"no-pim-altivec", &rs6000_altivec_pim_switch, "", 0}, \
+ /* APPLE LOCAL end AltiVec */ \
SUBTARGET_OPTIONS \
}
@@ -541,6 +558,10 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
extern int rs6000_warn_altivec_long;
extern const char *rs6000_warn_altivec_long_switch;
+/* APPLE LOCAL begin AltiVec */
+extern int rs6000_altivec_pim;
+extern const char *rs6000_altivec_pim_switch;
+/* APPLE LOCAL end AltiVec */
/* Alignment options for fields in structures for sub-targets following
AIX-like ABI.
@@ -555,6 +576,10 @@ extern const char *rs6000_warn_altivec_long_switch;
#define MASK_ALIGN_POWER 0x00000000
#define MASK_ALIGN_NATURAL 0x00000001
#define TARGET_ALIGN_NATURAL (rs6000_alignment_flags & MASK_ALIGN_NATURAL)
+/* APPLE LOCAL begin Macintosh alignment 2002-2-26 --ff */
+#define MASK_ALIGN_MAC68K 0x00000002
+#define TARGET_ALIGN_MAC68K (rs6000_alignment_flags & MASK_ALIGN_MAC68K)
+/* APPLE LOCAL end Macintosh alignment 2002-2-26 --ff */
#else
#define TARGET_ALIGN_NATURAL 0
#endif
@@ -734,6 +759,13 @@ extern const char *rs6000_warn_altivec_long_switch;
/* Allocation boundary (in *bits*) for the code of a function. */
#define FUNCTION_BOUNDARY 32
+/* APPLE LOCAL begin Macintosh alignment */
+/* Constants for alignment macros below. */
+#define RS6000_DOUBLE_ALIGNMENT 64
+#define RS6000_LONGLONG_ALIGNMENT 64
+#define RS6000_VECTOR_ALIGNMENT 128
+/* APPLE LOCAL end Macintosh alignment */
+
/* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT 128
@@ -1660,6 +1692,10 @@ typedef struct machine_function GTY(())
{
/* Flags if __builtin_return_address (n) with n >= 1 was used. */
int ra_needs_full_frame;
+ /* APPLE LOCAL begin volatile pic base reg in leaves */
+ /* Substitute PIC register in leaf functions */
+ unsigned int substitute_pic_base_reg;
+ /* APPLE LOCAL end volatile pic base reg in leaves */
/* Some local-dynamic symbol. */
const char *some_ld_name;
/* Whether the instruction chain has been scanned already. */
@@ -1696,6 +1732,11 @@ typedef struct rs6000_args
int stdarg; /* Whether function is a stdarg function. */
int call_cookie; /* Do special things for this call */
int sysv_gregno; /* next available GP register */
+ /* APPLE LOCAL begin mainline */
+ int intoffset; /* running offset in struct (darwin64) */
+ int use_stack; /* any part of struct on stack (darwin64) */
+ int named; /* false for varargs params */
+ /* APPLE LOCAL end mainline */
} CUMULATIVE_ARGS;
/* Initialize a variable CUM of type CUMULATIVE_ARGS
@@ -2512,6 +2553,10 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */
if ((LOG) != 0) \
fprintf (FILE, "\t.align %d\n", (LOG))
+/* APPLE LOCAL begin CW asm blocks */
+#define CW_ASM_REGISTER_NAME(STR, BUF) rs6000_cw_asm_register_name (STR, BUF)
+/* APPLE LOCAL end CW asm blocks */
+
/* Pick up the return address upon entry to a procedure. Used for
dwarf2 unwind information. This also enables the table driven
mechanism. */
@@ -3071,5 +3116,442 @@ enum rs6000_builtins
SPE_BUILTIN_EVMWHGUMIAN,
SPE_BUILTIN_MTSPEFSCR,
SPE_BUILTIN_MFSPEFSCR,
- SPE_BUILTIN_BRINC
+ /* APPLE LOCAL begin AltiVec */
+ SPE_BUILTIN_BRINC,
+
+ /* AltiVec PIM functions, used in Apple AltiVec mode. */
+ ALTIVEC_PIM__FIRST,
+
+ /* PIM Operations. */
+ ALTIVEC_PIM_VEC_ABS = ALTIVEC_PIM__FIRST,
+ ALTIVEC_PIM_VEC_ABS_2,
+ ALTIVEC_PIM_VEC_ABS_3,
+ ALTIVEC_PIM_VEC_ABS_4,
+ ALTIVEC_PIM_VEC_ABSS,
+ ALTIVEC_PIM_VEC_ABSS_2,
+ ALTIVEC_PIM_VEC_ABSS_3,
+ ALTIVEC_PIM_VEC_ADD,
+ ALTIVEC_PIM_VEC_ADD_2,
+ ALTIVEC_PIM_VEC_ADD_3,
+ ALTIVEC_PIM_VEC_ADD_4,
+ ALTIVEC_PIM_VEC_ADDC,
+ ALTIVEC_PIM_VEC_ADDS,
+ ALTIVEC_PIM_VEC_ADDS_2,
+ ALTIVEC_PIM_VEC_ADDS_3,
+ ALTIVEC_PIM_VEC_ADDS_4,
+ ALTIVEC_PIM_VEC_ADDS_5,
+ ALTIVEC_PIM_VEC_ADDS_6,
+ ALTIVEC_PIM_VEC_AND,
+ ALTIVEC_PIM_VEC_ANDC,
+ ALTIVEC_PIM_VEC_AVG,
+ ALTIVEC_PIM_VEC_AVG_2,
+ ALTIVEC_PIM_VEC_AVG_3,
+ ALTIVEC_PIM_VEC_AVG_4,
+ ALTIVEC_PIM_VEC_AVG_5,
+ ALTIVEC_PIM_VEC_AVG_6,
+ ALTIVEC_PIM_VEC_CEIL,
+ ALTIVEC_PIM_VEC_CMPB,
+ ALTIVEC_PIM_VEC_CMPEQ,
+ ALTIVEC_PIM_VEC_CMPEQ_2,
+ ALTIVEC_PIM_VEC_CMPEQ_3,
+ ALTIVEC_PIM_VEC_CMPEQ_4,
+ ALTIVEC_PIM_VEC_CMPGE,
+ ALTIVEC_PIM_VEC_CMPGT,
+ ALTIVEC_PIM_VEC_CMPGT_2,
+ ALTIVEC_PIM_VEC_CMPGT_3,
+ ALTIVEC_PIM_VEC_CMPGT_4,
+ ALTIVEC_PIM_VEC_CMPGT_5,
+ ALTIVEC_PIM_VEC_CMPGT_6,
+ ALTIVEC_PIM_VEC_CMPGT_7,
+ ALTIVEC_PIM_VEC_CMPLE,
+ ALTIVEC_PIM_VEC_CMPLT,
+ ALTIVEC_PIM_VEC_CMPLT_2,
+ ALTIVEC_PIM_VEC_CMPLT_3,
+ ALTIVEC_PIM_VEC_CMPLT_4,
+ ALTIVEC_PIM_VEC_CMPLT_5,
+ ALTIVEC_PIM_VEC_CMPLT_6,
+ ALTIVEC_PIM_VEC_CMPLT_7,
+ ALTIVEC_PIM_VEC_CTF,
+ ALTIVEC_PIM_VEC_CTF_2,
+ ALTIVEC_PIM_VEC_CTS,
+ ALTIVEC_PIM_VEC_CTU,
+ ALTIVEC_PIM_VEC_DSS,
+ ALTIVEC_PIM_VEC_DSSALL,
+ ALTIVEC_PIM_VEC_DST,
+ ALTIVEC_PIM_VEC_DSTST,
+ ALTIVEC_PIM_VEC_DSTSTT,
+ ALTIVEC_PIM_VEC_DSTT,
+ ALTIVEC_PIM_VEC_EXPTE,
+ ALTIVEC_PIM_VEC_FLOOR,
+ ALTIVEC_PIM_VEC_LD,
+ ALTIVEC_PIM_VEC_LDE,
+ ALTIVEC_PIM_VEC_LDE_2,
+ ALTIVEC_PIM_VEC_LDE_3,
+ ALTIVEC_PIM_VEC_LDL,
+ ALTIVEC_PIM_VEC_LOGE,
+ ALTIVEC_PIM_VEC_LVEBX,
+ ALTIVEC_PIM_VEC_LVEHX,
+ ALTIVEC_PIM_VEC_LVEWX,
+ ALTIVEC_PIM_VEC_LVSL,
+ ALTIVEC_PIM_VEC_LVSR,
+ ALTIVEC_PIM_VEC_LVX,
+ ALTIVEC_PIM_VEC_LVXL,
+ ALTIVEC_PIM_VEC_MADD,
+ ALTIVEC_PIM_VEC_MADDS,
+ ALTIVEC_PIM_VEC_MAX,
+ ALTIVEC_PIM_VEC_MAX_2,
+ ALTIVEC_PIM_VEC_MAX_3,
+ ALTIVEC_PIM_VEC_MAX_4,
+ ALTIVEC_PIM_VEC_MAX_5,
+ ALTIVEC_PIM_VEC_MAX_6,
+ ALTIVEC_PIM_VEC_MAX_7,
+ ALTIVEC_PIM_VEC_MERGEH,
+ ALTIVEC_PIM_VEC_MERGEH_2,
+ ALTIVEC_PIM_VEC_MERGEH_3,
+ ALTIVEC_PIM_VEC_MERGEL,
+ ALTIVEC_PIM_VEC_MERGEL_2,
+ ALTIVEC_PIM_VEC_MERGEL_3,
+ ALTIVEC_PIM_VEC_MFVSCR,
+ ALTIVEC_PIM_VEC_MIN,
+ ALTIVEC_PIM_VEC_MIN_2,
+ ALTIVEC_PIM_VEC_MIN_3,
+ ALTIVEC_PIM_VEC_MIN_4,
+ ALTIVEC_PIM_VEC_MIN_5,
+ ALTIVEC_PIM_VEC_MIN_6,
+ ALTIVEC_PIM_VEC_MIN_7,
+ ALTIVEC_PIM_VEC_MLADD,
+ ALTIVEC_PIM_VEC_MLADD_2,
+ ALTIVEC_PIM_VEC_MRADDS,
+ ALTIVEC_PIM_VEC_MSUM,
+ ALTIVEC_PIM_VEC_MSUM_2,
+ ALTIVEC_PIM_VEC_MSUM_3,
+ ALTIVEC_PIM_VEC_MSUM_4,
+ ALTIVEC_PIM_VEC_MSUMS,
+ ALTIVEC_PIM_VEC_MSUMS_2,
+ ALTIVEC_PIM_VEC_MTVSCR,
+ ALTIVEC_PIM_VEC_MULE,
+ ALTIVEC_PIM_VEC_MULE_2,
+ ALTIVEC_PIM_VEC_MULE_3,
+ ALTIVEC_PIM_VEC_MULE_4,
+ ALTIVEC_PIM_VEC_MULO,
+ ALTIVEC_PIM_VEC_MULO_2,
+ ALTIVEC_PIM_VEC_MULO_3,
+ ALTIVEC_PIM_VEC_MULO_4,
+ ALTIVEC_PIM_VEC_NMSUB,
+ ALTIVEC_PIM_VEC_NOR,
+ ALTIVEC_PIM_VEC_OR,
+ ALTIVEC_PIM_VEC_PACK,
+ ALTIVEC_PIM_VEC_PACK_2,
+ ALTIVEC_PIM_VEC_PACKPX,
+ ALTIVEC_PIM_VEC_PACKS,
+ ALTIVEC_PIM_VEC_PACKS_2,
+ ALTIVEC_PIM_VEC_PACKS_3,
+ ALTIVEC_PIM_VEC_PACKS_4,
+ ALTIVEC_PIM_VEC_PACKSU,
+ ALTIVEC_PIM_VEC_PACKSU_2,
+ ALTIVEC_PIM_VEC_PACKSU_3,
+ ALTIVEC_PIM_VEC_PACKSU_4,
+ ALTIVEC_PIM_VEC_PERM,
+ ALTIVEC_PIM_VEC_RE,
+ ALTIVEC_PIM_VEC_RL,
+ ALTIVEC_PIM_VEC_RL_2,
+ ALTIVEC_PIM_VEC_RL_3,
+ ALTIVEC_PIM_VEC_ROUND,
+ ALTIVEC_PIM_VEC_RSQRTE,
+ ALTIVEC_PIM_VEC_SEL,
+ ALTIVEC_PIM_VEC_SL,
+ ALTIVEC_PIM_VEC_SL_2,
+ ALTIVEC_PIM_VEC_SL_3,
+ ALTIVEC_PIM_VEC_SLD,
+ ALTIVEC_PIM_VEC_SLL,
+ ALTIVEC_PIM_VEC_SLO,
+ ALTIVEC_PIM_VEC_SPLAT,
+ ALTIVEC_PIM_VEC_SPLAT_2,
+ ALTIVEC_PIM_VEC_SPLAT_3,
+ ALTIVEC_PIM_VEC_SPLAT_S8,
+ ALTIVEC_PIM_VEC_SPLAT_S16,
+ ALTIVEC_PIM_VEC_SPLAT_S32,
+ ALTIVEC_PIM_VEC_SPLAT_U8,
+ ALTIVEC_PIM_VEC_SPLAT_U16,
+ ALTIVEC_PIM_VEC_SPLAT_U32,
+ ALTIVEC_PIM_VEC_SR,
+ ALTIVEC_PIM_VEC_SR_2,
+ ALTIVEC_PIM_VEC_SR_3,
+ ALTIVEC_PIM_VEC_SRA,
+ ALTIVEC_PIM_VEC_SRA_2,
+ ALTIVEC_PIM_VEC_SRA_3,
+ ALTIVEC_PIM_VEC_SRL,
+ ALTIVEC_PIM_VEC_SRO,
+ ALTIVEC_PIM_VEC_ST,
+ ALTIVEC_PIM_VEC_STE,
+ ALTIVEC_PIM_VEC_STE_2,
+ ALTIVEC_PIM_VEC_STE_3,
+ ALTIVEC_PIM_VEC_STL,
+ ALTIVEC_PIM_VEC_STVEBX,
+ ALTIVEC_PIM_VEC_STVEHX,
+ ALTIVEC_PIM_VEC_STVEWX,
+ ALTIVEC_PIM_VEC_STVX,
+ ALTIVEC_PIM_VEC_STVXL,
+ ALTIVEC_PIM_VEC_SUB,
+ ALTIVEC_PIM_VEC_SUB_2,
+ ALTIVEC_PIM_VEC_SUB_3,
+ ALTIVEC_PIM_VEC_SUB_4,
+ ALTIVEC_PIM_VEC_SUBC,
+ ALTIVEC_PIM_VEC_SUBS,
+ ALTIVEC_PIM_VEC_SUBS_2,
+ ALTIVEC_PIM_VEC_SUBS_3,
+ ALTIVEC_PIM_VEC_SUBS_4,
+ ALTIVEC_PIM_VEC_SUBS_5,
+ ALTIVEC_PIM_VEC_SUBS_6,
+ ALTIVEC_PIM_VEC_SUM4S,
+ ALTIVEC_PIM_VEC_SUM4S_2,
+ ALTIVEC_PIM_VEC_SUM4S_3,
+ ALTIVEC_PIM_VEC_SUM2S,
+ ALTIVEC_PIM_VEC_SUMS,
+ ALTIVEC_PIM_VEC_TRUNC,
+ ALTIVEC_PIM_VEC_UNPACKH,
+ ALTIVEC_PIM_VEC_UNPACKH_2,
+ ALTIVEC_PIM_VEC_UNPACKH_3,
+ ALTIVEC_PIM_VEC_UNPACKL,
+ ALTIVEC_PIM_VEC_UNPACKL_2,
+ ALTIVEC_PIM_VEC_UNPACKL_3,
+ ALTIVEC_PIM_VEC_VADDCUW,
+ ALTIVEC_PIM_VEC_VADDFP,
+ ALTIVEC_PIM_VEC_VADDSBS,
+ ALTIVEC_PIM_VEC_VADDSHS,
+ ALTIVEC_PIM_VEC_VADDSWS,
+ ALTIVEC_PIM_VEC_VADDUBM,
+ ALTIVEC_PIM_VEC_VADDUBS,
+ ALTIVEC_PIM_VEC_VADDUHM,
+ ALTIVEC_PIM_VEC_VADDUHS,
+ ALTIVEC_PIM_VEC_VADDUWM,
+ ALTIVEC_PIM_VEC_VADDUWS,
+ ALTIVEC_PIM_VEC_VAND,
+ ALTIVEC_PIM_VEC_VANDC,
+ ALTIVEC_PIM_VEC_VAVGSB,
+ ALTIVEC_PIM_VEC_VAVGSH,
+ ALTIVEC_PIM_VEC_VAVGSW,
+ ALTIVEC_PIM_VEC_VAVGUB,
+ ALTIVEC_PIM_VEC_VAVGUH,
+ ALTIVEC_PIM_VEC_VAVGUW,
+ ALTIVEC_PIM_VEC_VCFSX,
+ ALTIVEC_PIM_VEC_VCFUX,
+ ALTIVEC_PIM_VEC_VCMPBFP,
+ ALTIVEC_PIM_VEC_VCMPEQFP,
+ ALTIVEC_PIM_VEC_VCMPEQUB,
+ ALTIVEC_PIM_VEC_VCMPEQUH,
+ ALTIVEC_PIM_VEC_VCMPEQUW,
+ ALTIVEC_PIM_VEC_VCMPGEFP,
+ ALTIVEC_PIM_VEC_VCMPGTFP,
+ ALTIVEC_PIM_VEC_VCMPGTSB,
+ ALTIVEC_PIM_VEC_VCMPGTSH,
+ ALTIVEC_PIM_VEC_VCMPGTSW,
+ ALTIVEC_PIM_VEC_VCMPGTUB,
+ ALTIVEC_PIM_VEC_VCMPGTUH,
+ ALTIVEC_PIM_VEC_VCMPGTUW,
+ ALTIVEC_PIM_VEC_VCTSXS,
+ ALTIVEC_PIM_VEC_VCTUXS,
+ ALTIVEC_PIM_VEC_VEXPTEFP,
+ ALTIVEC_PIM_VEC_VLOGEFP,
+ ALTIVEC_PIM_VEC_VMADDFP,
+ ALTIVEC_PIM_VEC_VMAXFP,
+ ALTIVEC_PIM_VEC_VMAXSB,
+ ALTIVEC_PIM_VEC_VMAXSH,
+ ALTIVEC_PIM_VEC_VMAXSW,
+ ALTIVEC_PIM_VEC_VMAXUB,
+ ALTIVEC_PIM_VEC_VMAXUH,
+ ALTIVEC_PIM_VEC_VMAXUW,
+ ALTIVEC_PIM_VEC_VMHADDSHS,
+ ALTIVEC_PIM_VEC_VMHRADDSHS,
+ ALTIVEC_PIM_VEC_VMINFP,
+ ALTIVEC_PIM_VEC_VMINSB,
+ ALTIVEC_PIM_VEC_VMINSH,
+ ALTIVEC_PIM_VEC_VMINSW,
+ ALTIVEC_PIM_VEC_VMINUB,
+ ALTIVEC_PIM_VEC_VMINUH,
+ ALTIVEC_PIM_VEC_VMINUW,
+ ALTIVEC_PIM_VEC_VMLADDUHM,
+ ALTIVEC_PIM_VEC_VMRGHB,
+ ALTIVEC_PIM_VEC_VMRGHH,
+ ALTIVEC_PIM_VEC_VMRGHW,
+ ALTIVEC_PIM_VEC_VMRGLB,
+ ALTIVEC_PIM_VEC_VMRGLH,
+ ALTIVEC_PIM_VEC_VMRGLW,
+ ALTIVEC_PIM_VEC_VMSUMMBM,
+ ALTIVEC_PIM_VEC_VMSUMSHM,
+ ALTIVEC_PIM_VEC_VMSUMSHS,
+ ALTIVEC_PIM_VEC_VMSUMUBM,
+ ALTIVEC_PIM_VEC_VMSUMUHM,
+ ALTIVEC_PIM_VEC_VMSUMUHS,
+ ALTIVEC_PIM_VEC_VMULESB,
+ ALTIVEC_PIM_VEC_VMULESH,
+ ALTIVEC_PIM_VEC_VMULEUB,
+ ALTIVEC_PIM_VEC_VMULEUH,
+ ALTIVEC_PIM_VEC_VMULOSB,
+ ALTIVEC_PIM_VEC_VMULOSH,
+ ALTIVEC_PIM_VEC_VMULOUB,
+ ALTIVEC_PIM_VEC_VMULOUH,
+ ALTIVEC_PIM_VEC_VNMSUBFP,
+ ALTIVEC_PIM_VEC_VNOR,
+ ALTIVEC_PIM_VEC_VOR,
+ ALTIVEC_PIM_VEC_VPERM,
+ ALTIVEC_PIM_VEC_VPKPX,
+ ALTIVEC_PIM_VEC_VPKSHSS,
+ ALTIVEC_PIM_VEC_VPKSHUS,
+ ALTIVEC_PIM_VEC_VPKSWSS,
+ ALTIVEC_PIM_VEC_VPKSWUS,
+ ALTIVEC_PIM_VEC_VPKUHUM,
+ ALTIVEC_PIM_VEC_VPKUHUS,
+ ALTIVEC_PIM_VEC_VPKUWUM,
+ ALTIVEC_PIM_VEC_VPKUWUS,
+ ALTIVEC_PIM_VEC_VREFP,
+ ALTIVEC_PIM_VEC_VRFIM,
+ ALTIVEC_PIM_VEC_VRFIN,
+ ALTIVEC_PIM_VEC_VRFIP,
+ ALTIVEC_PIM_VEC_VRFIZ,
+ ALTIVEC_PIM_VEC_VRLB,
+ ALTIVEC_PIM_VEC_VRLH,
+ ALTIVEC_PIM_VEC_VRLW,
+ ALTIVEC_PIM_VEC_VRSQRTEFP,
+ ALTIVEC_PIM_VEC_VSEL,
+ ALTIVEC_PIM_VEC_VSL,
+ ALTIVEC_PIM_VEC_VSLB,
+ ALTIVEC_PIM_VEC_VSLDOI,
+ ALTIVEC_PIM_VEC_VSLH,
+ ALTIVEC_PIM_VEC_VSLO,
+ ALTIVEC_PIM_VEC_VSLW,
+ ALTIVEC_PIM_VEC_VSPLTB,
+ ALTIVEC_PIM_VEC_VSPLTH,
+ ALTIVEC_PIM_VEC_VSPLTISB,
+ ALTIVEC_PIM_VEC_VSPLTISH,
+ ALTIVEC_PIM_VEC_VSPLTISW,
+ ALTIVEC_PIM_VEC_VSPLTW,
+ ALTIVEC_PIM_VEC_VSR,
+ ALTIVEC_PIM_VEC_VSRAB,
+ ALTIVEC_PIM_VEC_VSRAH,
+ ALTIVEC_PIM_VEC_VSRAW,
+ ALTIVEC_PIM_VEC_VSRB,
+ ALTIVEC_PIM_VEC_VSRH,
+ ALTIVEC_PIM_VEC_VSRO,
+ ALTIVEC_PIM_VEC_VSRW,
+ ALTIVEC_PIM_VEC_VSUBCUW,
+ ALTIVEC_PIM_VEC_VSUBFP,
+ ALTIVEC_PIM_VEC_VSUBSBS,
+ ALTIVEC_PIM_VEC_VSUBSHS,
+ ALTIVEC_PIM_VEC_VSUBSWS,
+ ALTIVEC_PIM_VEC_VSUBUBM,
+ ALTIVEC_PIM_VEC_VSUBUBS,
+ ALTIVEC_PIM_VEC_VSUBUHM,
+ ALTIVEC_PIM_VEC_VSUBUHS,
+ ALTIVEC_PIM_VEC_VSUBUWM,
+ ALTIVEC_PIM_VEC_VSUBUWS,
+ ALTIVEC_PIM_VEC_VSUM4SBS,
+ ALTIVEC_PIM_VEC_VSUM4SHS,
+ ALTIVEC_PIM_VEC_VSUM4UBS,
+ ALTIVEC_PIM_VEC_VSUM2SWS,
+ ALTIVEC_PIM_VEC_VSUMSWS,
+ ALTIVEC_PIM_VEC_VUPKHPX,
+ ALTIVEC_PIM_VEC_VUPKHSB,
+ ALTIVEC_PIM_VEC_VUPKHSH,
+ ALTIVEC_PIM_VEC_VUPKLPX,
+ ALTIVEC_PIM_VEC_VUPKLSB,
+ ALTIVEC_PIM_VEC_VUPKLSH,
+ ALTIVEC_PIM_VEC_VXOR,
+ ALTIVEC_PIM_VEC_XOR,
+
+ /* PIM Predicates. */
+ ALTIVEC_PIM_VEC_ALL_EQ,
+ ALTIVEC_PIM_VEC_ALL_EQ_2,
+ ALTIVEC_PIM_VEC_ALL_EQ_3,
+ ALTIVEC_PIM_VEC_ALL_EQ_4,
+ ALTIVEC_PIM_VEC_ALL_GE,
+ ALTIVEC_PIM_VEC_ALL_GE_2,
+ ALTIVEC_PIM_VEC_ALL_GE_3,
+ ALTIVEC_PIM_VEC_ALL_GE_4,
+ ALTIVEC_PIM_VEC_ALL_GE_5,
+ ALTIVEC_PIM_VEC_ALL_GE_6,
+ ALTIVEC_PIM_VEC_ALL_GE_7,
+ ALTIVEC_PIM_VEC_ALL_GT,
+ ALTIVEC_PIM_VEC_ALL_GT_2,
+ ALTIVEC_PIM_VEC_ALL_GT_3,
+ ALTIVEC_PIM_VEC_ALL_GT_4,
+ ALTIVEC_PIM_VEC_ALL_GT_5,
+ ALTIVEC_PIM_VEC_ALL_GT_6,
+ ALTIVEC_PIM_VEC_ALL_GT_7,
+ ALTIVEC_PIM_VEC_ALL_IN,
+ ALTIVEC_PIM_VEC_ALL_LE,
+ ALTIVEC_PIM_VEC_ALL_LE_2,
+ ALTIVEC_PIM_VEC_ALL_LE_3,
+ ALTIVEC_PIM_VEC_ALL_LE_4,
+ ALTIVEC_PIM_VEC_ALL_LE_5,
+ ALTIVEC_PIM_VEC_ALL_LE_6,
+ ALTIVEC_PIM_VEC_ALL_LE_7,
+ ALTIVEC_PIM_VEC_ALL_LT,
+ ALTIVEC_PIM_VEC_ALL_LT_2,
+ ALTIVEC_PIM_VEC_ALL_LT_3,
+ ALTIVEC_PIM_VEC_ALL_LT_4,
+ ALTIVEC_PIM_VEC_ALL_LT_5,
+ ALTIVEC_PIM_VEC_ALL_LT_6,
+ ALTIVEC_PIM_VEC_ALL_LT_7,
+ ALTIVEC_PIM_VEC_ALL_NAN,
+ ALTIVEC_PIM_VEC_ALL_NE,
+ ALTIVEC_PIM_VEC_ALL_NE_2,
+ ALTIVEC_PIM_VEC_ALL_NE_3,
+ ALTIVEC_PIM_VEC_ALL_NE_4,
+ ALTIVEC_PIM_VEC_ALL_NGE,
+ ALTIVEC_PIM_VEC_ALL_NGT,
+ ALTIVEC_PIM_VEC_ALL_NLE,
+ ALTIVEC_PIM_VEC_ALL_NLT,
+ ALTIVEC_PIM_VEC_ALL_NUMERIC,
+ ALTIVEC_PIM_VEC_ANY_EQ,
+ ALTIVEC_PIM_VEC_ANY_EQ_2,
+ ALTIVEC_PIM_VEC_ANY_EQ_3,
+ ALTIVEC_PIM_VEC_ANY_EQ_4,
+ ALTIVEC_PIM_VEC_ANY_GE,
+ ALTIVEC_PIM_VEC_ANY_GE_2,
+ ALTIVEC_PIM_VEC_ANY_GE_3,
+ ALTIVEC_PIM_VEC_ANY_GE_4,
+ ALTIVEC_PIM_VEC_ANY_GE_5,
+ ALTIVEC_PIM_VEC_ANY_GE_6,
+ ALTIVEC_PIM_VEC_ANY_GE_7,
+ ALTIVEC_PIM_VEC_ANY_GT,
+ ALTIVEC_PIM_VEC_ANY_GT_2,
+ ALTIVEC_PIM_VEC_ANY_GT_3,
+ ALTIVEC_PIM_VEC_ANY_GT_4,
+ ALTIVEC_PIM_VEC_ANY_GT_5,
+ ALTIVEC_PIM_VEC_ANY_GT_6,
+ ALTIVEC_PIM_VEC_ANY_GT_7,
+ ALTIVEC_PIM_VEC_ANY_LE,
+ ALTIVEC_PIM_VEC_ANY_LE_2,
+ ALTIVEC_PIM_VEC_ANY_LE_3,
+ ALTIVEC_PIM_VEC_ANY_LE_4,
+ ALTIVEC_PIM_VEC_ANY_LE_5,
+ ALTIVEC_PIM_VEC_ANY_LE_6,
+ ALTIVEC_PIM_VEC_ANY_LE_7,
+ ALTIVEC_PIM_VEC_ANY_LT,
+ ALTIVEC_PIM_VEC_ANY_LT_2,
+ ALTIVEC_PIM_VEC_ANY_LT_3,
+ ALTIVEC_PIM_VEC_ANY_LT_4,
+ ALTIVEC_PIM_VEC_ANY_LT_5,
+ ALTIVEC_PIM_VEC_ANY_LT_6,
+ ALTIVEC_PIM_VEC_ANY_LT_7,
+ ALTIVEC_PIM_VEC_ANY_NAN,
+ ALTIVEC_PIM_VEC_ANY_NE,
+ ALTIVEC_PIM_VEC_ANY_NE_2,
+ ALTIVEC_PIM_VEC_ANY_NE_3,
+ ALTIVEC_PIM_VEC_ANY_NE_4,
+ ALTIVEC_PIM_VEC_ANY_NGE,
+ ALTIVEC_PIM_VEC_ANY_NGT,
+ ALTIVEC_PIM_VEC_ANY_NLE,
+ ALTIVEC_PIM_VEC_ANY_NLT,
+ ALTIVEC_PIM_VEC_ANY_NUMERIC,
+ ALTIVEC_PIM_VEC_ANY_OUT,
+
+ ALTIVEC_PIM__LAST = ALTIVEC_PIM_VEC_ANY_OUT,
+ /* APPLE LOCAL end AltiVec */
+
+ /* APPLE LOCAL begin constant cfstrings */
+ RS6000_BUILTIN_MAX,
+ TARGET_BUILTIN_MAX = RS6000_BUILTIN_MAX
+ /* APPLE LOCAL end constant cfstrings */
};
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 3fdb165dd41..0e6b0de5a1c 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -4622,8 +4622,8 @@
(minus:SF (mult:SF (neg:SF (match_operand:SF 1 "gpc_reg_operand" "f"))
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f")))]
- "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
- && ! HONOR_SIGNED_ZEROS (SFmode)"
+;; APPLE LOCAL do this even if honoring siged zeros
+ "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"fnmadds %0,%1,%2,%3"
[(set_attr "type" "fp")])
@@ -4641,8 +4641,8 @@
(minus:SF (mult:SF (neg:SF (match_operand:SF 1 "gpc_reg_operand" "f"))
(match_operand:SF 2 "gpc_reg_operand" "f"))
(match_operand:SF 3 "gpc_reg_operand" "f")))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
- && ! HONOR_SIGNED_ZEROS (SFmode)"
+;; APPLE LOCAL do this even if honoring siged zeros
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"{fnma|fnmadd} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
@@ -4661,8 +4661,8 @@
(minus:SF (match_operand:SF 3 "gpc_reg_operand" "f")
(mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))))]
- "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
- && ! HONOR_SIGNED_ZEROS (SFmode)"
+;; APPLE LOCAL do this even if honoring siged zeros
+ "TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"fnmsubs %0,%1,%2,%3"
[(set_attr "type" "fp")])
@@ -4680,8 +4680,8 @@
(minus:SF (match_operand:SF 3 "gpc_reg_operand" "f")
(mult:SF (match_operand:SF 1 "gpc_reg_operand" "%f")
(match_operand:SF 2 "gpc_reg_operand" "f"))))]
- "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
- && ! HONOR_SIGNED_ZEROS (SFmode)"
+;; APPLE LOCAL do this even if honoring siged zeros
+ "! TARGET_POWERPC && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"{fnms|fnmsub} %0,%1,%2,%3"
[(set_attr "type" "fp")])
@@ -4984,8 +4984,8 @@
(minus:DF (mult:DF (neg:DF (match_operand:DF 1 "gpc_reg_operand" "f"))
(match_operand:DF 2 "gpc_reg_operand" "f"))
(match_operand:DF 3 "gpc_reg_operand" "f")))]
- "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
- && ! HONOR_SIGNED_ZEROS (DFmode)"
+;; APPLE LOCAL do this even if honoring siged zeros
+ "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"{fnma|fnmadd} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
@@ -5004,8 +5004,8 @@
(minus:DF (match_operand:DF 3 "gpc_reg_operand" "f")
(mult:DF (match_operand:DF 1 "gpc_reg_operand" "%f")
(match_operand:DF 2 "gpc_reg_operand" "f"))))]
- "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD
- && ! HONOR_SIGNED_ZEROS (DFmode)"
+;; APPLE LOCAL do this even if honoring siged zeros
+ "TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_FUSED_MADD"
"{fnms|fnmsub} %0,%1,%2,%3"
[(set_attr "type" "dmul")])
@@ -5121,7 +5121,12 @@
}
if (TARGET_POWERPC64)
{
- rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
+ /* APPLE LOCAL begin assign_stack_local_with_alias scheduling speedup */
+ /* assign_stack_local_with_alias is used instead of assign_stack_temp
+ * to get better scheduling, at the cost of some stack space. */
+ rtx mem = assign_stack_local_with_alias (DImode, GET_MODE_SIZE (DImode),
+ GET_MODE_ALIGNMENT (DImode));
+ /* APPLE LOCAL end assign_stack_local_with_alias scheduling speedup */
rtx t1 = gen_reg_rtx (DImode);
rtx t2 = gen_reg_rtx (DImode);
emit_insn (gen_floatsidf_ppc64 (operands[0], operands[1], mem, t1, t2));
@@ -5130,7 +5135,12 @@
operands[2] = force_reg (SImode, GEN_INT (0x43300000));
operands[3] = force_reg (DFmode, CONST_DOUBLE_ATOF (\"4503601774854144\", DFmode));
- operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0);
+ /* APPLE LOCAL begin assign_stack_local_with_alias scheduling speedup */
+ /* assign_stack_local_with_alias is used instead of assign_stack_temp to get
+ * better scheduling, at the cost of some stack space. */
+ operands[4] = assign_stack_local_with_alias (DFmode, GET_MODE_SIZE (DFmode),
+ GET_MODE_ALIGNMENT (DFmode));
+ /* APPLE LOCAL end assign_stack_local_with_alias scheduling speedup */
operands[5] = gen_reg_rtx (DFmode);
operands[6] = gen_reg_rtx (SImode);
}")
@@ -5208,7 +5218,12 @@
}
if (TARGET_POWERPC64)
{
- rtx mem = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
+ /* APPLE LOCAL begin assign_stack_local_with_alias scheduling speedup */
+ /* assign_stack_local_with_alias is used instead of assign_stack_temp
+ * to get better scheduling, at the cost of some stack space. */
+ rtx mem = assign_stack_local_with_alias (DImode, GET_MODE_SIZE (DImode),
+ GET_MODE_ALIGNMENT (DImode));
+ /* APPLE LOCAL end assign_stack_local_with_alias scheduling speedup */
rtx t1 = gen_reg_rtx (DImode);
rtx t2 = gen_reg_rtx (DImode);
emit_insn (gen_floatunssidf_ppc64 (operands[0], operands[1], mem,
@@ -5218,7 +5233,12 @@
operands[2] = force_reg (SImode, GEN_INT (0x43300000));
operands[3] = force_reg (DFmode, CONST_DOUBLE_ATOF (\"4503599627370496\", DFmode));
- operands[4] = assign_stack_temp (DFmode, GET_MODE_SIZE (DFmode), 0);
+ /* APPLE LOCAL begin assign_stack_local_with_alias scheduling speedup */
+ /* assign_stack_local_with_alias is used instead of assign_stack_temp
+ * to get better scheduling, at the cost of some stack space. */
+ operands[4] = assign_stack_local_with_alias (DFmode, GET_MODE_SIZE (DFmode),
+ GET_MODE_ALIGNMENT (DFmode));
+ /* APPLE LOCAL end assign_stack_local_with_alias scheduling speedup */
operands[5] = gen_reg_rtx (DFmode);
}")
@@ -5282,7 +5302,12 @@
DONE;
}
operands[2] = gen_reg_rtx (DImode);
- operands[3] = assign_stack_temp (DImode, GET_MODE_SIZE (DImode), 0);
+ /* APPLE LOCAL begin assign_stack_local_with_alias scheduling speedup */
+ /* assign_stack_local_with_alias is used instead of assign_stack_temp
+ * to get better scheduling, at the cost of some stack space. */
+ operands[3] = assign_stack_local_with_alias (DImode, GET_MODE_SIZE (DImode),
+ GET_MODE_ALIGNMENT (DImode));
+ /* APPLE LOCAL end assign_stack_local_with_alias scheduling speedup */
}")
(define_insn "*fix_truncdfsi2_internal"
@@ -10406,6 +10431,13 @@
else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
output_asm_insn (\"creqv 6,6,6\", operands);
+/* APPLE LOCAL begin -mlongcall */
+#ifdef RS6000_LONG_BRANCH
+ if (!flag_pic)
+ return output_call(insn, operands, 0, 0);
+ else
+#endif
+/* APPLE LOCAL end -mlongcall */
return (DEFAULT_ABI == ABI_V4 && flag_pic) ? \"bl %z0@local\" : \"bl %z0\";
}"
[(set_attr "type" "branch")
@@ -10588,11 +10620,12 @@
;; operands[2] is the value FUNCTION_ARG returns for the VOID argument
;; which indicates how to set cr1
+;; APPLE LOCAL begin separate cl into c,*l; switch and attr's expanded to match
(define_insn "*call_indirect_nonlocal_sysv"
- [(call (mem:SI (match_operand:SI 0 "register_operand" "cl,cl"))
- (match_operand 1 "" "g,g"))
- (use (match_operand:SI 2 "immediate_operand" "O,n"))
- (clobber (match_scratch:SI 3 "=l,l"))]
+ [(call (mem:SI (match_operand:SI 0 "register_operand" "c,*l,c,*l"))
+ (match_operand 1 "" "g,g,g,g"))
+ (use (match_operand:SI 2 "immediate_operand" "O,O,n,n"))
+ (clobber (match_scratch:SI 3 "=l,l,l,l"))]
"DEFAULT_ABI == ABI_V4
|| DEFAULT_ABI == ABI_DARWIN"
{
@@ -10604,8 +10637,9 @@
return "b%T0l";
}
- [(set_attr "type" "jmpreg,jmpreg")
- (set_attr "length" "4,8")])
+ [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg")
+ (set_attr "length" "4,4,8,8")])
+;; APPLE LOCAL end separate cl into c,*l; switch and attr's expanded to match
(define_insn "*call_nonlocal_sysv"
[(call (mem:SI (match_operand:SI 0 "symbol_ref_operand" "s,s"))
@@ -10622,6 +10656,21 @@
else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
output_asm_insn ("creqv 6,6,6", operands);
+ /* APPLE LOCAL begin ObjC direct dispatch. */
+ /* Generate 'bla' instruction for functions with hard-coded addresses. */
+ if (DEFAULT_ABI == ABI_DARWIN)
+ {
+ rtx note = find_reg_note (insn, REG_ABSCALL, NULL_RTX);
+ static char buf[256];
+ if (note)
+ {
+ sprintf (buf, \"bla \" HOST_WIDE_INT_PRINT_HEX,
+ INTVAL (XEXP (note, 0)));
+ return buf;
+ }
+ }
+ /* APPLE LOCAL end ObjC direct dispatch. */
+
#if TARGET_MACHO
return output_call(insn, operands, 0, 2);
#else
@@ -10631,12 +10680,13 @@
[(set_attr "type" "branch,branch")
(set_attr "length" "4,8")])
+;; APPLE LOCAL begin separate cl into c,*l; switch and attr's expanded to match
(define_insn "*call_value_indirect_nonlocal_sysv"
[(set (match_operand 0 "" "")
- (call (mem:SI (match_operand:SI 1 "register_operand" "cl,cl"))
- (match_operand 2 "" "g,g")))
- (use (match_operand:SI 3 "immediate_operand" "O,n"))
- (clobber (match_scratch:SI 4 "=l,l"))]
+ (call (mem:SI (match_operand:SI 1 "register_operand" "c,*l,c,*l"))
+ (match_operand 2 "" "g,g,g,g")))
+ (use (match_operand:SI 3 "immediate_operand" "O,O,n,n"))
+ (clobber (match_scratch:SI 4 "=l,l,l,l"))]
"DEFAULT_ABI == ABI_V4
|| DEFAULT_ABI == ABI_DARWIN"
{
@@ -10648,8 +10698,9 @@
return "b%T1l";
}
- [(set_attr "type" "jmpreg,jmpreg")
- (set_attr "length" "4,8")])
+ [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg")
+ (set_attr "length" "4,4,8,8")])
+;; APPLE LOCAL end separate cl into c,*l; switch and attr's expanded to match
(define_insn "*call_value_nonlocal_sysv"
[(set (match_operand 0 "" "")
@@ -10667,6 +10718,21 @@
else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
output_asm_insn ("creqv 6,6,6", operands);
+ /* APPLE LOCAL begin ObjC direct dispatch. */
+ /* Generate 'bla' instruction for functions with hard-coded addresses. */
+ if (DEFAULT_ABI == ABI_DARWIN)
+ {
+ rtx note = find_reg_note (insn, REG_ABSCALL, NULL_RTX);
+ static char buf[256];
+ if (note)
+ {
+ sprintf (buf, \"bla \" HOST_WIDE_INT_PRINT_HEX,
+ INTVAL (XEXP (note, 0)));
+ return buf;
+ }
+ }
+ /* APPLE LOCAL end ObjC direct dispatch. */
+
#if TARGET_MACHO
return output_call(insn, operands, 1, 3);
#else
@@ -10704,6 +10770,86 @@
DONE;
}")
+;; APPLE LOCAL begin sibcall patterns
+;; APPLE MERGE modify FSF patterns below instead?
+;; this and similar patterns must be marked as using LR, otherwise
+;; dataflow will try to delete the store into it. This is true
+;; even when the actual reg to jump to is in CTR, when LR was
+;; saved and restored around the PIC-setting BCL.
+(define_insn "*sibcall_symbolic"
+ [(call (mem:SI (match_operand:SI 0 "call_operand" "s,c"))
+ (match_operand 1 "" ""))
+ (use (match_operand 2 "" ""))
+ (use (match_operand:SI 3 "register_operand" "l,l"))
+ (return)]
+ "! TARGET_64BIT && DEFAULT_ABI == ABI_DARWIN"
+ "*
+{
+ /* APPLE LOCAL begin ObjC direct dispatch */
+ /* Generate 'ba' instruction for functions with hard-coded addresses. */
+ if (DEFAULT_ABI == ABI_DARWIN)
+ {
+ rtx note = find_reg_note (insn, REG_ABSCALL, NULL_RTX);
+ static char buf[256];
+ if (note)
+ {
+ if (which_alternative != 0)
+ abort ();
+ sprintf (buf, \"ba \" HOST_WIDE_INT_PRINT_HEX,
+ INTVAL (XEXP (note, 0)));
+ return buf;
+ }
+ }
+ /* APPLE LOCAL end ObjC direct dispatch */
+
+ switch (which_alternative)
+ {
+ case 0: return \"b %z0\";
+ case 1: return \"b%T0\";
+ default: abort();
+ }
+}"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
+(define_insn "*sibcall_value_symbolic"
+ [(set (match_operand 0 "" "")
+ (call (mem:SI (match_operand:SI 1 "call_operand" "s,c"))
+ (match_operand 2 "" "")))
+ (use (match_operand:SI 3 "" ""))
+ (use (match_operand:SI 4 "register_operand" "l,l"))
+ (return)]
+ "! TARGET_64BIT && DEFAULT_ABI == ABI_DARWIN"
+ "*
+{
+ /* APPLE LOCAL begin ObjC direct dispatch */
+ /* Generate 'ba' instruction for functions with hard-coded addresses. */
+ if (DEFAULT_ABI == ABI_DARWIN)
+ {
+ rtx note = find_reg_note (insn, REG_ABSCALL, NULL_RTX);
+ static char buf[256];
+ if (note)
+ {
+ if (which_alternative != 0)
+ abort ();
+ sprintf (buf, \"ba \" HOST_WIDE_INT_PRINT_HEX,
+ INTVAL (XEXP (note, 0)));
+ return buf;
+ }
+ }
+ /* APPLE LOCAL end ObjC direct dispatch */
+
+ switch (which_alternative)
+ {
+ case 0: return \"b %z1\";
+ case 1: return \"b%T1\";
+ default: abort();
+ }
+}"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+;; APPLE LOCAL end sibcall patterns
+
;; sibling call patterns
(define_expand "sibcall"
[(parallel [(call (mem:SI (match_operand 0 "address_operand" ""))
@@ -14554,6 +14700,35 @@
[(set_attr "type" "branch")
(set_attr "length" "4")])
+/* APPLE LOCAL begin unnamed*/
+(define_insn "*save_fpregs_with_label_si"
+ [(match_parallel 0 "any_parallel_operand"
+ [(clobber (match_operand:SI 1 "register_operand" "=l"))
+ (use (match_operand:SI 2 "call_operand" "s"))
+ (use (match_operand:SI 3 "" ""))
+ (set (match_operand:DF 4 "memory_operand" "=m")
+ (match_operand:DF 5 "gpc_reg_operand" "f"))])]
+ "TARGET_32BIT"
+ "*
+#if TARGET_MACHO
+ const char *picbase = machopic_function_base_name ();
+ char *tmp;
+ operands[3] = gen_rtx_SYMBOL_REF (Pmode, ggc_alloc_string (picbase, -1));
+ if (TARGET_LONG_BRANCH)
+ {
+ tmp = ggc_alloc (strlen (XSTR (operands[2], 0)) + strlen (XSTR (operands[3], 0)) + 2);
+ strcpy (tmp, output_call(insn, operands, 2, 2));
+ strcat (tmp, \"\\n%3:\");
+ return tmp;
+ }
+ else
+#endif
+ return \"bl %z2\\n%3:\";
+"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+/* APPLE LOCAL end unnamed */
+
(define_insn "*save_fpregs_di"
[(match_parallel 0 "any_parallel_operand"
[(clobber (match_operand:DI 1 "register_operand" "=l"))
@@ -14661,7 +14836,16 @@
(set (match_operand:DF 3 "gpc_reg_operand" "=f")
(match_operand:DF 4 "memory_operand" "m"))])]
"TARGET_32BIT"
- "b %z2")
+; APPLE LOCAL begin -mlongcall
+ {
+#if TARGET_MACHO
+ if (TARGET_LONG_BRANCH)
+ return output_call(insn, operands, 2, 2);
+ else
+#endif
+ return "b %z2";
+ })
+; APPLE LOCAL end -mlongcall
(define_insn "*return_and_restore_fpregs_di"
[(match_parallel 0 "any_parallel_operand"
@@ -14671,7 +14855,16 @@
(set (match_operand:DF 3 "gpc_reg_operand" "=f")
(match_operand:DF 4 "memory_operand" "m"))])]
"TARGET_64BIT"
- "b %z2")
+; APPLE LOCAL begin -mlongcall
+ {
+#if TARGET_MACHO
+ if (TARGET_LONG_BRANCH)
+ return output_call(insn, operands, 2, 2);
+ else
+#endif
+ return "b %z2";
+ })
+; APPLE LOCAL end -mlongcall
; This is used in compiling the unwind routines.
(define_expand "eh_return"
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index db9abeae735..30a11c533e5 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -438,6 +438,11 @@ do { \
#define BSS_SECTION_ASM_OP "\t.section\t\".bss\""
+/* APPLE LOCAL begin hot/cold partitioning */
+#define HOT_TEXT_SECTION_NAME ".text"
+#define UNLIKELY_EXECUTED_TEXT_SECTION_NAME ".text.unlikely"
+/* APPLE LOCAL end hot/cold partitioning */
+
/* Override elfos.h definition. */
#undef INIT_SECTION_ASM_OP
#define INIT_SECTION_ASM_OP "\t.section\t\".init\",\"ax\""
diff --git a/gcc/config/rs6000/t-darwin b/gcc/config/rs6000/t-darwin
index 467c426f976..f463d6da131 100644
--- a/gcc/config/rs6000/t-darwin
+++ b/gcc/config/rs6000/t-darwin
@@ -1,10 +1,12 @@
+# APPLE LOCAL begin fpsave.asm moved from _STATIC_EXTRA to _EXTRA --dbj
LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm \
+ $(srcdir)/config/rs6000/darwin-fpsave.asm \
$(srcdir)/config/rs6000/darwin-ldouble.c
LIB2FUNCS_STATIC_EXTRA = \
- $(srcdir)/config/rs6000/darwin-fpsave.asm \
$(srcdir)/config/rs6000/darwin-vecsave.asm \
$(srcdir)/config/rs6000/darwin-world.asm
+# APPLE LOCAL end fpsave.asm moved from _STATIC_EXTRA to _EXTRA --dbj
# The .asm files above are designed to run on all processors,
# even though they use AltiVec instructions. -Wa is used because
diff --git a/gcc/config/rs6000/t-darwin8 b/gcc/config/rs6000/t-darwin8
new file mode 100644
index 00000000000..49613d3bad5
--- /dev/null
+++ b/gcc/config/rs6000/t-darwin8
@@ -0,0 +1,4 @@
+# APPLE LOCAL file mainline
+# 64-bit libraries can only be built in Darwin 8.x or later.
+MULTILIB_OPTIONS = m64
+MULTILIB_DIRNAMES = ppc64
diff --git a/gcc/config/rs6000/t-rs6000 b/gcc/config/rs6000/t-rs6000
index caa07153ad3..7025b80a977 100644
--- a/gcc/config/rs6000/t-rs6000
+++ b/gcc/config/rs6000/t-rs6000
@@ -10,7 +10,8 @@ rs6000.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(TM_P_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h reload.h gt-rs6000.h \
cfglayout.h
-rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c \
+# APPLE LOCAL AltiVec
+rs6000-c.o: $(srcdir)/config/rs6000/rs6000-c.c options.h \
$(srcdir)/config/rs6000/rs6000-protos.h \
$(CONFIG_H) $(SYSTEM_H) $(TREE_H) $(CPPLIB_H) \
$(TM_P_H) c-pragma.h errors.h coretypes.h $(TM_H)
diff --git a/gcc/config/rs6000/vec.h b/gcc/config/rs6000/vec.h
new file mode 100644
index 00000000000..56e8786f25b
--- /dev/null
+++ b/gcc/config/rs6000/vec.h
@@ -0,0 +1,4515 @@
+/* APPLE LOCAL file AltiVec */
+/* This file is generated by ops-to-gp. Do not edit. */
+
+/* To regenerate execute:
+ ops-to-gp -gcc vec.ops builtin.ops
+ with the current directory being gcc/config/rs6000. */
+
+static const struct builtin B1_vec_abs = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 11, "vec_abs:1", "4", CODE_FOR_xfx_perm, B_UID(0) };
+static const struct builtin B2_vec_abs = { { &T_vec_s16, NULL, NULL, }, "x", &T_vec_s16, 1, FALSE, FALSE, 11, "vec_abs:2", "2", CODE_FOR_xfx_perm, B_UID(1) };
+static const struct builtin B3_vec_abs = { { &T_vec_s32, NULL, NULL, }, "x", &T_vec_s32, 1, FALSE, FALSE, 11, "vec_abs:3", "3", CODE_FOR_xfx_perm, B_UID(2) };
+static const struct builtin B4_vec_abs = { { &T_vec_s8, NULL, NULL, }, "x", &T_vec_s8, 1, FALSE, FALSE, 11, "vec_abs:4", "1", CODE_FOR_xfx_perm, B_UID(3) };
+static const struct builtin B1_vec_abss = { { &T_vec_s16, NULL, NULL, }, "x", &T_vec_s16, 1, FALSE, FALSE, 11, "vec_abss:1", "6", CODE_FOR_xfx_perm, B_UID(4) };
+static const struct builtin B2_vec_abss = { { &T_vec_s32, NULL, NULL, }, "x", &T_vec_s32, 1, FALSE, FALSE, 11, "vec_abss:2", "7", CODE_FOR_xfx_perm, B_UID(5) };
+static const struct builtin B3_vec_abss = { { &T_vec_s8, NULL, NULL, }, "x", &T_vec_s8, 1, FALSE, FALSE, 11, "vec_abss:3", "5", CODE_FOR_xfx_perm, B_UID(6) };
+static const struct builtin B1_vec_vadduhm = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vadduhm:1", "*vadduhm", CODE_FOR_xfxx_simple, B_UID(7) };
+static const struct builtin B2_vec_vadduhm = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vadduhm:2", "*vadduhm", CODE_FOR_xfxx_simple, B_UID(8) };
+static const struct builtin B1_vec_vadduwm = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vadduwm:1", "*vadduwm", CODE_FOR_xfxx_simple, B_UID(9) };
+static const struct builtin B2_vec_vadduwm = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vadduwm:2", "*vadduwm", CODE_FOR_xfxx_simple, B_UID(10) };
+static const struct builtin B1_vec_vaddubm = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vaddubm:1", "*vaddubm", CODE_FOR_xfxx_simple, B_UID(11) };
+static const struct builtin B2_vec_vaddubm = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vaddubm:2", "*vaddubm", CODE_FOR_xfxx_simple, B_UID(12) };
+static const struct builtin B_vec_vaddfp = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vaddfp", "*vaddfp", CODE_FOR_xfxx_fp, B_UID(13) };
+static const struct builtin B3_vec_vadduhm = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vadduhm:3", "*vadduhm", CODE_FOR_xfxx_simple, B_UID(14) };
+static const struct builtin B4_vec_vadduhm = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vadduhm:4", "*vadduhm", CODE_FOR_xfxx_simple, B_UID(15) };
+static const struct builtin B3_vec_vadduwm = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vadduwm:3", "*vadduwm", CODE_FOR_xfxx_simple, B_UID(16) };
+static const struct builtin B4_vec_vadduwm = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vadduwm:4", "*vadduwm", CODE_FOR_xfxx_simple, B_UID(17) };
+static const struct builtin B3_vec_vaddubm = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vaddubm:3", "*vaddubm", CODE_FOR_xfxx_simple, B_UID(18) };
+static const struct builtin B4_vec_vaddubm = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vaddubm:4", "*vaddubm", CODE_FOR_xfxx_simple, B_UID(19) };
+static const struct builtin B5_vec_vadduhm = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vadduhm:5", "*vadduhm", CODE_FOR_xfxx_simple, B_UID(20) };
+static const struct builtin B6_vec_vadduhm = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vadduhm:6", "*vadduhm", CODE_FOR_xfxx_simple, B_UID(21) };
+static const struct builtin B5_vec_vadduwm = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vadduwm:5", "*vadduwm", CODE_FOR_xfxx_simple, B_UID(22) };
+static const struct builtin B6_vec_vadduwm = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vadduwm:6", "*vadduwm", CODE_FOR_xfxx_simple, B_UID(23) };
+static const struct builtin B5_vec_vaddubm = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vaddubm:5", "*vaddubm", CODE_FOR_xfxx_simple, B_UID(24) };
+static const struct builtin B6_vec_vaddubm = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vaddubm:6", "*vaddubm", CODE_FOR_xfxx_simple, B_UID(25) };
+static const struct builtin B_vec_vaddcuw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vaddcuw", "*vaddcuw", CODE_FOR_xfxx_simple, B_UID(26) };
+static const struct builtin B1_vec_vaddshs = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vaddshs:1", "*vaddshs", CODE_FOR_xfxx_simple, B_UID(27) };
+static const struct builtin B1_vec_vadduhs = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vadduhs:1", "*vadduhs", CODE_FOR_xfxx_simple, B_UID(28) };
+static const struct builtin B1_vec_vaddsws = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vaddsws:1", "*vaddsws", CODE_FOR_xfxx_simple, B_UID(29) };
+static const struct builtin B1_vec_vadduws = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vadduws:1", "*vadduws", CODE_FOR_xfxx_simple, B_UID(30) };
+static const struct builtin B1_vec_vaddsbs = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vaddsbs:1", "*vaddsbs", CODE_FOR_xfxx_simple, B_UID(31) };
+static const struct builtin B1_vec_vaddubs = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vaddubs:1", "*vaddubs", CODE_FOR_xfxx_simple, B_UID(32) };
+static const struct builtin B2_vec_vaddshs = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vaddshs:2", "*vaddshs", CODE_FOR_xfxx_simple, B_UID(33) };
+static const struct builtin B3_vec_vaddshs = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vaddshs:3", "*vaddshs", CODE_FOR_xfxx_simple, B_UID(34) };
+static const struct builtin B2_vec_vaddsws = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vaddsws:2", "*vaddsws", CODE_FOR_xfxx_simple, B_UID(35) };
+static const struct builtin B3_vec_vaddsws = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vaddsws:3", "*vaddsws", CODE_FOR_xfxx_simple, B_UID(36) };
+static const struct builtin B2_vec_vaddsbs = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vaddsbs:2", "*vaddsbs", CODE_FOR_xfxx_simple, B_UID(37) };
+static const struct builtin B3_vec_vaddsbs = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vaddsbs:3", "*vaddsbs", CODE_FOR_xfxx_simple, B_UID(38) };
+static const struct builtin B2_vec_vadduhs = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vadduhs:2", "*vadduhs", CODE_FOR_xfxx_simple, B_UID(39) };
+static const struct builtin B3_vec_vadduhs = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vadduhs:3", "*vadduhs", CODE_FOR_xfxx_simple, B_UID(40) };
+static const struct builtin B2_vec_vadduws = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vadduws:2", "*vadduws", CODE_FOR_xfxx_simple, B_UID(41) };
+static const struct builtin B3_vec_vadduws = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vadduws:3", "*vadduws", CODE_FOR_xfxx_simple, B_UID(42) };
+static const struct builtin B2_vec_vaddubs = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vaddubs:2", "*vaddubs", CODE_FOR_xfxx_simple, B_UID(43) };
+static const struct builtin B3_vec_vaddubs = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vaddubs:3", "*vaddubs", CODE_FOR_xfxx_simple, B_UID(44) };
+static const struct builtin B1_vec_all_eq = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:1", "*vcmpequh.", CODE_FOR_j_24_t_fxx_simple, B_UID(45) };
+static const struct builtin B2_vec_all_eq = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:2", "*vcmpequh.", CODE_FOR_j_24_t_fxx_simple, B_UID(46) };
+static const struct builtin B3_vec_all_eq = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:3", "*vcmpequh.", CODE_FOR_j_24_t_fxx_simple, B_UID(47) };
+static const struct builtin B4_vec_all_eq = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:4", "*vcmpequw.", CODE_FOR_j_24_t_fxx_simple, B_UID(48) };
+static const struct builtin B5_vec_all_eq = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:5", "*vcmpequw.", CODE_FOR_j_24_t_fxx_simple, B_UID(49) };
+static const struct builtin B6_vec_all_eq = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:6", "*vcmpequw.", CODE_FOR_j_24_t_fxx_simple, B_UID(50) };
+static const struct builtin B7_vec_all_eq = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:7", "*vcmpequb.", CODE_FOR_j_24_t_fxx_simple, B_UID(51) };
+static const struct builtin B8_vec_all_eq = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:8", "*vcmpequb.", CODE_FOR_j_24_t_fxx_simple, B_UID(52) };
+static const struct builtin B9_vec_all_eq = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:9", "*vcmpequb.", CODE_FOR_j_24_t_fxx_simple, B_UID(53) };
+static const struct builtin B10_vec_all_eq = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:10", "*vcmpeqfp.", CODE_FOR_j_24_t_fxx_simple, B_UID(54) };
+static const struct builtin B11_vec_all_eq = { { &T_vec_p16, &T_vec_p16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:11", "*vcmpequh.", CODE_FOR_j_24_t_fxx_simple, B_UID(55) };
+static const struct builtin B12_vec_all_eq = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:12", "*vcmpequh.", CODE_FOR_j_24_t_fxx_simple, B_UID(56) };
+static const struct builtin B13_vec_all_eq = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:13", "*vcmpequh.", CODE_FOR_j_24_t_fxx_simple, B_UID(57) };
+static const struct builtin B14_vec_all_eq = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:14", "*vcmpequw.", CODE_FOR_j_24_t_fxx_simple, B_UID(58) };
+static const struct builtin B15_vec_all_eq = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:15", "*vcmpequw.", CODE_FOR_j_24_t_fxx_simple, B_UID(59) };
+static const struct builtin B16_vec_all_eq = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:16", "*vcmpequb.", CODE_FOR_j_24_t_fxx_simple, B_UID(60) };
+static const struct builtin B17_vec_all_eq = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:17", "*vcmpequb.", CODE_FOR_j_24_t_fxx_simple, B_UID(61) };
+static const struct builtin B18_vec_all_eq = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:18", "*vcmpequh.", CODE_FOR_j_24_t_fxx_simple, B_UID(62) };
+static const struct builtin B19_vec_all_eq = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:19", "*vcmpequh.", CODE_FOR_j_24_t_fxx_simple, B_UID(63) };
+static const struct builtin B20_vec_all_eq = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:20", "*vcmpequw.", CODE_FOR_j_24_t_fxx_simple, B_UID(64) };
+static const struct builtin B21_vec_all_eq = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:21", "*vcmpequw.", CODE_FOR_j_24_t_fxx_simple, B_UID(65) };
+static const struct builtin B22_vec_all_eq = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:22", "*vcmpequb.", CODE_FOR_j_24_t_fxx_simple, B_UID(66) };
+static const struct builtin B23_vec_all_eq = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_eq:23", "*vcmpequb.", CODE_FOR_j_24_t_fxx_simple, B_UID(67) };
+static const struct builtin B1_vec_all_ge = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:1", "*vcmpgtsh.", CODE_FOR_j_26_t_frxx_simple, B_UID(68) };
+static const struct builtin B2_vec_all_ge = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:2", "*vcmpgtuh.", CODE_FOR_j_26_t_frxx_simple, B_UID(69) };
+static const struct builtin B3_vec_all_ge = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:3", "*vcmpgtsw.", CODE_FOR_j_26_t_frxx_simple, B_UID(70) };
+static const struct builtin B4_vec_all_ge = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:4", "*vcmpgtuw.", CODE_FOR_j_26_t_frxx_simple, B_UID(71) };
+static const struct builtin B5_vec_all_ge = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:5", "*vcmpgtsb.", CODE_FOR_j_26_t_frxx_simple, B_UID(72) };
+static const struct builtin B6_vec_all_ge = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:6", "*vcmpgtub.", CODE_FOR_j_26_t_frxx_simple, B_UID(73) };
+static const struct builtin B7_vec_all_ge = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_ge:7", "*vcmpgefp.", CODE_FOR_j_24_t_fxx_simple, B_UID(74) };
+static const struct builtin B8_vec_all_ge = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:8", "*vcmpgtsh.", CODE_FOR_j_26_t_frxx_simple, B_UID(75) };
+static const struct builtin B9_vec_all_ge = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:9", "*vcmpgtsh.", CODE_FOR_j_26_t_frxx_simple, B_UID(76) };
+static const struct builtin B10_vec_all_ge = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:10", "*vcmpgtsw.", CODE_FOR_j_26_t_frxx_simple, B_UID(77) };
+static const struct builtin B11_vec_all_ge = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:11", "*vcmpgtsw.", CODE_FOR_j_26_t_frxx_simple, B_UID(78) };
+static const struct builtin B12_vec_all_ge = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:12", "*vcmpgtsb.", CODE_FOR_j_26_t_frxx_simple, B_UID(79) };
+static const struct builtin B13_vec_all_ge = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:13", "*vcmpgtsb.", CODE_FOR_j_26_t_frxx_simple, B_UID(80) };
+static const struct builtin B14_vec_all_ge = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:14", "*vcmpgtuh.", CODE_FOR_j_26_t_frxx_simple, B_UID(81) };
+static const struct builtin B15_vec_all_ge = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:15", "*vcmpgtuh.", CODE_FOR_j_26_t_frxx_simple, B_UID(82) };
+static const struct builtin B16_vec_all_ge = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:16", "*vcmpgtuw.", CODE_FOR_j_26_t_frxx_simple, B_UID(83) };
+static const struct builtin B17_vec_all_ge = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:17", "*vcmpgtuw.", CODE_FOR_j_26_t_frxx_simple, B_UID(84) };
+static const struct builtin B18_vec_all_ge = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:18", "*vcmpgtub.", CODE_FOR_j_26_t_frxx_simple, B_UID(85) };
+static const struct builtin B19_vec_all_ge = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_ge:19", "*vcmpgtub.", CODE_FOR_j_26_t_frxx_simple, B_UID(86) };
+static const struct builtin B1_vec_all_gt = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:1", "*vcmpgtsh.", CODE_FOR_j_24_t_fxx_simple, B_UID(87) };
+static const struct builtin B2_vec_all_gt = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:2", "*vcmpgtuh.", CODE_FOR_j_24_t_fxx_simple, B_UID(88) };
+static const struct builtin B3_vec_all_gt = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:3", "*vcmpgtsw.", CODE_FOR_j_24_t_fxx_simple, B_UID(89) };
+static const struct builtin B4_vec_all_gt = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:4", "*vcmpgtuw.", CODE_FOR_j_24_t_fxx_simple, B_UID(90) };
+static const struct builtin B5_vec_all_gt = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:5", "*vcmpgtsb.", CODE_FOR_j_24_t_fxx_simple, B_UID(91) };
+static const struct builtin B6_vec_all_gt = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:6", "*vcmpgtub.", CODE_FOR_j_24_t_fxx_simple, B_UID(92) };
+static const struct builtin B7_vec_all_gt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:7", "*vcmpgtfp.", CODE_FOR_j_24_t_fxx_simple, B_UID(93) };
+static const struct builtin B8_vec_all_gt = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:8", "*vcmpgtsh.", CODE_FOR_j_24_t_fxx_simple, B_UID(94) };
+static const struct builtin B9_vec_all_gt = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:9", "*vcmpgtsh.", CODE_FOR_j_24_t_fxx_simple, B_UID(95) };
+static const struct builtin B10_vec_all_gt = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:10", "*vcmpgtsw.", CODE_FOR_j_24_t_fxx_simple, B_UID(96) };
+static const struct builtin B11_vec_all_gt = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:11", "*vcmpgtsw.", CODE_FOR_j_24_t_fxx_simple, B_UID(97) };
+static const struct builtin B12_vec_all_gt = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:12", "*vcmpgtsb.", CODE_FOR_j_24_t_fxx_simple, B_UID(98) };
+static const struct builtin B13_vec_all_gt = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:13", "*vcmpgtsb.", CODE_FOR_j_24_t_fxx_simple, B_UID(99) };
+static const struct builtin B14_vec_all_gt = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:14", "*vcmpgtuh.", CODE_FOR_j_24_t_fxx_simple, B_UID(100) };
+static const struct builtin B15_vec_all_gt = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:15", "*vcmpgtuh.", CODE_FOR_j_24_t_fxx_simple, B_UID(101) };
+static const struct builtin B16_vec_all_gt = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:16", "*vcmpgtuw.", CODE_FOR_j_24_t_fxx_simple, B_UID(102) };
+static const struct builtin B17_vec_all_gt = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:17", "*vcmpgtuw.", CODE_FOR_j_24_t_fxx_simple, B_UID(103) };
+static const struct builtin B18_vec_all_gt = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:18", "*vcmpgtub.", CODE_FOR_j_24_t_fxx_simple, B_UID(104) };
+static const struct builtin B19_vec_all_gt = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc24t, 2, FALSE, FALSE, 0, "vec_all_gt:19", "*vcmpgtub.", CODE_FOR_j_24_t_fxx_simple, B_UID(105) };
+static const struct builtin B_vec_all_in = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_in", "*vcmpbfp.", CODE_FOR_j_26_t_fxx_simple, B_UID(106) };
+static const struct builtin B1_vec_all_le = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:1", "*vcmpgtsh.", CODE_FOR_j_26_t_fxx_simple, B_UID(107) };
+static const struct builtin B2_vec_all_le = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:2", "*vcmpgtuh.", CODE_FOR_j_26_t_fxx_simple, B_UID(108) };
+static const struct builtin B3_vec_all_le = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:3", "*vcmpgtsw.", CODE_FOR_j_26_t_fxx_simple, B_UID(109) };
+static const struct builtin B4_vec_all_le = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:4", "*vcmpgtuw.", CODE_FOR_j_26_t_fxx_simple, B_UID(110) };
+static const struct builtin B5_vec_all_le = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:5", "*vcmpgtsb.", CODE_FOR_j_26_t_fxx_simple, B_UID(111) };
+static const struct builtin B6_vec_all_le = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:6", "*vcmpgtub.", CODE_FOR_j_26_t_fxx_simple, B_UID(112) };
+static const struct builtin B7_vec_all_le = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_le:7", "*vcmpgefp.", CODE_FOR_j_24_t_frxx_simple, B_UID(113) };
+static const struct builtin B8_vec_all_le = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:8", "*vcmpgtsh.", CODE_FOR_j_26_t_fxx_simple, B_UID(114) };
+static const struct builtin B9_vec_all_le = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:9", "*vcmpgtsh.", CODE_FOR_j_26_t_fxx_simple, B_UID(115) };
+static const struct builtin B10_vec_all_le = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:10", "*vcmpgtsw.", CODE_FOR_j_26_t_fxx_simple, B_UID(116) };
+static const struct builtin B11_vec_all_le = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:11", "*vcmpgtsw.", CODE_FOR_j_26_t_fxx_simple, B_UID(117) };
+static const struct builtin B12_vec_all_le = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:12", "*vcmpgtsb.", CODE_FOR_j_26_t_fxx_simple, B_UID(118) };
+static const struct builtin B13_vec_all_le = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:13", "*vcmpgtsb.", CODE_FOR_j_26_t_fxx_simple, B_UID(119) };
+static const struct builtin B14_vec_all_le = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:14", "*vcmpgtuh.", CODE_FOR_j_26_t_fxx_simple, B_UID(120) };
+static const struct builtin B15_vec_all_le = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:15", "*vcmpgtuh.", CODE_FOR_j_26_t_fxx_simple, B_UID(121) };
+static const struct builtin B16_vec_all_le = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:16", "*vcmpgtuw.", CODE_FOR_j_26_t_fxx_simple, B_UID(122) };
+static const struct builtin B17_vec_all_le = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:17", "*vcmpgtuw.", CODE_FOR_j_26_t_fxx_simple, B_UID(123) };
+static const struct builtin B18_vec_all_le = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:18", "*vcmpgtub.", CODE_FOR_j_26_t_fxx_simple, B_UID(124) };
+static const struct builtin B19_vec_all_le = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_le:19", "*vcmpgtub.", CODE_FOR_j_26_t_fxx_simple, B_UID(125) };
+static const struct builtin B1_vec_all_lt = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:1", "*vcmpgtsh.", CODE_FOR_j_24_t_frxx_simple, B_UID(126) };
+static const struct builtin B2_vec_all_lt = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:2", "*vcmpgtuh.", CODE_FOR_j_24_t_frxx_simple, B_UID(127) };
+static const struct builtin B3_vec_all_lt = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:3", "*vcmpgtsw.", CODE_FOR_j_24_t_frxx_simple, B_UID(128) };
+static const struct builtin B4_vec_all_lt = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:4", "*vcmpgtuw.", CODE_FOR_j_24_t_frxx_simple, B_UID(129) };
+static const struct builtin B5_vec_all_lt = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:5", "*vcmpgtsb.", CODE_FOR_j_24_t_frxx_simple, B_UID(130) };
+static const struct builtin B6_vec_all_lt = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:6", "*vcmpgtub.", CODE_FOR_j_24_t_frxx_simple, B_UID(131) };
+static const struct builtin B7_vec_all_lt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:7", "*vcmpgtfp.", CODE_FOR_j_24_t_frxx_simple, B_UID(132) };
+static const struct builtin B8_vec_all_lt = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:8", "*vcmpgtsh.", CODE_FOR_j_24_t_frxx_simple, B_UID(133) };
+static const struct builtin B9_vec_all_lt = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:9", "*vcmpgtsh.", CODE_FOR_j_24_t_frxx_simple, B_UID(134) };
+static const struct builtin B10_vec_all_lt = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:10", "*vcmpgtsw.", CODE_FOR_j_24_t_frxx_simple, B_UID(135) };
+static const struct builtin B11_vec_all_lt = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:11", "*vcmpgtsw.", CODE_FOR_j_24_t_frxx_simple, B_UID(136) };
+static const struct builtin B12_vec_all_lt = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:12", "*vcmpgtsb.", CODE_FOR_j_24_t_frxx_simple, B_UID(137) };
+static const struct builtin B13_vec_all_lt = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:13", "*vcmpgtsb.", CODE_FOR_j_24_t_frxx_simple, B_UID(138) };
+static const struct builtin B14_vec_all_lt = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:14", "*vcmpgtuh.", CODE_FOR_j_24_t_frxx_simple, B_UID(139) };
+static const struct builtin B15_vec_all_lt = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:15", "*vcmpgtuh.", CODE_FOR_j_24_t_frxx_simple, B_UID(140) };
+static const struct builtin B16_vec_all_lt = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:16", "*vcmpgtuw.", CODE_FOR_j_24_t_frxx_simple, B_UID(141) };
+static const struct builtin B17_vec_all_lt = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:17", "*vcmpgtuw.", CODE_FOR_j_24_t_frxx_simple, B_UID(142) };
+static const struct builtin B18_vec_all_lt = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:18", "*vcmpgtub.", CODE_FOR_j_24_t_frxx_simple, B_UID(143) };
+static const struct builtin B19_vec_all_lt = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc24tr, 2, FALSE, FALSE, 0, "vec_all_lt:19", "*vcmpgtub.", CODE_FOR_j_24_t_frxx_simple, B_UID(144) };
+static const struct builtin B_vec_all_nan = { { &T_vec_f32, NULL, NULL, }, "x", &T_cc26td, 1, FALSE, FALSE, 0, "vec_all_nan", "*vcmpeqfp.", CODE_FOR_j_26_t_fx_simple, B_UID(145) };
+static const struct builtin B1_vec_all_ne = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:1", "*vcmpequh.", CODE_FOR_j_26_t_fxx_simple, B_UID(146) };
+static const struct builtin B2_vec_all_ne = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:2", "*vcmpequh.", CODE_FOR_j_26_t_fxx_simple, B_UID(147) };
+static const struct builtin B3_vec_all_ne = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:3", "*vcmpequh.", CODE_FOR_j_26_t_fxx_simple, B_UID(148) };
+static const struct builtin B4_vec_all_ne = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:4", "*vcmpequw.", CODE_FOR_j_26_t_fxx_simple, B_UID(149) };
+static const struct builtin B5_vec_all_ne = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:5", "*vcmpequw.", CODE_FOR_j_26_t_fxx_simple, B_UID(150) };
+static const struct builtin B6_vec_all_ne = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:6", "*vcmpequw.", CODE_FOR_j_26_t_fxx_simple, B_UID(151) };
+static const struct builtin B7_vec_all_ne = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:7", "*vcmpequb.", CODE_FOR_j_26_t_fxx_simple, B_UID(152) };
+static const struct builtin B8_vec_all_ne = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:8", "*vcmpequb.", CODE_FOR_j_26_t_fxx_simple, B_UID(153) };
+static const struct builtin B9_vec_all_ne = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:9", "*vcmpequb.", CODE_FOR_j_26_t_fxx_simple, B_UID(154) };
+static const struct builtin B10_vec_all_ne = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:10", "*vcmpeqfp.", CODE_FOR_j_26_t_fxx_simple, B_UID(155) };
+static const struct builtin B11_vec_all_ne = { { &T_vec_p16, &T_vec_p16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:11", "*vcmpequh.", CODE_FOR_j_26_t_fxx_simple, B_UID(156) };
+static const struct builtin B12_vec_all_ne = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:12", "*vcmpequh.", CODE_FOR_j_26_t_fxx_simple, B_UID(157) };
+static const struct builtin B13_vec_all_ne = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:13", "*vcmpequh.", CODE_FOR_j_26_t_fxx_simple, B_UID(158) };
+static const struct builtin B14_vec_all_ne = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:14", "*vcmpequw.", CODE_FOR_j_26_t_fxx_simple, B_UID(159) };
+static const struct builtin B15_vec_all_ne = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:15", "*vcmpequw.", CODE_FOR_j_26_t_fxx_simple, B_UID(160) };
+static const struct builtin B16_vec_all_ne = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:16", "*vcmpequb.", CODE_FOR_j_26_t_fxx_simple, B_UID(161) };
+static const struct builtin B17_vec_all_ne = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:17", "*vcmpequb.", CODE_FOR_j_26_t_fxx_simple, B_UID(162) };
+static const struct builtin B18_vec_all_ne = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:18", "*vcmpequh.", CODE_FOR_j_26_t_fxx_simple, B_UID(163) };
+static const struct builtin B19_vec_all_ne = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:19", "*vcmpequh.", CODE_FOR_j_26_t_fxx_simple, B_UID(164) };
+static const struct builtin B20_vec_all_ne = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:20", "*vcmpequw.", CODE_FOR_j_26_t_fxx_simple, B_UID(165) };
+static const struct builtin B21_vec_all_ne = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:21", "*vcmpequw.", CODE_FOR_j_26_t_fxx_simple, B_UID(166) };
+static const struct builtin B22_vec_all_ne = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:22", "*vcmpequb.", CODE_FOR_j_26_t_fxx_simple, B_UID(167) };
+static const struct builtin B23_vec_all_ne = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ne:23", "*vcmpequb.", CODE_FOR_j_26_t_fxx_simple, B_UID(168) };
+static const struct builtin B_vec_all_nge = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_nge", "*vcmpgefp.", CODE_FOR_j_26_t_fxx_simple, B_UID(169) };
+static const struct builtin B_vec_all_ngt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26t, 2, FALSE, FALSE, 0, "vec_all_ngt", "*vcmpgtfp.", CODE_FOR_j_26_t_fxx_simple, B_UID(170) };
+static const struct builtin B_vec_all_nle = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_nle", "*vcmpgefp.", CODE_FOR_j_26_t_frxx_simple, B_UID(171) };
+static const struct builtin B_vec_all_nlt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26tr, 2, FALSE, FALSE, 0, "vec_all_nlt", "*vcmpgtfp.", CODE_FOR_j_26_t_frxx_simple, B_UID(172) };
+static const struct builtin B_vec_all_numeric = { { &T_vec_f32, NULL, NULL, }, "x", &T_cc24td, 1, FALSE, FALSE, 0, "vec_all_numeric", "*vcmpeqfp.", CODE_FOR_j_24_t_fx_simple, B_UID(173) };
+static const struct builtin B1_vec_vand = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 2, "vec_vand:1", "*vand", CODE_FOR_xfxx_simple, B_UID(174) };
+static const struct builtin B2_vec_vand = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vand:2", "*vand", CODE_FOR_xfxx_simple, B_UID(175) };
+static const struct builtin B3_vec_vand = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vand:3", "*vand", CODE_FOR_xfxx_simple, B_UID(176) };
+static const struct builtin B4_vec_vand = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 2, "vec_vand:4", "*vand", CODE_FOR_xfxx_simple, B_UID(177) };
+static const struct builtin B5_vec_vand = { { &T_vec_b32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 2, "vec_vand:5", "*vand", CODE_FOR_xfxx_simple, B_UID(178) };
+static const struct builtin B6_vec_vand = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vand:6", "*vand", CODE_FOR_xfxx_simple, B_UID(179) };
+static const struct builtin B7_vec_vand = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vand:7", "*vand", CODE_FOR_xfxx_simple, B_UID(180) };
+static const struct builtin B8_vec_vand = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 2, "vec_vand:8", "*vand", CODE_FOR_xfxx_simple, B_UID(181) };
+static const struct builtin B9_vec_vand = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vand:9", "*vand", CODE_FOR_xfxx_simple, B_UID(182) };
+static const struct builtin B10_vec_vand = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vand:10", "*vand", CODE_FOR_xfxx_simple, B_UID(183) };
+static const struct builtin B11_vec_vand = { { &T_vec_f32, &T_vec_b32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 2, "vec_vand:11", "*vand", CODE_FOR_xfxx_simple, B_UID(184) };
+static const struct builtin B12_vec_vand = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 2, "vec_vand:12", "*vand", CODE_FOR_xfxx_simple, B_UID(185) };
+static const struct builtin B13_vec_vand = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vand:13", "*vand", CODE_FOR_xfxx_simple, B_UID(186) };
+static const struct builtin B14_vec_vand = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vand:14", "*vand", CODE_FOR_xfxx_simple, B_UID(187) };
+static const struct builtin B15_vec_vand = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vand:15", "*vand", CODE_FOR_xfxx_simple, B_UID(188) };
+static const struct builtin B16_vec_vand = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vand:16", "*vand", CODE_FOR_xfxx_simple, B_UID(189) };
+static const struct builtin B17_vec_vand = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vand:17", "*vand", CODE_FOR_xfxx_simple, B_UID(190) };
+static const struct builtin B18_vec_vand = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vand:18", "*vand", CODE_FOR_xfxx_simple, B_UID(191) };
+static const struct builtin B19_vec_vand = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vand:19", "*vand", CODE_FOR_xfxx_simple, B_UID(192) };
+static const struct builtin B20_vec_vand = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vand:20", "*vand", CODE_FOR_xfxx_simple, B_UID(193) };
+static const struct builtin B21_vec_vand = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vand:21", "*vand", CODE_FOR_xfxx_simple, B_UID(194) };
+static const struct builtin B22_vec_vand = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vand:22", "*vand", CODE_FOR_xfxx_simple, B_UID(195) };
+static const struct builtin B23_vec_vand = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vand:23", "*vand", CODE_FOR_xfxx_simple, B_UID(196) };
+static const struct builtin B24_vec_vand = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vand:24", "*vand", CODE_FOR_xfxx_simple, B_UID(197) };
+static const struct builtin B1_vec_vandc = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 1, "vec_vandc:1", "*vandc", CODE_FOR_xfxx_simple, B_UID(198) };
+static const struct builtin B2_vec_vandc = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vandc:2", "*vandc", CODE_FOR_xfxx_simple, B_UID(199) };
+static const struct builtin B3_vec_vandc = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vandc:3", "*vandc", CODE_FOR_xfxx_simple, B_UID(200) };
+static const struct builtin B4_vec_vandc = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 1, "vec_vandc:4", "*vandc", CODE_FOR_xfxx_simple, B_UID(201) };
+static const struct builtin B5_vec_vandc = { { &T_vec_b32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 1, "vec_vandc:5", "*vandc", CODE_FOR_xfxx_simple, B_UID(202) };
+static const struct builtin B6_vec_vandc = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vandc:6", "*vandc", CODE_FOR_xfxx_simple, B_UID(203) };
+static const struct builtin B7_vec_vandc = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vandc:7", "*vandc", CODE_FOR_xfxx_simple, B_UID(204) };
+static const struct builtin B8_vec_vandc = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 1, "vec_vandc:8", "*vandc", CODE_FOR_xfxx_simple, B_UID(205) };
+static const struct builtin B9_vec_vandc = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vandc:9", "*vandc", CODE_FOR_xfxx_simple, B_UID(206) };
+static const struct builtin B10_vec_vandc = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vandc:10", "*vandc", CODE_FOR_xfxx_simple, B_UID(207) };
+static const struct builtin B11_vec_vandc = { { &T_vec_f32, &T_vec_b32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 1, "vec_vandc:11", "*vandc", CODE_FOR_xfxx_simple, B_UID(208) };
+static const struct builtin B12_vec_vandc = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 1, "vec_vandc:12", "*vandc", CODE_FOR_xfxx_simple, B_UID(209) };
+static const struct builtin B13_vec_vandc = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vandc:13", "*vandc", CODE_FOR_xfxx_simple, B_UID(210) };
+static const struct builtin B14_vec_vandc = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vandc:14", "*vandc", CODE_FOR_xfxx_simple, B_UID(211) };
+static const struct builtin B15_vec_vandc = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vandc:15", "*vandc", CODE_FOR_xfxx_simple, B_UID(212) };
+static const struct builtin B16_vec_vandc = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vandc:16", "*vandc", CODE_FOR_xfxx_simple, B_UID(213) };
+static const struct builtin B17_vec_vandc = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vandc:17", "*vandc", CODE_FOR_xfxx_simple, B_UID(214) };
+static const struct builtin B18_vec_vandc = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vandc:18", "*vandc", CODE_FOR_xfxx_simple, B_UID(215) };
+static const struct builtin B19_vec_vandc = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vandc:19", "*vandc", CODE_FOR_xfxx_simple, B_UID(216) };
+static const struct builtin B20_vec_vandc = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vandc:20", "*vandc", CODE_FOR_xfxx_simple, B_UID(217) };
+static const struct builtin B21_vec_vandc = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vandc:21", "*vandc", CODE_FOR_xfxx_simple, B_UID(218) };
+static const struct builtin B22_vec_vandc = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vandc:22", "*vandc", CODE_FOR_xfxx_simple, B_UID(219) };
+static const struct builtin B23_vec_vandc = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vandc:23", "*vandc", CODE_FOR_xfxx_simple, B_UID(220) };
+static const struct builtin B24_vec_vandc = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vandc:24", "*vandc", CODE_FOR_xfxx_simple, B_UID(221) };
+static const struct builtin B1_vec_any_eq = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:1", "*vcmpequh.", CODE_FOR_j_26_f_fxx_simple, B_UID(222) };
+static const struct builtin B2_vec_any_eq = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:2", "*vcmpequh.", CODE_FOR_j_26_f_fxx_simple, B_UID(223) };
+static const struct builtin B3_vec_any_eq = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:3", "*vcmpequh.", CODE_FOR_j_26_f_fxx_simple, B_UID(224) };
+static const struct builtin B4_vec_any_eq = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:4", "*vcmpequw.", CODE_FOR_j_26_f_fxx_simple, B_UID(225) };
+static const struct builtin B5_vec_any_eq = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:5", "*vcmpequw.", CODE_FOR_j_26_f_fxx_simple, B_UID(226) };
+static const struct builtin B6_vec_any_eq = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:6", "*vcmpequw.", CODE_FOR_j_26_f_fxx_simple, B_UID(227) };
+static const struct builtin B7_vec_any_eq = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:7", "*vcmpequb.", CODE_FOR_j_26_f_fxx_simple, B_UID(228) };
+static const struct builtin B8_vec_any_eq = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:8", "*vcmpequb.", CODE_FOR_j_26_f_fxx_simple, B_UID(229) };
+static const struct builtin B9_vec_any_eq = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:9", "*vcmpequb.", CODE_FOR_j_26_f_fxx_simple, B_UID(230) };
+static const struct builtin B10_vec_any_eq = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:10", "*vcmpeqfp.", CODE_FOR_j_26_f_fxx_simple, B_UID(231) };
+static const struct builtin B11_vec_any_eq = { { &T_vec_p16, &T_vec_p16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:11", "*vcmpequh.", CODE_FOR_j_26_f_fxx_simple, B_UID(232) };
+static const struct builtin B12_vec_any_eq = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:12", "*vcmpequh.", CODE_FOR_j_26_f_fxx_simple, B_UID(233) };
+static const struct builtin B13_vec_any_eq = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:13", "*vcmpequh.", CODE_FOR_j_26_f_fxx_simple, B_UID(234) };
+static const struct builtin B14_vec_any_eq = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:14", "*vcmpequw.", CODE_FOR_j_26_f_fxx_simple, B_UID(235) };
+static const struct builtin B15_vec_any_eq = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:15", "*vcmpequw.", CODE_FOR_j_26_f_fxx_simple, B_UID(236) };
+static const struct builtin B16_vec_any_eq = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:16", "*vcmpequb.", CODE_FOR_j_26_f_fxx_simple, B_UID(237) };
+static const struct builtin B17_vec_any_eq = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:17", "*vcmpequb.", CODE_FOR_j_26_f_fxx_simple, B_UID(238) };
+static const struct builtin B18_vec_any_eq = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:18", "*vcmpequh.", CODE_FOR_j_26_f_fxx_simple, B_UID(239) };
+static const struct builtin B19_vec_any_eq = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:19", "*vcmpequh.", CODE_FOR_j_26_f_fxx_simple, B_UID(240) };
+static const struct builtin B20_vec_any_eq = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:20", "*vcmpequw.", CODE_FOR_j_26_f_fxx_simple, B_UID(241) };
+static const struct builtin B21_vec_any_eq = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:21", "*vcmpequw.", CODE_FOR_j_26_f_fxx_simple, B_UID(242) };
+static const struct builtin B22_vec_any_eq = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:22", "*vcmpequb.", CODE_FOR_j_26_f_fxx_simple, B_UID(243) };
+static const struct builtin B23_vec_any_eq = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_eq:23", "*vcmpequb.", CODE_FOR_j_26_f_fxx_simple, B_UID(244) };
+static const struct builtin B1_vec_any_ge = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:1", "*vcmpgtsh.", CODE_FOR_j_24_f_frxx_simple, B_UID(245) };
+static const struct builtin B2_vec_any_ge = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:2", "*vcmpgtuh.", CODE_FOR_j_24_f_frxx_simple, B_UID(246) };
+static const struct builtin B3_vec_any_ge = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:3", "*vcmpgtsw.", CODE_FOR_j_24_f_frxx_simple, B_UID(247) };
+static const struct builtin B4_vec_any_ge = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:4", "*vcmpgtuw.", CODE_FOR_j_24_f_frxx_simple, B_UID(248) };
+static const struct builtin B5_vec_any_ge = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:5", "*vcmpgtsb.", CODE_FOR_j_24_f_frxx_simple, B_UID(249) };
+static const struct builtin B6_vec_any_ge = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:6", "*vcmpgtub.", CODE_FOR_j_24_f_frxx_simple, B_UID(250) };
+static const struct builtin B7_vec_any_ge = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_ge:7", "*vcmpgefp.", CODE_FOR_j_26_f_fxx_simple, B_UID(251) };
+static const struct builtin B8_vec_any_ge = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:8", "*vcmpgtsh.", CODE_FOR_j_24_f_frxx_simple, B_UID(252) };
+static const struct builtin B9_vec_any_ge = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:9", "*vcmpgtsh.", CODE_FOR_j_24_f_frxx_simple, B_UID(253) };
+static const struct builtin B10_vec_any_ge = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:10", "*vcmpgtsw.", CODE_FOR_j_24_f_frxx_simple, B_UID(254) };
+static const struct builtin B11_vec_any_ge = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:11", "*vcmpgtsw.", CODE_FOR_j_24_f_frxx_simple, B_UID(255) };
+static const struct builtin B12_vec_any_ge = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:12", "*vcmpgtsb.", CODE_FOR_j_24_f_frxx_simple, B_UID(256) };
+static const struct builtin B13_vec_any_ge = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:13", "*vcmpgtsb.", CODE_FOR_j_24_f_frxx_simple, B_UID(257) };
+static const struct builtin B14_vec_any_ge = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:14", "*vcmpgtuh.", CODE_FOR_j_24_f_frxx_simple, B_UID(258) };
+static const struct builtin B15_vec_any_ge = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:15", "*vcmpgtuh.", CODE_FOR_j_24_f_frxx_simple, B_UID(259) };
+static const struct builtin B16_vec_any_ge = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:16", "*vcmpgtuw.", CODE_FOR_j_24_f_frxx_simple, B_UID(260) };
+static const struct builtin B17_vec_any_ge = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:17", "*vcmpgtuw.", CODE_FOR_j_24_f_frxx_simple, B_UID(261) };
+static const struct builtin B18_vec_any_ge = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:18", "*vcmpgtub.", CODE_FOR_j_24_f_frxx_simple, B_UID(262) };
+static const struct builtin B19_vec_any_ge = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_ge:19", "*vcmpgtub.", CODE_FOR_j_24_f_frxx_simple, B_UID(263) };
+static const struct builtin B1_vec_any_gt = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:1", "*vcmpgtsh.", CODE_FOR_j_26_f_fxx_simple, B_UID(264) };
+static const struct builtin B2_vec_any_gt = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:2", "*vcmpgtuh.", CODE_FOR_j_26_f_fxx_simple, B_UID(265) };
+static const struct builtin B3_vec_any_gt = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:3", "*vcmpgtsw.", CODE_FOR_j_26_f_fxx_simple, B_UID(266) };
+static const struct builtin B4_vec_any_gt = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:4", "*vcmpgtuw.", CODE_FOR_j_26_f_fxx_simple, B_UID(267) };
+static const struct builtin B5_vec_any_gt = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:5", "*vcmpgtsb.", CODE_FOR_j_26_f_fxx_simple, B_UID(268) };
+static const struct builtin B6_vec_any_gt = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:6", "*vcmpgtub.", CODE_FOR_j_26_f_fxx_simple, B_UID(269) };
+static const struct builtin B7_vec_any_gt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:7", "*vcmpgtfp.", CODE_FOR_j_26_f_fxx_simple, B_UID(270) };
+static const struct builtin B8_vec_any_gt = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:8", "*vcmpgtsh.", CODE_FOR_j_26_f_fxx_simple, B_UID(271) };
+static const struct builtin B9_vec_any_gt = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:9", "*vcmpgtsh.", CODE_FOR_j_26_f_fxx_simple, B_UID(272) };
+static const struct builtin B10_vec_any_gt = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:10", "*vcmpgtsw.", CODE_FOR_j_26_f_fxx_simple, B_UID(273) };
+static const struct builtin B11_vec_any_gt = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:11", "*vcmpgtsw.", CODE_FOR_j_26_f_fxx_simple, B_UID(274) };
+static const struct builtin B12_vec_any_gt = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:12", "*vcmpgtsb.", CODE_FOR_j_26_f_fxx_simple, B_UID(275) };
+static const struct builtin B13_vec_any_gt = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:13", "*vcmpgtsb.", CODE_FOR_j_26_f_fxx_simple, B_UID(276) };
+static const struct builtin B14_vec_any_gt = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:14", "*vcmpgtuh.", CODE_FOR_j_26_f_fxx_simple, B_UID(277) };
+static const struct builtin B15_vec_any_gt = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:15", "*vcmpgtuh.", CODE_FOR_j_26_f_fxx_simple, B_UID(278) };
+static const struct builtin B16_vec_any_gt = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:16", "*vcmpgtuw.", CODE_FOR_j_26_f_fxx_simple, B_UID(279) };
+static const struct builtin B17_vec_any_gt = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:17", "*vcmpgtuw.", CODE_FOR_j_26_f_fxx_simple, B_UID(280) };
+static const struct builtin B18_vec_any_gt = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:18", "*vcmpgtub.", CODE_FOR_j_26_f_fxx_simple, B_UID(281) };
+static const struct builtin B19_vec_any_gt = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_gt:19", "*vcmpgtub.", CODE_FOR_j_26_f_fxx_simple, B_UID(282) };
+static const struct builtin B1_vec_any_le = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:1", "*vcmpgtsh.", CODE_FOR_j_24_f_fxx_simple, B_UID(283) };
+static const struct builtin B2_vec_any_le = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:2", "*vcmpgtuh.", CODE_FOR_j_24_f_fxx_simple, B_UID(284) };
+static const struct builtin B3_vec_any_le = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:3", "*vcmpgtsw.", CODE_FOR_j_24_f_fxx_simple, B_UID(285) };
+static const struct builtin B4_vec_any_le = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:4", "*vcmpgtuw.", CODE_FOR_j_24_f_fxx_simple, B_UID(286) };
+static const struct builtin B5_vec_any_le = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:5", "*vcmpgtsb.", CODE_FOR_j_24_f_fxx_simple, B_UID(287) };
+static const struct builtin B6_vec_any_le = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:6", "*vcmpgtub.", CODE_FOR_j_24_f_fxx_simple, B_UID(288) };
+static const struct builtin B7_vec_any_le = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_le:7", "*vcmpgefp.", CODE_FOR_j_26_f_frxx_simple, B_UID(289) };
+static const struct builtin B8_vec_any_le = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:8", "*vcmpgtsh.", CODE_FOR_j_24_f_fxx_simple, B_UID(290) };
+static const struct builtin B9_vec_any_le = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:9", "*vcmpgtsh.", CODE_FOR_j_24_f_fxx_simple, B_UID(291) };
+static const struct builtin B10_vec_any_le = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:10", "*vcmpgtsw.", CODE_FOR_j_24_f_fxx_simple, B_UID(292) };
+static const struct builtin B11_vec_any_le = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:11", "*vcmpgtsw.", CODE_FOR_j_24_f_fxx_simple, B_UID(293) };
+static const struct builtin B12_vec_any_le = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:12", "*vcmpgtsb.", CODE_FOR_j_24_f_fxx_simple, B_UID(294) };
+static const struct builtin B13_vec_any_le = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:13", "*vcmpgtsb.", CODE_FOR_j_24_f_fxx_simple, B_UID(295) };
+static const struct builtin B14_vec_any_le = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:14", "*vcmpgtuh.", CODE_FOR_j_24_f_fxx_simple, B_UID(296) };
+static const struct builtin B15_vec_any_le = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:15", "*vcmpgtuh.", CODE_FOR_j_24_f_fxx_simple, B_UID(297) };
+static const struct builtin B16_vec_any_le = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:16", "*vcmpgtuw.", CODE_FOR_j_24_f_fxx_simple, B_UID(298) };
+static const struct builtin B17_vec_any_le = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:17", "*vcmpgtuw.", CODE_FOR_j_24_f_fxx_simple, B_UID(299) };
+static const struct builtin B18_vec_any_le = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:18", "*vcmpgtub.", CODE_FOR_j_24_f_fxx_simple, B_UID(300) };
+static const struct builtin B19_vec_any_le = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_le:19", "*vcmpgtub.", CODE_FOR_j_24_f_fxx_simple, B_UID(301) };
+static const struct builtin B1_vec_any_lt = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:1", "*vcmpgtsh.", CODE_FOR_j_26_f_frxx_simple, B_UID(302) };
+static const struct builtin B2_vec_any_lt = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:2", "*vcmpgtuh.", CODE_FOR_j_26_f_frxx_simple, B_UID(303) };
+static const struct builtin B3_vec_any_lt = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:3", "*vcmpgtsw.", CODE_FOR_j_26_f_frxx_simple, B_UID(304) };
+static const struct builtin B4_vec_any_lt = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:4", "*vcmpgtuw.", CODE_FOR_j_26_f_frxx_simple, B_UID(305) };
+static const struct builtin B5_vec_any_lt = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:5", "*vcmpgtsb.", CODE_FOR_j_26_f_frxx_simple, B_UID(306) };
+static const struct builtin B6_vec_any_lt = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:6", "*vcmpgtub.", CODE_FOR_j_26_f_frxx_simple, B_UID(307) };
+static const struct builtin B7_vec_any_lt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:7", "*vcmpgtfp.", CODE_FOR_j_26_f_frxx_simple, B_UID(308) };
+static const struct builtin B8_vec_any_lt = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:8", "*vcmpgtsh.", CODE_FOR_j_26_f_frxx_simple, B_UID(309) };
+static const struct builtin B9_vec_any_lt = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:9", "*vcmpgtsh.", CODE_FOR_j_26_f_frxx_simple, B_UID(310) };
+static const struct builtin B10_vec_any_lt = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:10", "*vcmpgtsw.", CODE_FOR_j_26_f_frxx_simple, B_UID(311) };
+static const struct builtin B11_vec_any_lt = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:11", "*vcmpgtsw.", CODE_FOR_j_26_f_frxx_simple, B_UID(312) };
+static const struct builtin B12_vec_any_lt = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:12", "*vcmpgtsb.", CODE_FOR_j_26_f_frxx_simple, B_UID(313) };
+static const struct builtin B13_vec_any_lt = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:13", "*vcmpgtsb.", CODE_FOR_j_26_f_frxx_simple, B_UID(314) };
+static const struct builtin B14_vec_any_lt = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:14", "*vcmpgtuh.", CODE_FOR_j_26_f_frxx_simple, B_UID(315) };
+static const struct builtin B15_vec_any_lt = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:15", "*vcmpgtuh.", CODE_FOR_j_26_f_frxx_simple, B_UID(316) };
+static const struct builtin B16_vec_any_lt = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:16", "*vcmpgtuw.", CODE_FOR_j_26_f_frxx_simple, B_UID(317) };
+static const struct builtin B17_vec_any_lt = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:17", "*vcmpgtuw.", CODE_FOR_j_26_f_frxx_simple, B_UID(318) };
+static const struct builtin B18_vec_any_lt = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:18", "*vcmpgtub.", CODE_FOR_j_26_f_frxx_simple, B_UID(319) };
+static const struct builtin B19_vec_any_lt = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc26fr, 2, FALSE, FALSE, 0, "vec_any_lt:19", "*vcmpgtub.", CODE_FOR_j_26_f_frxx_simple, B_UID(320) };
+static const struct builtin B_vec_any_nan = { { &T_vec_f32, NULL, NULL, }, "x", &T_cc24fd, 1, FALSE, FALSE, 0, "vec_any_nan", "*vcmpeqfp.", CODE_FOR_j_24_f_fx_simple, B_UID(321) };
+static const struct builtin B1_vec_any_ne = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:1", "*vcmpequh.", CODE_FOR_j_24_f_fxx_simple, B_UID(322) };
+static const struct builtin B2_vec_any_ne = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:2", "*vcmpequh.", CODE_FOR_j_24_f_fxx_simple, B_UID(323) };
+static const struct builtin B3_vec_any_ne = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:3", "*vcmpequh.", CODE_FOR_j_24_f_fxx_simple, B_UID(324) };
+static const struct builtin B4_vec_any_ne = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:4", "*vcmpequw.", CODE_FOR_j_24_f_fxx_simple, B_UID(325) };
+static const struct builtin B5_vec_any_ne = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:5", "*vcmpequw.", CODE_FOR_j_24_f_fxx_simple, B_UID(326) };
+static const struct builtin B6_vec_any_ne = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:6", "*vcmpequw.", CODE_FOR_j_24_f_fxx_simple, B_UID(327) };
+static const struct builtin B7_vec_any_ne = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:7", "*vcmpequb.", CODE_FOR_j_24_f_fxx_simple, B_UID(328) };
+static const struct builtin B8_vec_any_ne = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:8", "*vcmpequb.", CODE_FOR_j_24_f_fxx_simple, B_UID(329) };
+static const struct builtin B9_vec_any_ne = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:9", "*vcmpequb.", CODE_FOR_j_24_f_fxx_simple, B_UID(330) };
+static const struct builtin B10_vec_any_ne = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:10", "*vcmpeqfp.", CODE_FOR_j_24_f_fxx_simple, B_UID(331) };
+static const struct builtin B11_vec_any_ne = { { &T_vec_p16, &T_vec_p16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:11", "*vcmpequh.", CODE_FOR_j_24_f_fxx_simple, B_UID(332) };
+static const struct builtin B12_vec_any_ne = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:12", "*vcmpequh.", CODE_FOR_j_24_f_fxx_simple, B_UID(333) };
+static const struct builtin B13_vec_any_ne = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:13", "*vcmpequh.", CODE_FOR_j_24_f_fxx_simple, B_UID(334) };
+static const struct builtin B14_vec_any_ne = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:14", "*vcmpequw.", CODE_FOR_j_24_f_fxx_simple, B_UID(335) };
+static const struct builtin B15_vec_any_ne = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:15", "*vcmpequw.", CODE_FOR_j_24_f_fxx_simple, B_UID(336) };
+static const struct builtin B16_vec_any_ne = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:16", "*vcmpequb.", CODE_FOR_j_24_f_fxx_simple, B_UID(337) };
+static const struct builtin B17_vec_any_ne = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:17", "*vcmpequb.", CODE_FOR_j_24_f_fxx_simple, B_UID(338) };
+static const struct builtin B18_vec_any_ne = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:18", "*vcmpequh.", CODE_FOR_j_24_f_fxx_simple, B_UID(339) };
+static const struct builtin B19_vec_any_ne = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:19", "*vcmpequh.", CODE_FOR_j_24_f_fxx_simple, B_UID(340) };
+static const struct builtin B20_vec_any_ne = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:20", "*vcmpequw.", CODE_FOR_j_24_f_fxx_simple, B_UID(341) };
+static const struct builtin B21_vec_any_ne = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:21", "*vcmpequw.", CODE_FOR_j_24_f_fxx_simple, B_UID(342) };
+static const struct builtin B22_vec_any_ne = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:22", "*vcmpequb.", CODE_FOR_j_24_f_fxx_simple, B_UID(343) };
+static const struct builtin B23_vec_any_ne = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ne:23", "*vcmpequb.", CODE_FOR_j_24_f_fxx_simple, B_UID(344) };
+static const struct builtin B_vec_any_nge = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_nge", "*vcmpgefp.", CODE_FOR_j_24_f_fxx_simple, B_UID(345) };
+static const struct builtin B_vec_any_ngt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24f, 2, FALSE, FALSE, 0, "vec_any_ngt", "*vcmpgtfp.", CODE_FOR_j_24_f_fxx_simple, B_UID(346) };
+static const struct builtin B_vec_any_nle = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_nle", "*vcmpgefp.", CODE_FOR_j_24_f_frxx_simple, B_UID(347) };
+static const struct builtin B_vec_any_nlt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc24fr, 2, FALSE, FALSE, 0, "vec_any_nlt", "*vcmpgtfp.", CODE_FOR_j_24_f_frxx_simple, B_UID(348) };
+static const struct builtin B_vec_any_numeric = { { &T_vec_f32, NULL, NULL, }, "x", &T_cc26fd, 1, FALSE, FALSE, 0, "vec_any_numeric", "*vcmpeqfp.", CODE_FOR_j_26_f_fx_simple, B_UID(349) };
+static const struct builtin B_vec_any_out = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_cc26f, 2, FALSE, FALSE, 0, "vec_any_out", "*vcmpbfp.", CODE_FOR_j_26_f_fxx_simple, B_UID(350) };
+static const struct builtin B_vec_vavgsh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vavgsh", "*vavgsh", CODE_FOR_xfxx_simple, B_UID(351) };
+static const struct builtin B_vec_vavgsw = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vavgsw", "*vavgsw", CODE_FOR_xfxx_simple, B_UID(352) };
+static const struct builtin B_vec_vavgsb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vavgsb", "*vavgsb", CODE_FOR_xfxx_simple, B_UID(353) };
+static const struct builtin B_vec_vavguh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vavguh", "*vavguh", CODE_FOR_xfxx_simple, B_UID(354) };
+static const struct builtin B_vec_vavguw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vavguw", "*vavguw", CODE_FOR_xfxx_simple, B_UID(355) };
+static const struct builtin B_vec_vavgub = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vavgub", "*vavgub", CODE_FOR_xfxx_simple, B_UID(356) };
+static const struct builtin B_vec_vrfip = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 0, "vec_vrfip", "*vrfip", CODE_FOR_xfx_fp, B_UID(357) };
+static const struct builtin B_vec_vcmpbfp = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vcmpbfp", "*vcmpbfp", CODE_FOR_xfxx_simple, B_UID(358) };
+static const struct builtin B_vec_vcmpeqfp = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 7, "vec_vcmpeqfp", "*vcmpeqfp", CODE_FOR_xfxx_simple, B_UID(359) };
+static const struct builtin B1_vec_vcmpequh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 7, "vec_vcmpequh:1", "*vcmpequh", CODE_FOR_xfxx_simple, B_UID(360) };
+static const struct builtin B1_vec_vcmpequw = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 7, "vec_vcmpequw:1", "*vcmpequw", CODE_FOR_xfxx_simple, B_UID(361) };
+static const struct builtin B1_vec_vcmpequb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 7, "vec_vcmpequb:1", "*vcmpequb", CODE_FOR_xfxx_simple, B_UID(362) };
+static const struct builtin B2_vec_vcmpequh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 7, "vec_vcmpequh:2", "*vcmpequh", CODE_FOR_xfxx_simple, B_UID(363) };
+static const struct builtin B2_vec_vcmpequw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 7, "vec_vcmpequw:2", "*vcmpequw", CODE_FOR_xfxx_simple, B_UID(364) };
+static const struct builtin B2_vec_vcmpequb = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 7, "vec_vcmpequb:2", "*vcmpequb", CODE_FOR_xfxx_simple, B_UID(365) };
+static const struct builtin B_vec_vcmpgefp = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vcmpgefp", "*vcmpgefp", CODE_FOR_xfxx_simple, B_UID(366) };
+static const struct builtin B_vec_vcmpgtfp = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vcmpgtfp", "*vcmpgtfp", CODE_FOR_xfxx_simple, B_UID(367) };
+static const struct builtin B_vec_vcmpgtsh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vcmpgtsh", "*vcmpgtsh", CODE_FOR_xfxx_simple, B_UID(368) };
+static const struct builtin B_vec_vcmpgtsw = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vcmpgtsw", "*vcmpgtsw", CODE_FOR_xfxx_simple, B_UID(369) };
+static const struct builtin B_vec_vcmpgtsb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vcmpgtsb", "*vcmpgtsb", CODE_FOR_xfxx_simple, B_UID(370) };
+static const struct builtin B_vec_vcmpgtuh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vcmpgtuh", "*vcmpgtuh", CODE_FOR_xfxx_simple, B_UID(371) };
+static const struct builtin B_vec_vcmpgtuw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vcmpgtuw", "*vcmpgtuw", CODE_FOR_xfxx_simple, B_UID(372) };
+static const struct builtin B_vec_vcmpgtub = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vcmpgtub", "*vcmpgtub", CODE_FOR_xfxx_simple, B_UID(373) };
+static const struct builtin B_vec_cmple = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 10, "vec_cmple", "*vcmpgefp", CODE_FOR_xfxx_simple, B_UID(374) };
+static const struct builtin B1_vec_cmplt = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 10, "vec_cmplt:1", "*vcmpgtfp", CODE_FOR_xfxx_simple, B_UID(375) };
+static const struct builtin B2_vec_cmplt = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 10, "vec_cmplt:2", "*vcmpgtsh", CODE_FOR_xfxx_simple, B_UID(376) };
+static const struct builtin B3_vec_cmplt = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 10, "vec_cmplt:3", "*vcmpgtsw", CODE_FOR_xfxx_simple, B_UID(377) };
+static const struct builtin B4_vec_cmplt = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 10, "vec_cmplt:4", "*vcmpgtsb", CODE_FOR_xfxx_simple, B_UID(378) };
+static const struct builtin B5_vec_cmplt = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 10, "vec_cmplt:5", "*vcmpgtuh", CODE_FOR_xfxx_simple, B_UID(379) };
+static const struct builtin B6_vec_cmplt = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 10, "vec_cmplt:6", "*vcmpgtuw", CODE_FOR_xfxx_simple, B_UID(380) };
+static const struct builtin B7_vec_cmplt = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 10, "vec_cmplt:7", "*vcmpgtub", CODE_FOR_xfxx_simple, B_UID(381) };
+static const struct builtin B_vec_vcfsx = { { &T_vec_s32, &T_immed_u5, NULL, }, "xB", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vcfsx", "*vcfsx", CODE_FOR_xfxB_fp, B_UID(382) };
+static const struct builtin B_vec_vcfux = { { &T_vec_u32, &T_immed_u5, NULL, }, "xB", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vcfux", "*vcfux", CODE_FOR_xfxB_fp, B_UID(383) };
+static const struct builtin B_vec_vctsxs = { { &T_vec_f32, &T_immed_u5, NULL, }, "xB", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vctsxs", "*vctsxs", CODE_FOR_xfxB_fp, B_UID(384) };
+static const struct builtin B_vec_vctuxs = { { &T_vec_f32, &T_immed_u5, NULL, }, "xB", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vctuxs", "*vctuxs", CODE_FOR_xfxB_fp, B_UID(385) };
+static const struct builtin B_vec_dss = { { &T_immed_u2, NULL, NULL, }, "D", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_dss", "*dss", CODE_FOR_vlfD_load, B_UID(386) };
+static const struct builtin B_vec_dssall = { { NULL, NULL, NULL, }, "", &T_volatile_void, 0, FALSE, FALSE, 0, "vec_dssall", "*dssall", CODE_FOR_vlf_load, B_UID(387) };
+static const struct builtin B1_vec_dst = { { &T_const_float_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:1", "*dst", CODE_FOR_vlfiiD_load, B_UID(388) };
+static const struct builtin B2_vec_dst = { { &T_const_int_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:2", "*dst", CODE_FOR_vlfiiD_load, B_UID(389) };
+static const struct builtin B3_vec_dst = { { &T_const_long_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:3", "*dst", CODE_FOR_vlfiiD_load, B_UID(390) };
+static const struct builtin B4_vec_dst = { { &T_const_short_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:4", "*dst", CODE_FOR_vlfiiD_load, B_UID(391) };
+static const struct builtin B5_vec_dst = { { &T_const_signed_char_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:5", "*dst", CODE_FOR_vlfiiD_load, B_UID(392) };
+static const struct builtin B6_vec_dst = { { &T_const_unsigned_char_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:6", "*dst", CODE_FOR_vlfiiD_load, B_UID(393) };
+static const struct builtin B7_vec_dst = { { &T_const_unsigned_int_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:7", "*dst", CODE_FOR_vlfiiD_load, B_UID(394) };
+static const struct builtin B8_vec_dst = { { &T_const_unsigned_long_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:8", "*dst", CODE_FOR_vlfiiD_load, B_UID(395) };
+static const struct builtin B9_vec_dst = { { &T_const_unsigned_short_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:9", "*dst", CODE_FOR_vlfiiD_load, B_UID(396) };
+static const struct builtin B10_vec_dst = { { &T_const_vec_b16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:10", "*dst", CODE_FOR_vlfiiD_load, B_UID(397) };
+static const struct builtin B11_vec_dst = { { &T_const_vec_b32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:11", "*dst", CODE_FOR_vlfiiD_load, B_UID(398) };
+static const struct builtin B12_vec_dst = { { &T_const_vec_b8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:12", "*dst", CODE_FOR_vlfiiD_load, B_UID(399) };
+static const struct builtin B13_vec_dst = { { &T_const_vec_f32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:13", "*dst", CODE_FOR_vlfiiD_load, B_UID(400) };
+static const struct builtin B14_vec_dst = { { &T_const_vec_p16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:14", "*dst", CODE_FOR_vlfiiD_load, B_UID(401) };
+static const struct builtin B15_vec_dst = { { &T_const_vec_s16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:15", "*dst", CODE_FOR_vlfiiD_load, B_UID(402) };
+static const struct builtin B16_vec_dst = { { &T_const_vec_s32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:16", "*dst", CODE_FOR_vlfiiD_load, B_UID(403) };
+static const struct builtin B17_vec_dst = { { &T_const_vec_s8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:17", "*dst", CODE_FOR_vlfiiD_load, B_UID(404) };
+static const struct builtin B18_vec_dst = { { &T_const_vec_u16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:18", "*dst", CODE_FOR_vlfiiD_load, B_UID(405) };
+static const struct builtin B19_vec_dst = { { &T_const_vec_u32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:19", "*dst", CODE_FOR_vlfiiD_load, B_UID(406) };
+static const struct builtin B20_vec_dst = { { &T_const_vec_u8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dst:20", "*dst", CODE_FOR_vlfiiD_load, B_UID(407) };
+static const struct builtin B1_vec_dstst = { { &T_const_float_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:1", "*dstst", CODE_FOR_vlfiiD_load, B_UID(408) };
+static const struct builtin B2_vec_dstst = { { &T_const_int_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:2", "*dstst", CODE_FOR_vlfiiD_load, B_UID(409) };
+static const struct builtin B3_vec_dstst = { { &T_const_long_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:3", "*dstst", CODE_FOR_vlfiiD_load, B_UID(410) };
+static const struct builtin B4_vec_dstst = { { &T_const_short_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:4", "*dstst", CODE_FOR_vlfiiD_load, B_UID(411) };
+static const struct builtin B5_vec_dstst = { { &T_const_signed_char_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:5", "*dstst", CODE_FOR_vlfiiD_load, B_UID(412) };
+static const struct builtin B6_vec_dstst = { { &T_const_unsigned_char_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:6", "*dstst", CODE_FOR_vlfiiD_load, B_UID(413) };
+static const struct builtin B7_vec_dstst = { { &T_const_unsigned_int_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:7", "*dstst", CODE_FOR_vlfiiD_load, B_UID(414) };
+static const struct builtin B8_vec_dstst = { { &T_const_unsigned_long_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:8", "*dstst", CODE_FOR_vlfiiD_load, B_UID(415) };
+static const struct builtin B9_vec_dstst = { { &T_const_unsigned_short_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:9", "*dstst", CODE_FOR_vlfiiD_load, B_UID(416) };
+static const struct builtin B10_vec_dstst = { { &T_const_vec_b16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:10", "*dstst", CODE_FOR_vlfiiD_load, B_UID(417) };
+static const struct builtin B11_vec_dstst = { { &T_const_vec_b32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:11", "*dstst", CODE_FOR_vlfiiD_load, B_UID(418) };
+static const struct builtin B12_vec_dstst = { { &T_const_vec_b8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:12", "*dstst", CODE_FOR_vlfiiD_load, B_UID(419) };
+static const struct builtin B13_vec_dstst = { { &T_const_vec_f32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:13", "*dstst", CODE_FOR_vlfiiD_load, B_UID(420) };
+static const struct builtin B14_vec_dstst = { { &T_const_vec_p16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:14", "*dstst", CODE_FOR_vlfiiD_load, B_UID(421) };
+static const struct builtin B15_vec_dstst = { { &T_const_vec_s16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:15", "*dstst", CODE_FOR_vlfiiD_load, B_UID(422) };
+static const struct builtin B16_vec_dstst = { { &T_const_vec_s32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:16", "*dstst", CODE_FOR_vlfiiD_load, B_UID(423) };
+static const struct builtin B17_vec_dstst = { { &T_const_vec_s8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:17", "*dstst", CODE_FOR_vlfiiD_load, B_UID(424) };
+static const struct builtin B18_vec_dstst = { { &T_const_vec_u16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:18", "*dstst", CODE_FOR_vlfiiD_load, B_UID(425) };
+static const struct builtin B19_vec_dstst = { { &T_const_vec_u32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:19", "*dstst", CODE_FOR_vlfiiD_load, B_UID(426) };
+static const struct builtin B20_vec_dstst = { { &T_const_vec_u8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstst:20", "*dstst", CODE_FOR_vlfiiD_load, B_UID(427) };
+static const struct builtin B1_vec_dststt = { { &T_const_float_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:1", "*dststt", CODE_FOR_vlfiiD_load, B_UID(428) };
+static const struct builtin B2_vec_dststt = { { &T_const_int_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:2", "*dststt", CODE_FOR_vlfiiD_load, B_UID(429) };
+static const struct builtin B3_vec_dststt = { { &T_const_long_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:3", "*dststt", CODE_FOR_vlfiiD_load, B_UID(430) };
+static const struct builtin B4_vec_dststt = { { &T_const_short_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:4", "*dststt", CODE_FOR_vlfiiD_load, B_UID(431) };
+static const struct builtin B5_vec_dststt = { { &T_const_signed_char_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:5", "*dststt", CODE_FOR_vlfiiD_load, B_UID(432) };
+static const struct builtin B6_vec_dststt = { { &T_const_unsigned_char_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:6", "*dststt", CODE_FOR_vlfiiD_load, B_UID(433) };
+static const struct builtin B7_vec_dststt = { { &T_const_unsigned_int_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:7", "*dststt", CODE_FOR_vlfiiD_load, B_UID(434) };
+static const struct builtin B8_vec_dststt = { { &T_const_unsigned_long_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:8", "*dststt", CODE_FOR_vlfiiD_load, B_UID(435) };
+static const struct builtin B9_vec_dststt = { { &T_const_unsigned_short_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:9", "*dststt", CODE_FOR_vlfiiD_load, B_UID(436) };
+static const struct builtin B10_vec_dststt = { { &T_const_vec_b16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:10", "*dststt", CODE_FOR_vlfiiD_load, B_UID(437) };
+static const struct builtin B11_vec_dststt = { { &T_const_vec_b32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:11", "*dststt", CODE_FOR_vlfiiD_load, B_UID(438) };
+static const struct builtin B12_vec_dststt = { { &T_const_vec_b8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:12", "*dststt", CODE_FOR_vlfiiD_load, B_UID(439) };
+static const struct builtin B13_vec_dststt = { { &T_const_vec_f32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:13", "*dststt", CODE_FOR_vlfiiD_load, B_UID(440) };
+static const struct builtin B14_vec_dststt = { { &T_const_vec_p16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:14", "*dststt", CODE_FOR_vlfiiD_load, B_UID(441) };
+static const struct builtin B15_vec_dststt = { { &T_const_vec_s16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:15", "*dststt", CODE_FOR_vlfiiD_load, B_UID(442) };
+static const struct builtin B16_vec_dststt = { { &T_const_vec_s32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:16", "*dststt", CODE_FOR_vlfiiD_load, B_UID(443) };
+static const struct builtin B17_vec_dststt = { { &T_const_vec_s8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:17", "*dststt", CODE_FOR_vlfiiD_load, B_UID(444) };
+static const struct builtin B18_vec_dststt = { { &T_const_vec_u16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:18", "*dststt", CODE_FOR_vlfiiD_load, B_UID(445) };
+static const struct builtin B19_vec_dststt = { { &T_const_vec_u32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:19", "*dststt", CODE_FOR_vlfiiD_load, B_UID(446) };
+static const struct builtin B20_vec_dststt = { { &T_const_vec_u8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dststt:20", "*dststt", CODE_FOR_vlfiiD_load, B_UID(447) };
+static const struct builtin B1_vec_dstt = { { &T_const_float_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:1", "*dstt", CODE_FOR_vlfiiD_load, B_UID(448) };
+static const struct builtin B2_vec_dstt = { { &T_const_int_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:2", "*dstt", CODE_FOR_vlfiiD_load, B_UID(449) };
+static const struct builtin B3_vec_dstt = { { &T_const_long_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:3", "*dstt", CODE_FOR_vlfiiD_load, B_UID(450) };
+static const struct builtin B4_vec_dstt = { { &T_const_short_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:4", "*dstt", CODE_FOR_vlfiiD_load, B_UID(451) };
+static const struct builtin B5_vec_dstt = { { &T_const_signed_char_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:5", "*dstt", CODE_FOR_vlfiiD_load, B_UID(452) };
+static const struct builtin B6_vec_dstt = { { &T_const_unsigned_char_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:6", "*dstt", CODE_FOR_vlfiiD_load, B_UID(453) };
+static const struct builtin B7_vec_dstt = { { &T_const_unsigned_int_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:7", "*dstt", CODE_FOR_vlfiiD_load, B_UID(454) };
+static const struct builtin B8_vec_dstt = { { &T_const_unsigned_long_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:8", "*dstt", CODE_FOR_vlfiiD_load, B_UID(455) };
+static const struct builtin B9_vec_dstt = { { &T_const_unsigned_short_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:9", "*dstt", CODE_FOR_vlfiiD_load, B_UID(456) };
+static const struct builtin B10_vec_dstt = { { &T_const_vec_b16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:10", "*dstt", CODE_FOR_vlfiiD_load, B_UID(457) };
+static const struct builtin B11_vec_dstt = { { &T_const_vec_b32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:11", "*dstt", CODE_FOR_vlfiiD_load, B_UID(458) };
+static const struct builtin B12_vec_dstt = { { &T_const_vec_b8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:12", "*dstt", CODE_FOR_vlfiiD_load, B_UID(459) };
+static const struct builtin B13_vec_dstt = { { &T_const_vec_f32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:13", "*dstt", CODE_FOR_vlfiiD_load, B_UID(460) };
+static const struct builtin B14_vec_dstt = { { &T_const_vec_p16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:14", "*dstt", CODE_FOR_vlfiiD_load, B_UID(461) };
+static const struct builtin B15_vec_dstt = { { &T_const_vec_s16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:15", "*dstt", CODE_FOR_vlfiiD_load, B_UID(462) };
+static const struct builtin B16_vec_dstt = { { &T_const_vec_s32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:16", "*dstt", CODE_FOR_vlfiiD_load, B_UID(463) };
+static const struct builtin B17_vec_dstt = { { &T_const_vec_s8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:17", "*dstt", CODE_FOR_vlfiiD_load, B_UID(464) };
+static const struct builtin B18_vec_dstt = { { &T_const_vec_u16_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:18", "*dstt", CODE_FOR_vlfiiD_load, B_UID(465) };
+static const struct builtin B19_vec_dstt = { { &T_const_vec_u32_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:19", "*dstt", CODE_FOR_vlfiiD_load, B_UID(466) };
+static const struct builtin B20_vec_dstt = { { &T_const_vec_u8_ptr, &T_int, &T_immed_u2, }, "iiD", &T_volatile_void, 3, TRUE, FALSE, 0, "vec_dstt:20", "*dstt", CODE_FOR_vlfiiD_load, B_UID(467) };
+static const struct builtin B_vec_vexptefp = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 0, "vec_vexptefp", "*vexptefp", CODE_FOR_xfx_fp, B_UID(468) };
+static const struct builtin B_vec_vrfim = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 0, "vec_vrfim", "*vrfim", CODE_FOR_xfx_fp, B_UID(469) };
+static const struct builtin B1_vec_lvx = { { &T_int, &T_const_float_ptr, NULL, }, "ii", &T_vec_f32, 2, TRUE, FALSE, 0, "vec_lvx:1", "*lvx", CODE_FOR_xlfii_load, B_UID(470) };
+static const struct builtin B2_vec_lvx = { { &T_int, &T_const_int_ptr, NULL, }, "ii", &T_vec_s32, 2, TRUE, FALSE, 0, "vec_lvx:2", "*lvx", CODE_FOR_xlfii_load, B_UID(471) };
+static const struct builtin B3_vec_lvx = { { &T_int, &T_const_long_ptr, NULL, }, "ii", &T_vec_s32, 2, TRUE, FALSE, 0, "vec_lvx:3", "*lvx", CODE_FOR_xlfii_load, B_UID(472) };
+static const struct builtin B4_vec_lvx = { { &T_int, &T_const_short_ptr, NULL, }, "ii", &T_vec_s16, 2, TRUE, FALSE, 0, "vec_lvx:4", "*lvx", CODE_FOR_xlfii_load, B_UID(473) };
+static const struct builtin B5_vec_lvx = { { &T_int, &T_const_signed_char_ptr, NULL, }, "ii", &T_vec_s8, 2, TRUE, FALSE, 0, "vec_lvx:5", "*lvx", CODE_FOR_xlfii_load, B_UID(474) };
+static const struct builtin B6_vec_lvx = { { &T_int, &T_const_unsigned_char_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, FALSE, 0, "vec_lvx:6", "*lvx", CODE_FOR_xlfii_load, B_UID(475) };
+static const struct builtin B7_vec_lvx = { { &T_int, &T_const_unsigned_int_ptr, NULL, }, "ii", &T_vec_u32, 2, TRUE, FALSE, 0, "vec_lvx:7", "*lvx", CODE_FOR_xlfii_load, B_UID(476) };
+static const struct builtin B8_vec_lvx = { { &T_int, &T_const_unsigned_long_ptr, NULL, }, "ii", &T_vec_u32, 2, TRUE, FALSE, 0, "vec_lvx:8", "*lvx", CODE_FOR_xlfii_load, B_UID(477) };
+static const struct builtin B9_vec_lvx = { { &T_int, &T_const_unsigned_short_ptr, NULL, }, "ii", &T_vec_u16, 2, TRUE, FALSE, 0, "vec_lvx:9", "*lvx", CODE_FOR_xlfii_load, B_UID(478) };
+static const struct builtin B10_vec_lvx = { { &T_int, &T_const_vec_b16_ptr, NULL, }, "ii", &T_vec_b16, 2, TRUE, FALSE, 0, "vec_lvx:10", "*lvx", CODE_FOR_xlfii_load, B_UID(479) };
+static const struct builtin B11_vec_lvx = { { &T_int, &T_const_vec_b32_ptr, NULL, }, "ii", &T_vec_b32, 2, TRUE, FALSE, 0, "vec_lvx:11", "*lvx", CODE_FOR_xlfii_load, B_UID(480) };
+static const struct builtin B12_vec_lvx = { { &T_int, &T_const_vec_b8_ptr, NULL, }, "ii", &T_vec_b8, 2, TRUE, FALSE, 0, "vec_lvx:12", "*lvx", CODE_FOR_xlfii_load, B_UID(481) };
+static const struct builtin B13_vec_lvx = { { &T_int, &T_const_vec_f32_ptr, NULL, }, "ii", &T_vec_f32, 2, TRUE, FALSE, 0, "vec_lvx:13", "*lvx", CODE_FOR_xlfii_load, B_UID(482) };
+static const struct builtin B14_vec_lvx = { { &T_int, &T_const_vec_p16_ptr, NULL, }, "ii", &T_vec_p16, 2, TRUE, FALSE, 0, "vec_lvx:14", "*lvx", CODE_FOR_xlfii_load, B_UID(483) };
+static const struct builtin B15_vec_lvx = { { &T_int, &T_const_vec_s16_ptr, NULL, }, "ii", &T_vec_s16, 2, TRUE, FALSE, 0, "vec_lvx:15", "*lvx", CODE_FOR_xlfii_load, B_UID(484) };
+static const struct builtin B16_vec_lvx = { { &T_int, &T_const_vec_s32_ptr, NULL, }, "ii", &T_vec_s32, 2, TRUE, FALSE, 0, "vec_lvx:16", "*lvx", CODE_FOR_xlfii_load, B_UID(485) };
+static const struct builtin B17_vec_lvx = { { &T_int, &T_const_vec_s8_ptr, NULL, }, "ii", &T_vec_s8, 2, TRUE, FALSE, 0, "vec_lvx:17", "*lvx", CODE_FOR_xlfii_load, B_UID(486) };
+static const struct builtin B18_vec_lvx = { { &T_int, &T_const_vec_u16_ptr, NULL, }, "ii", &T_vec_u16, 2, TRUE, FALSE, 0, "vec_lvx:18", "*lvx", CODE_FOR_xlfii_load, B_UID(487) };
+static const struct builtin B19_vec_lvx = { { &T_int, &T_const_vec_u32_ptr, NULL, }, "ii", &T_vec_u32, 2, TRUE, FALSE, 0, "vec_lvx:19", "*lvx", CODE_FOR_xlfii_load, B_UID(488) };
+static const struct builtin B20_vec_lvx = { { &T_int, &T_const_vec_u8_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, FALSE, 0, "vec_lvx:20", "*lvx", CODE_FOR_xlfii_load, B_UID(489) };
+static const struct builtin B1_vec_lvewx = { { &T_int, &T_const_float_ptr, NULL, }, "ii", &T_vec_f32, 2, TRUE, FALSE, 0, "vec_lvewx:1", "*lvewx", CODE_FOR_xlfii_load, B_UID(490) };
+static const struct builtin B2_vec_lvewx = { { &T_int, &T_const_int_ptr, NULL, }, "ii", &T_vec_s32, 2, TRUE, FALSE, 0, "vec_lvewx:2", "*lvewx", CODE_FOR_xlfii_load, B_UID(491) };
+static const struct builtin B3_vec_lvewx = { { &T_int, &T_const_long_ptr, NULL, }, "ii", &T_vec_s32, 2, TRUE, FALSE, 0, "vec_lvewx:3", "*lvewx", CODE_FOR_xlfii_load, B_UID(492) };
+static const struct builtin B1_vec_lvehx = { { &T_int, &T_const_short_ptr, NULL, }, "ii", &T_vec_s16, 2, TRUE, FALSE, 0, "vec_lvehx:1", "*lvehx", CODE_FOR_xlfii_load, B_UID(493) };
+static const struct builtin B1_vec_lvebx = { { &T_int, &T_const_signed_char_ptr, NULL, }, "ii", &T_vec_s8, 2, TRUE, FALSE, 0, "vec_lvebx:1", "*lvebx", CODE_FOR_xlfii_load, B_UID(494) };
+static const struct builtin B2_vec_lvebx = { { &T_int, &T_const_unsigned_char_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, FALSE, 0, "vec_lvebx:2", "*lvebx", CODE_FOR_xlfii_load, B_UID(495) };
+static const struct builtin B4_vec_lvewx = { { &T_int, &T_const_unsigned_int_ptr, NULL, }, "ii", &T_vec_u32, 2, TRUE, FALSE, 0, "vec_lvewx:4", "*lvewx", CODE_FOR_xlfii_load, B_UID(496) };
+static const struct builtin B5_vec_lvewx = { { &T_int, &T_const_unsigned_long_ptr, NULL, }, "ii", &T_vec_u32, 2, TRUE, FALSE, 0, "vec_lvewx:5", "*lvewx", CODE_FOR_xlfii_load, B_UID(497) };
+static const struct builtin B2_vec_lvehx = { { &T_int, &T_const_unsigned_short_ptr, NULL, }, "ii", &T_vec_u16, 2, TRUE, FALSE, 0, "vec_lvehx:2", "*lvehx", CODE_FOR_xlfii_load, B_UID(498) };
+static const struct builtin B1_vec_lvxl = { { &T_int, &T_const_float_ptr, NULL, }, "ii", &T_vec_f32, 2, TRUE, FALSE, 0, "vec_lvxl:1", "*lvxl", CODE_FOR_xlfii_load, B_UID(499) };
+static const struct builtin B2_vec_lvxl = { { &T_int, &T_const_int_ptr, NULL, }, "ii", &T_vec_s32, 2, TRUE, FALSE, 0, "vec_lvxl:2", "*lvxl", CODE_FOR_xlfii_load, B_UID(500) };
+static const struct builtin B3_vec_lvxl = { { &T_int, &T_const_long_ptr, NULL, }, "ii", &T_vec_s32, 2, TRUE, FALSE, 0, "vec_lvxl:3", "*lvxl", CODE_FOR_xlfii_load, B_UID(501) };
+static const struct builtin B4_vec_lvxl = { { &T_int, &T_const_short_ptr, NULL, }, "ii", &T_vec_s16, 2, TRUE, FALSE, 0, "vec_lvxl:4", "*lvxl", CODE_FOR_xlfii_load, B_UID(502) };
+static const struct builtin B5_vec_lvxl = { { &T_int, &T_const_signed_char_ptr, NULL, }, "ii", &T_vec_s8, 2, TRUE, FALSE, 0, "vec_lvxl:5", "*lvxl", CODE_FOR_xlfii_load, B_UID(503) };
+static const struct builtin B6_vec_lvxl = { { &T_int, &T_const_unsigned_char_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, FALSE, 0, "vec_lvxl:6", "*lvxl", CODE_FOR_xlfii_load, B_UID(504) };
+static const struct builtin B7_vec_lvxl = { { &T_int, &T_const_unsigned_int_ptr, NULL, }, "ii", &T_vec_u32, 2, TRUE, FALSE, 0, "vec_lvxl:7", "*lvxl", CODE_FOR_xlfii_load, B_UID(505) };
+static const struct builtin B8_vec_lvxl = { { &T_int, &T_const_unsigned_long_ptr, NULL, }, "ii", &T_vec_u32, 2, TRUE, FALSE, 0, "vec_lvxl:8", "*lvxl", CODE_FOR_xlfii_load, B_UID(506) };
+static const struct builtin B9_vec_lvxl = { { &T_int, &T_const_unsigned_short_ptr, NULL, }, "ii", &T_vec_u16, 2, TRUE, FALSE, 0, "vec_lvxl:9", "*lvxl", CODE_FOR_xlfii_load, B_UID(507) };
+static const struct builtin B10_vec_lvxl = { { &T_int, &T_const_vec_b16_ptr, NULL, }, "ii", &T_vec_b16, 2, TRUE, FALSE, 0, "vec_lvxl:10", "*lvxl", CODE_FOR_xlfii_load, B_UID(508) };
+static const struct builtin B11_vec_lvxl = { { &T_int, &T_const_vec_b32_ptr, NULL, }, "ii", &T_vec_b32, 2, TRUE, FALSE, 0, "vec_lvxl:11", "*lvxl", CODE_FOR_xlfii_load, B_UID(509) };
+static const struct builtin B12_vec_lvxl = { { &T_int, &T_const_vec_b8_ptr, NULL, }, "ii", &T_vec_b8, 2, TRUE, FALSE, 0, "vec_lvxl:12", "*lvxl", CODE_FOR_xlfii_load, B_UID(510) };
+static const struct builtin B13_vec_lvxl = { { &T_int, &T_const_vec_f32_ptr, NULL, }, "ii", &T_vec_f32, 2, TRUE, FALSE, 0, "vec_lvxl:13", "*lvxl", CODE_FOR_xlfii_load, B_UID(511) };
+static const struct builtin B14_vec_lvxl = { { &T_int, &T_const_vec_p16_ptr, NULL, }, "ii", &T_vec_p16, 2, TRUE, FALSE, 0, "vec_lvxl:14", "*lvxl", CODE_FOR_xlfii_load, B_UID(512) };
+static const struct builtin B15_vec_lvxl = { { &T_int, &T_const_vec_s16_ptr, NULL, }, "ii", &T_vec_s16, 2, TRUE, FALSE, 0, "vec_lvxl:15", "*lvxl", CODE_FOR_xlfii_load, B_UID(513) };
+static const struct builtin B16_vec_lvxl = { { &T_int, &T_const_vec_s32_ptr, NULL, }, "ii", &T_vec_s32, 2, TRUE, FALSE, 0, "vec_lvxl:16", "*lvxl", CODE_FOR_xlfii_load, B_UID(514) };
+static const struct builtin B17_vec_lvxl = { { &T_int, &T_const_vec_s8_ptr, NULL, }, "ii", &T_vec_s8, 2, TRUE, FALSE, 0, "vec_lvxl:17", "*lvxl", CODE_FOR_xlfii_load, B_UID(515) };
+static const struct builtin B18_vec_lvxl = { { &T_int, &T_const_vec_u16_ptr, NULL, }, "ii", &T_vec_u16, 2, TRUE, FALSE, 0, "vec_lvxl:18", "*lvxl", CODE_FOR_xlfii_load, B_UID(516) };
+static const struct builtin B19_vec_lvxl = { { &T_int, &T_const_vec_u32_ptr, NULL, }, "ii", &T_vec_u32, 2, TRUE, FALSE, 0, "vec_lvxl:19", "*lvxl", CODE_FOR_xlfii_load, B_UID(517) };
+static const struct builtin B20_vec_lvxl = { { &T_int, &T_const_vec_u8_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, FALSE, 0, "vec_lvxl:20", "*lvxl", CODE_FOR_xlfii_load, B_UID(518) };
+static const struct builtin B_vec_vlogefp = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 0, "vec_vlogefp", "*vlogefp", CODE_FOR_xfx_fp, B_UID(519) };
+static const struct builtin B1_vec_lvsl = { { &T_int, &T_const_volatile_float_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:1", "*lvsl", CODE_FOR_xfii_load, B_UID(520) };
+static const struct builtin B2_vec_lvsl = { { &T_int, &T_const_volatile_int_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:2", "*lvsl", CODE_FOR_xfii_load, B_UID(521) };
+static const struct builtin B3_vec_lvsl = { { &T_int, &T_const_volatile_long_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:3", "*lvsl", CODE_FOR_xfii_load, B_UID(522) };
+static const struct builtin B4_vec_lvsl = { { &T_int, &T_const_volatile_short_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:4", "*lvsl", CODE_FOR_xfii_load, B_UID(523) };
+static const struct builtin B5_vec_lvsl = { { &T_int, &T_const_volatile_signed_char_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:5", "*lvsl", CODE_FOR_xfii_load, B_UID(524) };
+static const struct builtin B6_vec_lvsl = { { &T_int, &T_const_volatile_unsigned_char_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:6", "*lvsl", CODE_FOR_xfii_load, B_UID(525) };
+static const struct builtin B7_vec_lvsl = { { &T_int, &T_const_volatile_unsigned_int_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:7", "*lvsl", CODE_FOR_xfii_load, B_UID(526) };
+static const struct builtin B8_vec_lvsl = { { &T_int, &T_const_volatile_unsigned_long_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:8", "*lvsl", CODE_FOR_xfii_load, B_UID(527) };
+static const struct builtin B9_vec_lvsl = { { &T_int, &T_const_volatile_unsigned_short_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 8, "vec_lvsl:9", "*lvsl", CODE_FOR_xfii_load, B_UID(528) };
+static const struct builtin B1_vec_lvsr = { { &T_int, &T_const_volatile_float_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:1", "*lvsr", CODE_FOR_xfii_load, B_UID(529) };
+static const struct builtin B2_vec_lvsr = { { &T_int, &T_const_volatile_int_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:2", "*lvsr", CODE_FOR_xfii_load, B_UID(530) };
+static const struct builtin B3_vec_lvsr = { { &T_int, &T_const_volatile_long_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:3", "*lvsr", CODE_FOR_xfii_load, B_UID(531) };
+static const struct builtin B4_vec_lvsr = { { &T_int, &T_const_volatile_short_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:4", "*lvsr", CODE_FOR_xfii_load, B_UID(532) };
+static const struct builtin B5_vec_lvsr = { { &T_int, &T_const_volatile_signed_char_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:5", "*lvsr", CODE_FOR_xfii_load, B_UID(533) };
+static const struct builtin B6_vec_lvsr = { { &T_int, &T_const_volatile_unsigned_char_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:6", "*lvsr", CODE_FOR_xfii_load, B_UID(534) };
+static const struct builtin B7_vec_lvsr = { { &T_int, &T_const_volatile_unsigned_int_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:7", "*lvsr", CODE_FOR_xfii_load, B_UID(535) };
+static const struct builtin B8_vec_lvsr = { { &T_int, &T_const_volatile_unsigned_long_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:8", "*lvsr", CODE_FOR_xfii_load, B_UID(536) };
+static const struct builtin B9_vec_lvsr = { { &T_int, &T_const_volatile_unsigned_short_ptr, NULL, }, "ii", &T_vec_u8, 2, TRUE, TRUE, 9, "vec_lvsr:9", "*lvsr", CODE_FOR_xfii_load, B_UID(537) };
+static const struct builtin B_vec_vmaddfp = { { &T_vec_f32, &T_vec_f32, &T_vec_f32, }, "xxx", &T_vec_f32, 3, FALSE, FALSE, 0, "vec_vmaddfp", "*vmaddfp", CODE_FOR_xfxxx_fp, B_UID(538) };
+static const struct builtin B_vec_vmhaddshs = { { &T_vec_s16, &T_vec_s16, &T_vec_s16, }, "xxx", &T_vec_s16, 3, FALSE, FALSE, 0, "vec_vmhaddshs", "*vmhaddshs", CODE_FOR_xfxxx_complex, B_UID(539) };
+static const struct builtin B1_vec_vmaxsh = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vmaxsh:1", "*vmaxsh", CODE_FOR_xfxx_simple, B_UID(540) };
+static const struct builtin B1_vec_vmaxuh = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vmaxuh:1", "*vmaxuh", CODE_FOR_xfxx_simple, B_UID(541) };
+static const struct builtin B1_vec_vmaxsw = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vmaxsw:1", "*vmaxsw", CODE_FOR_xfxx_simple, B_UID(542) };
+static const struct builtin B1_vec_vmaxuw = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vmaxuw:1", "*vmaxuw", CODE_FOR_xfxx_simple, B_UID(543) };
+static const struct builtin B1_vec_vmaxsb = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vmaxsb:1", "*vmaxsb", CODE_FOR_xfxx_simple, B_UID(544) };
+static const struct builtin B1_vec_vmaxub = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vmaxub:1", "*vmaxub", CODE_FOR_xfxx_simple, B_UID(545) };
+static const struct builtin B_vec_vmaxfp = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 2, "vec_vmaxfp", "*vmaxfp", CODE_FOR_xfxx_simple, B_UID(546) };
+static const struct builtin B2_vec_vmaxsh = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vmaxsh:2", "*vmaxsh", CODE_FOR_xfxx_simple, B_UID(547) };
+static const struct builtin B3_vec_vmaxsh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vmaxsh:3", "*vmaxsh", CODE_FOR_xfxx_simple, B_UID(548) };
+static const struct builtin B2_vec_vmaxsw = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vmaxsw:2", "*vmaxsw", CODE_FOR_xfxx_simple, B_UID(549) };
+static const struct builtin B3_vec_vmaxsw = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vmaxsw:3", "*vmaxsw", CODE_FOR_xfxx_simple, B_UID(550) };
+static const struct builtin B2_vec_vmaxsb = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vmaxsb:2", "*vmaxsb", CODE_FOR_xfxx_simple, B_UID(551) };
+static const struct builtin B3_vec_vmaxsb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vmaxsb:3", "*vmaxsb", CODE_FOR_xfxx_simple, B_UID(552) };
+static const struct builtin B2_vec_vmaxuh = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vmaxuh:2", "*vmaxuh", CODE_FOR_xfxx_simple, B_UID(553) };
+static const struct builtin B3_vec_vmaxuh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vmaxuh:3", "*vmaxuh", CODE_FOR_xfxx_simple, B_UID(554) };
+static const struct builtin B2_vec_vmaxuw = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vmaxuw:2", "*vmaxuw", CODE_FOR_xfxx_simple, B_UID(555) };
+static const struct builtin B3_vec_vmaxuw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vmaxuw:3", "*vmaxuw", CODE_FOR_xfxx_simple, B_UID(556) };
+static const struct builtin B2_vec_vmaxub = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vmaxub:2", "*vmaxub", CODE_FOR_xfxx_simple, B_UID(557) };
+static const struct builtin B3_vec_vmaxub = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vmaxub:3", "*vmaxub", CODE_FOR_xfxx_simple, B_UID(558) };
+static const struct builtin B1_vec_vmrghh = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vmrghh:1", "*vmrghh", CODE_FOR_xfxx_perm, B_UID(559) };
+static const struct builtin B1_vec_vmrghw = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vmrghw:1", "*vmrghw", CODE_FOR_xfxx_perm, B_UID(560) };
+static const struct builtin B1_vec_vmrghb = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vmrghb:1", "*vmrghb", CODE_FOR_xfxx_perm, B_UID(561) };
+static const struct builtin B2_vec_vmrghw = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vmrghw:2", "*vmrghw", CODE_FOR_xfxx_perm, B_UID(562) };
+static const struct builtin B2_vec_vmrghh = { { &T_vec_p16, &T_vec_p16, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vmrghh:2", "*vmrghh", CODE_FOR_xfxx_perm, B_UID(563) };
+static const struct builtin B3_vec_vmrghh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vmrghh:3", "*vmrghh", CODE_FOR_xfxx_perm, B_UID(564) };
+static const struct builtin B3_vec_vmrghw = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vmrghw:3", "*vmrghw", CODE_FOR_xfxx_perm, B_UID(565) };
+static const struct builtin B2_vec_vmrghb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vmrghb:2", "*vmrghb", CODE_FOR_xfxx_perm, B_UID(566) };
+static const struct builtin B4_vec_vmrghh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vmrghh:4", "*vmrghh", CODE_FOR_xfxx_perm, B_UID(567) };
+static const struct builtin B4_vec_vmrghw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vmrghw:4", "*vmrghw", CODE_FOR_xfxx_perm, B_UID(568) };
+static const struct builtin B3_vec_vmrghb = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vmrghb:3", "*vmrghb", CODE_FOR_xfxx_perm, B_UID(569) };
+static const struct builtin B1_vec_vmrglh = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vmrglh:1", "*vmrglh", CODE_FOR_xfxx_perm, B_UID(570) };
+static const struct builtin B1_vec_vmrglw = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vmrglw:1", "*vmrglw", CODE_FOR_xfxx_perm, B_UID(571) };
+static const struct builtin B1_vec_vmrglb = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vmrglb:1", "*vmrglb", CODE_FOR_xfxx_perm, B_UID(572) };
+static const struct builtin B2_vec_vmrglw = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vmrglw:2", "*vmrglw", CODE_FOR_xfxx_perm, B_UID(573) };
+static const struct builtin B2_vec_vmrglh = { { &T_vec_p16, &T_vec_p16, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vmrglh:2", "*vmrglh", CODE_FOR_xfxx_perm, B_UID(574) };
+static const struct builtin B3_vec_vmrglh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vmrglh:3", "*vmrglh", CODE_FOR_xfxx_perm, B_UID(575) };
+static const struct builtin B3_vec_vmrglw = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vmrglw:3", "*vmrglw", CODE_FOR_xfxx_perm, B_UID(576) };
+static const struct builtin B2_vec_vmrglb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vmrglb:2", "*vmrglb", CODE_FOR_xfxx_perm, B_UID(577) };
+static const struct builtin B4_vec_vmrglh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vmrglh:4", "*vmrglh", CODE_FOR_xfxx_perm, B_UID(578) };
+static const struct builtin B4_vec_vmrglw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vmrglw:4", "*vmrglw", CODE_FOR_xfxx_perm, B_UID(579) };
+static const struct builtin B3_vec_vmrglb = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vmrglb:3", "*vmrglb", CODE_FOR_xfxx_perm, B_UID(580) };
+static const struct builtin B_vec_mfvscr = { { NULL, NULL, NULL, }, "", &T_volatile_vec_u16, 0, FALSE, FALSE, 0, "vec_mfvscr", "*mfvscr", CODE_FOR_vxf_fxu, B_UID(581) };
+static const struct builtin B1_vec_vminsh = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vminsh:1", "*vminsh", CODE_FOR_xfxx_simple, B_UID(582) };
+static const struct builtin B1_vec_vminuh = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vminuh:1", "*vminuh", CODE_FOR_xfxx_simple, B_UID(583) };
+static const struct builtin B1_vec_vminsw = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vminsw:1", "*vminsw", CODE_FOR_xfxx_simple, B_UID(584) };
+static const struct builtin B1_vec_vminuw = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vminuw:1", "*vminuw", CODE_FOR_xfxx_simple, B_UID(585) };
+static const struct builtin B1_vec_vminsb = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vminsb:1", "*vminsb", CODE_FOR_xfxx_simple, B_UID(586) };
+static const struct builtin B1_vec_vminub = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vminub:1", "*vminub", CODE_FOR_xfxx_simple, B_UID(587) };
+static const struct builtin B_vec_vminfp = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 2, "vec_vminfp", "*vminfp", CODE_FOR_xfxx_simple, B_UID(588) };
+static const struct builtin B2_vec_vminsh = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vminsh:2", "*vminsh", CODE_FOR_xfxx_simple, B_UID(589) };
+static const struct builtin B3_vec_vminsh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vminsh:3", "*vminsh", CODE_FOR_xfxx_simple, B_UID(590) };
+static const struct builtin B2_vec_vminsw = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vminsw:2", "*vminsw", CODE_FOR_xfxx_simple, B_UID(591) };
+static const struct builtin B3_vec_vminsw = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vminsw:3", "*vminsw", CODE_FOR_xfxx_simple, B_UID(592) };
+static const struct builtin B2_vec_vminsb = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vminsb:2", "*vminsb", CODE_FOR_xfxx_simple, B_UID(593) };
+static const struct builtin B3_vec_vminsb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vminsb:3", "*vminsb", CODE_FOR_xfxx_simple, B_UID(594) };
+static const struct builtin B2_vec_vminuh = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vminuh:2", "*vminuh", CODE_FOR_xfxx_simple, B_UID(595) };
+static const struct builtin B3_vec_vminuh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vminuh:3", "*vminuh", CODE_FOR_xfxx_simple, B_UID(596) };
+static const struct builtin B2_vec_vminuw = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vminuw:2", "*vminuw", CODE_FOR_xfxx_simple, B_UID(597) };
+static const struct builtin B3_vec_vminuw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vminuw:3", "*vminuw", CODE_FOR_xfxx_simple, B_UID(598) };
+static const struct builtin B2_vec_vminub = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vminub:2", "*vminub", CODE_FOR_xfxx_simple, B_UID(599) };
+static const struct builtin B3_vec_vminub = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vminub:3", "*vminub", CODE_FOR_xfxx_simple, B_UID(600) };
+static const struct builtin B1_vec_vmladduhm = { { &T_vec_s16, &T_vec_s16, &T_vec_s16, }, "xxx", &T_vec_s16, 3, FALSE, FALSE, 0, "vec_vmladduhm:1", "*vmladduhm", CODE_FOR_xfxxx_complex, B_UID(601) };
+static const struct builtin B2_vec_vmladduhm = { { &T_vec_s16, &T_vec_u16, &T_vec_u16, }, "xxx", &T_vec_s16, 3, FALSE, FALSE, 0, "vec_vmladduhm:2", "*vmladduhm", CODE_FOR_xfxxx_complex, B_UID(602) };
+static const struct builtin B3_vec_vmladduhm = { { &T_vec_u16, &T_vec_s16, &T_vec_s16, }, "xxx", &T_vec_s16, 3, FALSE, FALSE, 0, "vec_vmladduhm:3", "*vmladduhm", CODE_FOR_xfxxx_complex, B_UID(603) };
+static const struct builtin B4_vec_vmladduhm = { { &T_vec_u16, &T_vec_u16, &T_vec_u16, }, "xxx", &T_vec_u16, 3, FALSE, FALSE, 0, "vec_vmladduhm:4", "*vmladduhm", CODE_FOR_xfxxx_complex, B_UID(604) };
+static const struct builtin B_vec_vmhraddshs = { { &T_vec_s16, &T_vec_s16, &T_vec_s16, }, "xxx", &T_vec_s16, 3, FALSE, FALSE, 0, "vec_vmhraddshs", "*vmhraddshs", CODE_FOR_xfxxx_complex, B_UID(605) };
+static const struct builtin B_vec_vmsumshm = { { &T_vec_s16, &T_vec_s16, &T_vec_s32, }, "xxx", &T_vec_s32, 3, FALSE, FALSE, 0, "vec_vmsumshm", "*vmsumshm", CODE_FOR_xfxxx_complex, B_UID(606) };
+static const struct builtin B_vec_vmsummbm = { { &T_vec_s8, &T_vec_u8, &T_vec_s32, }, "xxx", &T_vec_s32, 3, FALSE, FALSE, 0, "vec_vmsummbm", "*vmsummbm", CODE_FOR_xfxxx_complex, B_UID(607) };
+static const struct builtin B_vec_vmsumuhm = { { &T_vec_u16, &T_vec_u16, &T_vec_u32, }, "xxx", &T_vec_u32, 3, FALSE, FALSE, 0, "vec_vmsumuhm", "*vmsumuhm", CODE_FOR_xfxxx_complex, B_UID(608) };
+static const struct builtin B_vec_vmsumubm = { { &T_vec_u8, &T_vec_u8, &T_vec_u32, }, "xxx", &T_vec_u32, 3, FALSE, FALSE, 0, "vec_vmsumubm", "*vmsumubm", CODE_FOR_xfxxx_complex, B_UID(609) };
+static const struct builtin B_vec_vmsumshs = { { &T_vec_s16, &T_vec_s16, &T_vec_s32, }, "xxx", &T_vec_s32, 3, FALSE, FALSE, 0, "vec_vmsumshs", "*vmsumshs", CODE_FOR_xfxxx_complex, B_UID(610) };
+static const struct builtin B_vec_vmsumuhs = { { &T_vec_u16, &T_vec_u16, &T_vec_u32, }, "xxx", &T_vec_u32, 3, FALSE, FALSE, 0, "vec_vmsumuhs", "*vmsumuhs", CODE_FOR_xfxxx_complex, B_UID(611) };
+static const struct builtin B1_vec_mtvscr = { { &T_vec_b16, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:1", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(612) };
+static const struct builtin B2_vec_mtvscr = { { &T_vec_b32, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:2", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(613) };
+static const struct builtin B3_vec_mtvscr = { { &T_vec_b8, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:3", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(614) };
+static const struct builtin B4_vec_mtvscr = { { &T_vec_p16, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:4", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(615) };
+static const struct builtin B5_vec_mtvscr = { { &T_vec_s16, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:5", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(616) };
+static const struct builtin B6_vec_mtvscr = { { &T_vec_s32, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:6", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(617) };
+static const struct builtin B7_vec_mtvscr = { { &T_vec_s8, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:7", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(618) };
+static const struct builtin B8_vec_mtvscr = { { &T_vec_u16, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:8", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(619) };
+static const struct builtin B9_vec_mtvscr = { { &T_vec_u32, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:9", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(620) };
+static const struct builtin B10_vec_mtvscr = { { &T_vec_u8, NULL, NULL, }, "x", &T_volatile_void, 1, FALSE, FALSE, 0, "vec_mtvscr:10", "*mtvscr", CODE_FOR_vfx_fxu, B_UID(621) };
+static const struct builtin B_vec_vmulesh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vmulesh", "*vmulesh", CODE_FOR_xfxx_complex, B_UID(622) };
+static const struct builtin B_vec_vmulesb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vmulesb", "*vmulesb", CODE_FOR_xfxx_complex, B_UID(623) };
+static const struct builtin B_vec_vmuleuh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vmuleuh", "*vmuleuh", CODE_FOR_xfxx_complex, B_UID(624) };
+static const struct builtin B_vec_vmuleub = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vmuleub", "*vmuleub", CODE_FOR_xfxx_complex, B_UID(625) };
+static const struct builtin B_vec_vmulosh = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vmulosh", "*vmulosh", CODE_FOR_xfxx_complex, B_UID(626) };
+static const struct builtin B_vec_vmulosb = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vmulosb", "*vmulosb", CODE_FOR_xfxx_complex, B_UID(627) };
+static const struct builtin B_vec_vmulouh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vmulouh", "*vmulouh", CODE_FOR_xfxx_complex, B_UID(628) };
+static const struct builtin B_vec_vmuloub = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vmuloub", "*vmuloub", CODE_FOR_xfxx_complex, B_UID(629) };
+static const struct builtin B_vec_vnmsubfp = { { &T_vec_f32, &T_vec_f32, &T_vec_f32, }, "xxx", &T_vec_f32, 3, FALSE, FALSE, 0, "vec_vnmsubfp", "*vnmsubfp", CODE_FOR_xfxxx_fp, B_UID(630) };
+static const struct builtin B1_vec_vnor = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vnor:1", "*vnor", CODE_FOR_xfxx_simple, B_UID(631) };
+static const struct builtin B2_vec_vnor = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vnor:2", "*vnor", CODE_FOR_xfxx_simple, B_UID(632) };
+static const struct builtin B3_vec_vnor = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vnor:3", "*vnor", CODE_FOR_xfxx_simple, B_UID(633) };
+static const struct builtin B4_vec_vnor = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vnor:4", "*vnor", CODE_FOR_xfxx_simple, B_UID(634) };
+static const struct builtin B5_vec_vnor = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vnor:5", "*vnor", CODE_FOR_xfxx_simple, B_UID(635) };
+static const struct builtin B6_vec_vnor = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vnor:6", "*vnor", CODE_FOR_xfxx_simple, B_UID(636) };
+static const struct builtin B7_vec_vnor = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vnor:7", "*vnor", CODE_FOR_xfxx_simple, B_UID(637) };
+static const struct builtin B8_vec_vnor = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vnor:8", "*vnor", CODE_FOR_xfxx_simple, B_UID(638) };
+static const struct builtin B9_vec_vnor = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vnor:9", "*vnor", CODE_FOR_xfxx_simple, B_UID(639) };
+static const struct builtin B10_vec_vnor = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vnor:10", "*vnor", CODE_FOR_xfxx_simple, B_UID(640) };
+static const struct builtin B1_vec_vor = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 2, "vec_vor:1", "*vor", CODE_FOR_xfxx_simple, B_UID(641) };
+static const struct builtin B2_vec_vor = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vor:2", "*vor", CODE_FOR_xfxx_simple, B_UID(642) };
+static const struct builtin B3_vec_vor = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vor:3", "*vor", CODE_FOR_xfxx_simple, B_UID(643) };
+static const struct builtin B4_vec_vor = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 2, "vec_vor:4", "*vor", CODE_FOR_xfxx_simple, B_UID(644) };
+static const struct builtin B5_vec_vor = { { &T_vec_b32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 2, "vec_vor:5", "*vor", CODE_FOR_xfxx_simple, B_UID(645) };
+static const struct builtin B6_vec_vor = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vor:6", "*vor", CODE_FOR_xfxx_simple, B_UID(646) };
+static const struct builtin B7_vec_vor = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vor:7", "*vor", CODE_FOR_xfxx_simple, B_UID(647) };
+static const struct builtin B8_vec_vor = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 2, "vec_vor:8", "*vor", CODE_FOR_xfxx_simple, B_UID(648) };
+static const struct builtin B9_vec_vor = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vor:9", "*vor", CODE_FOR_xfxx_simple, B_UID(649) };
+static const struct builtin B10_vec_vor = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vor:10", "*vor", CODE_FOR_xfxx_simple, B_UID(650) };
+static const struct builtin B11_vec_vor = { { &T_vec_f32, &T_vec_b32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 2, "vec_vor:11", "*vor", CODE_FOR_xfxx_simple, B_UID(651) };
+static const struct builtin B12_vec_vor = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 2, "vec_vor:12", "*vor", CODE_FOR_xfxx_simple, B_UID(652) };
+static const struct builtin B13_vec_vor = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vor:13", "*vor", CODE_FOR_xfxx_simple, B_UID(653) };
+static const struct builtin B14_vec_vor = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 2, "vec_vor:14", "*vor", CODE_FOR_xfxx_simple, B_UID(654) };
+static const struct builtin B15_vec_vor = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vor:15", "*vor", CODE_FOR_xfxx_simple, B_UID(655) };
+static const struct builtin B16_vec_vor = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 2, "vec_vor:16", "*vor", CODE_FOR_xfxx_simple, B_UID(656) };
+static const struct builtin B17_vec_vor = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vor:17", "*vor", CODE_FOR_xfxx_simple, B_UID(657) };
+static const struct builtin B18_vec_vor = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 2, "vec_vor:18", "*vor", CODE_FOR_xfxx_simple, B_UID(658) };
+static const struct builtin B19_vec_vor = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vor:19", "*vor", CODE_FOR_xfxx_simple, B_UID(659) };
+static const struct builtin B20_vec_vor = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 2, "vec_vor:20", "*vor", CODE_FOR_xfxx_simple, B_UID(660) };
+static const struct builtin B21_vec_vor = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vor:21", "*vor", CODE_FOR_xfxx_simple, B_UID(661) };
+static const struct builtin B22_vec_vor = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 2, "vec_vor:22", "*vor", CODE_FOR_xfxx_simple, B_UID(662) };
+static const struct builtin B23_vec_vor = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vor:23", "*vor", CODE_FOR_xfxx_simple, B_UID(663) };
+static const struct builtin B24_vec_vor = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 2, "vec_vor:24", "*vor", CODE_FOR_xfxx_simple, B_UID(664) };
+static const struct builtin B1_vec_vpkuhum = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vpkuhum:1", "*vpkuhum", CODE_FOR_xfxx_perm, B_UID(665) };
+static const struct builtin B1_vec_vpkuwum = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vpkuwum:1", "*vpkuwum", CODE_FOR_xfxx_perm, B_UID(666) };
+static const struct builtin B2_vec_vpkuhum = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vpkuhum:2", "*vpkuhum", CODE_FOR_xfxx_perm, B_UID(667) };
+static const struct builtin B2_vec_vpkuwum = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vpkuwum:2", "*vpkuwum", CODE_FOR_xfxx_perm, B_UID(668) };
+static const struct builtin B3_vec_vpkuhum = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vpkuhum:3", "*vpkuhum", CODE_FOR_xfxx_perm, B_UID(669) };
+static const struct builtin B3_vec_vpkuwum = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vpkuwum:3", "*vpkuwum", CODE_FOR_xfxx_perm, B_UID(670) };
+static const struct builtin B_vec_vpkpx = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vpkpx", "*vpkpx", CODE_FOR_xfxx_perm, B_UID(671) };
+static const struct builtin B_vec_vpkshss = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vpkshss", "*vpkshss", CODE_FOR_xfxx_perm, B_UID(672) };
+static const struct builtin B_vec_vpkswss = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vpkswss", "*vpkswss", CODE_FOR_xfxx_perm, B_UID(673) };
+static const struct builtin B_vec_vpkuhus = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vpkuhus", "*vpkuhus", CODE_FOR_xfxx_perm, B_UID(674) };
+static const struct builtin B_vec_vpkuwus = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vpkuwus", "*vpkuwus", CODE_FOR_xfxx_perm, B_UID(675) };
+static const struct builtin B_vec_vpkshus = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vpkshus", "*vpkshus", CODE_FOR_xfxx_perm, B_UID(676) };
+static const struct builtin B_vec_vpkswus = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vpkswus", "*vpkswus", CODE_FOR_xfxx_perm, B_UID(677) };
+static const struct builtin B1_vec_vperm = { { &T_vec_b16, &T_vec_b16, &T_vec_u8, }, "xxx", &T_vec_b16, 3, FALSE, FALSE, 0, "vec_vperm:1", "*vperm", CODE_FOR_xfxxx_perm, B_UID(678) };
+static const struct builtin B2_vec_vperm = { { &T_vec_b32, &T_vec_b32, &T_vec_u8, }, "xxx", &T_vec_b32, 3, FALSE, FALSE, 0, "vec_vperm:2", "*vperm", CODE_FOR_xfxxx_perm, B_UID(679) };
+static const struct builtin B3_vec_vperm = { { &T_vec_b8, &T_vec_b8, &T_vec_u8, }, "xxx", &T_vec_b8, 3, FALSE, FALSE, 0, "vec_vperm:3", "*vperm", CODE_FOR_xfxxx_perm, B_UID(680) };
+static const struct builtin B4_vec_vperm = { { &T_vec_f32, &T_vec_f32, &T_vec_u8, }, "xxx", &T_vec_f32, 3, FALSE, FALSE, 0, "vec_vperm:4", "*vperm", CODE_FOR_xfxxx_perm, B_UID(681) };
+static const struct builtin B5_vec_vperm = { { &T_vec_p16, &T_vec_p16, &T_vec_u8, }, "xxx", &T_vec_p16, 3, FALSE, FALSE, 0, "vec_vperm:5", "*vperm", CODE_FOR_xfxxx_perm, B_UID(682) };
+static const struct builtin B6_vec_vperm = { { &T_vec_s16, &T_vec_s16, &T_vec_u8, }, "xxx", &T_vec_s16, 3, FALSE, FALSE, 0, "vec_vperm:6", "*vperm", CODE_FOR_xfxxx_perm, B_UID(683) };
+static const struct builtin B7_vec_vperm = { { &T_vec_s32, &T_vec_s32, &T_vec_u8, }, "xxx", &T_vec_s32, 3, FALSE, FALSE, 0, "vec_vperm:7", "*vperm", CODE_FOR_xfxxx_perm, B_UID(684) };
+static const struct builtin B8_vec_vperm = { { &T_vec_s8, &T_vec_s8, &T_vec_u8, }, "xxx", &T_vec_s8, 3, FALSE, FALSE, 0, "vec_vperm:8", "*vperm", CODE_FOR_xfxxx_perm, B_UID(685) };
+static const struct builtin B9_vec_vperm = { { &T_vec_u16, &T_vec_u16, &T_vec_u8, }, "xxx", &T_vec_u16, 3, FALSE, FALSE, 0, "vec_vperm:9", "*vperm", CODE_FOR_xfxxx_perm, B_UID(686) };
+static const struct builtin B10_vec_vperm = { { &T_vec_u32, &T_vec_u32, &T_vec_u8, }, "xxx", &T_vec_u32, 3, FALSE, FALSE, 0, "vec_vperm:10", "*vperm", CODE_FOR_xfxxx_perm, B_UID(687) };
+static const struct builtin B11_vec_vperm = { { &T_vec_u8, &T_vec_u8, &T_vec_u8, }, "xxx", &T_vec_u8, 3, FALSE, FALSE, 0, "vec_vperm:11", "*vperm", CODE_FOR_xfxxx_perm, B_UID(688) };
+static const struct builtin B_vec_vrefp = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 0, "vec_vrefp", "*vrefp", CODE_FOR_xfx_fp, B_UID(689) };
+static const struct builtin B1_vec_vrlh = { { &T_vec_s16, &T_vec_u16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vrlh:1", "*vrlh", CODE_FOR_xfxx_simple, B_UID(690) };
+static const struct builtin B1_vec_vrlw = { { &T_vec_s32, &T_vec_u32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vrlw:1", "*vrlw", CODE_FOR_xfxx_simple, B_UID(691) };
+static const struct builtin B1_vec_vrlb = { { &T_vec_s8, &T_vec_u8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vrlb:1", "*vrlb", CODE_FOR_xfxx_simple, B_UID(692) };
+static const struct builtin B2_vec_vrlh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vrlh:2", "*vrlh", CODE_FOR_xfxx_simple, B_UID(693) };
+static const struct builtin B2_vec_vrlw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vrlw:2", "*vrlw", CODE_FOR_xfxx_simple, B_UID(694) };
+static const struct builtin B2_vec_vrlb = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vrlb:2", "*vrlb", CODE_FOR_xfxx_simple, B_UID(695) };
+static const struct builtin B_vec_vrfin = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 0, "vec_vrfin", "*vrfin", CODE_FOR_xfx_fp, B_UID(696) };
+static const struct builtin B_vec_vrsqrtefp = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 0, "vec_vrsqrtefp", "*vrsqrtefp", CODE_FOR_xfx_fp, B_UID(697) };
+static const struct builtin B1_vec_vsel = { { &T_vec_b16, &T_vec_b16, &T_vec_b16, }, "xxx", &T_vec_b16, 3, FALSE, FALSE, 0, "vec_vsel:1", "*vsel", CODE_FOR_xfxxx_simple, B_UID(698) };
+static const struct builtin B2_vec_vsel = { { &T_vec_b16, &T_vec_b16, &T_vec_u16, }, "xxx", &T_vec_b16, 3, FALSE, FALSE, 0, "vec_vsel:2", "*vsel", CODE_FOR_xfxxx_simple, B_UID(699) };
+static const struct builtin B3_vec_vsel = { { &T_vec_b32, &T_vec_b32, &T_vec_b32, }, "xxx", &T_vec_b32, 3, FALSE, FALSE, 0, "vec_vsel:3", "*vsel", CODE_FOR_xfxxx_simple, B_UID(700) };
+static const struct builtin B4_vec_vsel = { { &T_vec_b32, &T_vec_b32, &T_vec_u32, }, "xxx", &T_vec_b32, 3, FALSE, FALSE, 0, "vec_vsel:4", "*vsel", CODE_FOR_xfxxx_simple, B_UID(701) };
+static const struct builtin B5_vec_vsel = { { &T_vec_b8, &T_vec_b8, &T_vec_b8, }, "xxx", &T_vec_b8, 3, FALSE, FALSE, 0, "vec_vsel:5", "*vsel", CODE_FOR_xfxxx_simple, B_UID(702) };
+static const struct builtin B6_vec_vsel = { { &T_vec_b8, &T_vec_b8, &T_vec_u8, }, "xxx", &T_vec_b8, 3, FALSE, FALSE, 0, "vec_vsel:6", "*vsel", CODE_FOR_xfxxx_simple, B_UID(703) };
+static const struct builtin B7_vec_vsel = { { &T_vec_f32, &T_vec_f32, &T_vec_b32, }, "xxx", &T_vec_f32, 3, FALSE, FALSE, 0, "vec_vsel:7", "*vsel", CODE_FOR_xfxxx_simple, B_UID(704) };
+static const struct builtin B8_vec_vsel = { { &T_vec_f32, &T_vec_f32, &T_vec_u32, }, "xxx", &T_vec_f32, 3, FALSE, FALSE, 0, "vec_vsel:8", "*vsel", CODE_FOR_xfxxx_simple, B_UID(705) };
+static const struct builtin B9_vec_vsel = { { &T_vec_s16, &T_vec_s16, &T_vec_b16, }, "xxx", &T_vec_s16, 3, FALSE, FALSE, 0, "vec_vsel:9", "*vsel", CODE_FOR_xfxxx_simple, B_UID(706) };
+static const struct builtin B10_vec_vsel = { { &T_vec_s16, &T_vec_s16, &T_vec_u16, }, "xxx", &T_vec_s16, 3, FALSE, FALSE, 0, "vec_vsel:10", "*vsel", CODE_FOR_xfxxx_simple, B_UID(707) };
+static const struct builtin B11_vec_vsel = { { &T_vec_s32, &T_vec_s32, &T_vec_b32, }, "xxx", &T_vec_s32, 3, FALSE, FALSE, 0, "vec_vsel:11", "*vsel", CODE_FOR_xfxxx_simple, B_UID(708) };
+static const struct builtin B12_vec_vsel = { { &T_vec_s32, &T_vec_s32, &T_vec_u32, }, "xxx", &T_vec_s32, 3, FALSE, FALSE, 0, "vec_vsel:12", "*vsel", CODE_FOR_xfxxx_simple, B_UID(709) };
+static const struct builtin B13_vec_vsel = { { &T_vec_s8, &T_vec_s8, &T_vec_b8, }, "xxx", &T_vec_s8, 3, FALSE, FALSE, 0, "vec_vsel:13", "*vsel", CODE_FOR_xfxxx_simple, B_UID(710) };
+static const struct builtin B14_vec_vsel = { { &T_vec_s8, &T_vec_s8, &T_vec_u8, }, "xxx", &T_vec_s8, 3, FALSE, FALSE, 0, "vec_vsel:14", "*vsel", CODE_FOR_xfxxx_simple, B_UID(711) };
+static const struct builtin B15_vec_vsel = { { &T_vec_u16, &T_vec_u16, &T_vec_b16, }, "xxx", &T_vec_u16, 3, FALSE, FALSE, 0, "vec_vsel:15", "*vsel", CODE_FOR_xfxxx_simple, B_UID(712) };
+static const struct builtin B16_vec_vsel = { { &T_vec_u16, &T_vec_u16, &T_vec_u16, }, "xxx", &T_vec_u16, 3, FALSE, FALSE, 0, "vec_vsel:16", "*vsel", CODE_FOR_xfxxx_simple, B_UID(713) };
+static const struct builtin B17_vec_vsel = { { &T_vec_u32, &T_vec_u32, &T_vec_b32, }, "xxx", &T_vec_u32, 3, FALSE, FALSE, 0, "vec_vsel:17", "*vsel", CODE_FOR_xfxxx_simple, B_UID(714) };
+static const struct builtin B18_vec_vsel = { { &T_vec_u32, &T_vec_u32, &T_vec_u32, }, "xxx", &T_vec_u32, 3, FALSE, FALSE, 0, "vec_vsel:18", "*vsel", CODE_FOR_xfxxx_simple, B_UID(715) };
+static const struct builtin B19_vec_vsel = { { &T_vec_u8, &T_vec_u8, &T_vec_b8, }, "xxx", &T_vec_u8, 3, FALSE, FALSE, 0, "vec_vsel:19", "*vsel", CODE_FOR_xfxxx_simple, B_UID(716) };
+static const struct builtin B20_vec_vsel = { { &T_vec_u8, &T_vec_u8, &T_vec_u8, }, "xxx", &T_vec_u8, 3, FALSE, FALSE, 0, "vec_vsel:20", "*vsel", CODE_FOR_xfxxx_simple, B_UID(717) };
+static const struct builtin B1_vec_vslh = { { &T_vec_s16, &T_vec_u16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vslh:1", "*vslh", CODE_FOR_xfxx_simple, B_UID(718) };
+static const struct builtin B1_vec_vslw = { { &T_vec_s32, &T_vec_u32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vslw:1", "*vslw", CODE_FOR_xfxx_simple, B_UID(719) };
+static const struct builtin B1_vec_vslb = { { &T_vec_s8, &T_vec_u8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vslb:1", "*vslb", CODE_FOR_xfxx_simple, B_UID(720) };
+static const struct builtin B2_vec_vslh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vslh:2", "*vslh", CODE_FOR_xfxx_simple, B_UID(721) };
+static const struct builtin B2_vec_vslw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vslw:2", "*vslw", CODE_FOR_xfxx_simple, B_UID(722) };
+static const struct builtin B2_vec_vslb = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vslb:2", "*vslb", CODE_FOR_xfxx_simple, B_UID(723) };
+static const struct builtin B1_vec_vsldoi = { { &T_vec_b16, &T_vec_b16, &T_immed_u4, }, "xxC", &T_vec_b16, 3, FALSE, FALSE, 3, "vec_vsldoi:1", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(724) };
+static const struct builtin B2_vec_vsldoi = { { &T_vec_b32, &T_vec_b32, &T_immed_u4, }, "xxC", &T_vec_b32, 3, FALSE, FALSE, 3, "vec_vsldoi:2", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(725) };
+static const struct builtin B3_vec_vsldoi = { { &T_vec_b8, &T_vec_b8, &T_immed_u4, }, "xxC", &T_vec_b8, 3, FALSE, FALSE, 3, "vec_vsldoi:3", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(726) };
+static const struct builtin B4_vec_vsldoi = { { &T_vec_f32, &T_vec_f32, &T_immed_u4, }, "xxC", &T_vec_f32, 3, FALSE, FALSE, 3, "vec_vsldoi:4", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(727) };
+static const struct builtin B5_vec_vsldoi = { { &T_vec_p16, &T_vec_p16, &T_immed_u4, }, "xxC", &T_vec_p16, 3, FALSE, FALSE, 3, "vec_vsldoi:5", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(728) };
+static const struct builtin B6_vec_vsldoi = { { &T_vec_s16, &T_vec_s16, &T_immed_u4, }, "xxC", &T_vec_s16, 3, FALSE, FALSE, 3, "vec_vsldoi:6", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(729) };
+static const struct builtin B7_vec_vsldoi = { { &T_vec_s32, &T_vec_s32, &T_immed_u4, }, "xxC", &T_vec_s32, 3, FALSE, FALSE, 3, "vec_vsldoi:7", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(730) };
+static const struct builtin B8_vec_vsldoi = { { &T_vec_s8, &T_vec_s8, &T_immed_u4, }, "xxC", &T_vec_s8, 3, FALSE, FALSE, 3, "vec_vsldoi:8", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(731) };
+static const struct builtin B9_vec_vsldoi = { { &T_vec_u16, &T_vec_u16, &T_immed_u4, }, "xxC", &T_vec_u16, 3, FALSE, FALSE, 3, "vec_vsldoi:9", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(732) };
+static const struct builtin B10_vec_vsldoi = { { &T_vec_u32, &T_vec_u32, &T_immed_u4, }, "xxC", &T_vec_u32, 3, FALSE, FALSE, 3, "vec_vsldoi:10", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(733) };
+static const struct builtin B11_vec_vsldoi = { { &T_vec_u8, &T_vec_u8, &T_immed_u4, }, "xxC", &T_vec_u8, 3, FALSE, FALSE, 3, "vec_vsldoi:11", "*vsldoi", CODE_FOR_xfxxC_perm, B_UID(734) };
+static const struct builtin B1_vec_vsl = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vsl:1", "*vsl", CODE_FOR_xfxx_simple, B_UID(735) };
+static const struct builtin B2_vec_vsl = { { &T_vec_b16, &T_vec_u32, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vsl:2", "*vsl", CODE_FOR_xfxx_simple, B_UID(736) };
+static const struct builtin B3_vec_vsl = { { &T_vec_b16, &T_vec_u8, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vsl:3", "*vsl", CODE_FOR_xfxx_simple, B_UID(737) };
+static const struct builtin B4_vec_vsl = { { &T_vec_b32, &T_vec_u16, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vsl:4", "*vsl", CODE_FOR_xfxx_simple, B_UID(738) };
+static const struct builtin B5_vec_vsl = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vsl:5", "*vsl", CODE_FOR_xfxx_simple, B_UID(739) };
+static const struct builtin B6_vec_vsl = { { &T_vec_b32, &T_vec_u8, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vsl:6", "*vsl", CODE_FOR_xfxx_simple, B_UID(740) };
+static const struct builtin B7_vec_vsl = { { &T_vec_b8, &T_vec_u16, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vsl:7", "*vsl", CODE_FOR_xfxx_simple, B_UID(741) };
+static const struct builtin B8_vec_vsl = { { &T_vec_b8, &T_vec_u32, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vsl:8", "*vsl", CODE_FOR_xfxx_simple, B_UID(742) };
+static const struct builtin B9_vec_vsl = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vsl:9", "*vsl", CODE_FOR_xfxx_simple, B_UID(743) };
+static const struct builtin B10_vec_vsl = { { &T_vec_p16, &T_vec_u16, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsl:10", "*vsl", CODE_FOR_xfxx_simple, B_UID(744) };
+static const struct builtin B11_vec_vsl = { { &T_vec_p16, &T_vec_u32, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsl:11", "*vsl", CODE_FOR_xfxx_simple, B_UID(745) };
+static const struct builtin B12_vec_vsl = { { &T_vec_p16, &T_vec_u8, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsl:12", "*vsl", CODE_FOR_xfxx_simple, B_UID(746) };
+static const struct builtin B13_vec_vsl = { { &T_vec_s16, &T_vec_u16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsl:13", "*vsl", CODE_FOR_xfxx_simple, B_UID(747) };
+static const struct builtin B14_vec_vsl = { { &T_vec_s16, &T_vec_u32, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsl:14", "*vsl", CODE_FOR_xfxx_simple, B_UID(748) };
+static const struct builtin B15_vec_vsl = { { &T_vec_s16, &T_vec_u8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsl:15", "*vsl", CODE_FOR_xfxx_simple, B_UID(749) };
+static const struct builtin B16_vec_vsl = { { &T_vec_s32, &T_vec_u16, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsl:16", "*vsl", CODE_FOR_xfxx_simple, B_UID(750) };
+static const struct builtin B17_vec_vsl = { { &T_vec_s32, &T_vec_u32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsl:17", "*vsl", CODE_FOR_xfxx_simple, B_UID(751) };
+static const struct builtin B18_vec_vsl = { { &T_vec_s32, &T_vec_u8, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsl:18", "*vsl", CODE_FOR_xfxx_simple, B_UID(752) };
+static const struct builtin B19_vec_vsl = { { &T_vec_s8, &T_vec_u16, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsl:19", "*vsl", CODE_FOR_xfxx_simple, B_UID(753) };
+static const struct builtin B20_vec_vsl = { { &T_vec_s8, &T_vec_u32, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsl:20", "*vsl", CODE_FOR_xfxx_simple, B_UID(754) };
+static const struct builtin B21_vec_vsl = { { &T_vec_s8, &T_vec_u8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsl:21", "*vsl", CODE_FOR_xfxx_simple, B_UID(755) };
+static const struct builtin B22_vec_vsl = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsl:22", "*vsl", CODE_FOR_xfxx_simple, B_UID(756) };
+static const struct builtin B23_vec_vsl = { { &T_vec_u16, &T_vec_u32, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsl:23", "*vsl", CODE_FOR_xfxx_simple, B_UID(757) };
+static const struct builtin B24_vec_vsl = { { &T_vec_u16, &T_vec_u8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsl:24", "*vsl", CODE_FOR_xfxx_simple, B_UID(758) };
+static const struct builtin B25_vec_vsl = { { &T_vec_u32, &T_vec_u16, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsl:25", "*vsl", CODE_FOR_xfxx_simple, B_UID(759) };
+static const struct builtin B26_vec_vsl = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsl:26", "*vsl", CODE_FOR_xfxx_simple, B_UID(760) };
+static const struct builtin B27_vec_vsl = { { &T_vec_u32, &T_vec_u8, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsl:27", "*vsl", CODE_FOR_xfxx_simple, B_UID(761) };
+static const struct builtin B28_vec_vsl = { { &T_vec_u8, &T_vec_u16, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsl:28", "*vsl", CODE_FOR_xfxx_simple, B_UID(762) };
+static const struct builtin B29_vec_vsl = { { &T_vec_u8, &T_vec_u32, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsl:29", "*vsl", CODE_FOR_xfxx_simple, B_UID(763) };
+static const struct builtin B30_vec_vsl = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsl:30", "*vsl", CODE_FOR_xfxx_simple, B_UID(764) };
+static const struct builtin B1_vec_vslo = { { &T_vec_f32, &T_vec_s8, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vslo:1", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(765) };
+static const struct builtin B2_vec_vslo = { { &T_vec_f32, &T_vec_u8, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vslo:2", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(766) };
+static const struct builtin B3_vec_vslo = { { &T_vec_p16, &T_vec_s8, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vslo:3", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(767) };
+static const struct builtin B4_vec_vslo = { { &T_vec_p16, &T_vec_u8, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vslo:4", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(768) };
+static const struct builtin B5_vec_vslo = { { &T_vec_s16, &T_vec_s8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vslo:5", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(769) };
+static const struct builtin B6_vec_vslo = { { &T_vec_s16, &T_vec_u8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vslo:6", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(770) };
+static const struct builtin B7_vec_vslo = { { &T_vec_s32, &T_vec_s8, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vslo:7", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(771) };
+static const struct builtin B8_vec_vslo = { { &T_vec_s32, &T_vec_u8, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vslo:8", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(772) };
+static const struct builtin B9_vec_vslo = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vslo:9", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(773) };
+static const struct builtin B10_vec_vslo = { { &T_vec_s8, &T_vec_u8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vslo:10", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(774) };
+static const struct builtin B11_vec_vslo = { { &T_vec_u16, &T_vec_s8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vslo:11", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(775) };
+static const struct builtin B12_vec_vslo = { { &T_vec_u16, &T_vec_u8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vslo:12", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(776) };
+static const struct builtin B13_vec_vslo = { { &T_vec_u32, &T_vec_s8, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vslo:13", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(777) };
+static const struct builtin B14_vec_vslo = { { &T_vec_u32, &T_vec_u8, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vslo:14", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(778) };
+static const struct builtin B15_vec_vslo = { { &T_vec_u8, &T_vec_s8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vslo:15", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(779) };
+static const struct builtin B16_vec_vslo = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vslo:16", "*vslo", CODE_FOR_xfxx_perm_bug, B_UID(780) };
+static const struct builtin B1_vec_vsplth = { { &T_vec_b16, &T_immed_u5, NULL, }, "xB", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vsplth:1", "*vsplth", CODE_FOR_xfxB_perm, B_UID(781) };
+static const struct builtin B1_vec_vspltw = { { &T_vec_b32, &T_immed_u5, NULL, }, "xB", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vspltw:1", "*vspltw", CODE_FOR_xfxB_perm, B_UID(782) };
+static const struct builtin B1_vec_vspltb = { { &T_vec_b8, &T_immed_u5, NULL, }, "xB", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vspltb:1", "*vspltb", CODE_FOR_xfxB_perm, B_UID(783) };
+static const struct builtin B2_vec_vspltw = { { &T_vec_f32, &T_immed_u5, NULL, }, "xB", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vspltw:2", "*vspltw", CODE_FOR_xfxB_perm, B_UID(784) };
+static const struct builtin B2_vec_vsplth = { { &T_vec_p16, &T_immed_u5, NULL, }, "xB", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsplth:2", "*vsplth", CODE_FOR_xfxB_perm, B_UID(785) };
+static const struct builtin B3_vec_vsplth = { { &T_vec_s16, &T_immed_u5, NULL, }, "xB", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsplth:3", "*vsplth", CODE_FOR_xfxB_perm, B_UID(786) };
+static const struct builtin B3_vec_vspltw = { { &T_vec_s32, &T_immed_u5, NULL, }, "xB", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vspltw:3", "*vspltw", CODE_FOR_xfxB_perm, B_UID(787) };
+static const struct builtin B2_vec_vspltb = { { &T_vec_s8, &T_immed_u5, NULL, }, "xB", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vspltb:2", "*vspltb", CODE_FOR_xfxB_perm, B_UID(788) };
+static const struct builtin B4_vec_vsplth = { { &T_vec_u16, &T_immed_u5, NULL, }, "xB", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsplth:4", "*vsplth", CODE_FOR_xfxB_perm, B_UID(789) };
+static const struct builtin B4_vec_vspltw = { { &T_vec_u32, &T_immed_u5, NULL, }, "xB", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vspltw:4", "*vspltw", CODE_FOR_xfxB_perm, B_UID(790) };
+static const struct builtin B3_vec_vspltb = { { &T_vec_u8, &T_immed_u5, NULL, }, "xB", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vspltb:3", "*vspltb", CODE_FOR_xfxB_perm, B_UID(791) };
+static const struct builtin B_vec_vspltish = { { &T_immed_s5, NULL, NULL, }, "A", &T_vec_s16, 1, FALSE, FALSE, 5, "vec_vspltish", "*vspltish", CODE_FOR_xfA_perm, B_UID(792) };
+static const struct builtin B_vec_vspltisw = { { &T_immed_s5, NULL, NULL, }, "A", &T_vec_s32, 1, FALSE, FALSE, 6, "vec_vspltisw", "*vspltisw", CODE_FOR_xfA_perm, B_UID(793) };
+static const struct builtin B_vec_vspltisb = { { &T_immed_s5, NULL, NULL, }, "A", &T_vec_s8, 1, FALSE, FALSE, 4, "vec_vspltisb", "*vspltisb", CODE_FOR_xfA_perm, B_UID(794) };
+static const struct builtin B_vec_splat_u16 = { { &T_immed_s5, NULL, NULL, }, "A", &T_vec_u16, 1, FALSE, FALSE, 5, "vec_splat_u16", "*vspltish", CODE_FOR_xfA_perm, B_UID(795) };
+static const struct builtin B_vec_splat_u32 = { { &T_immed_s5, NULL, NULL, }, "A", &T_vec_u32, 1, FALSE, FALSE, 6, "vec_splat_u32", "*vspltisw", CODE_FOR_xfA_perm, B_UID(796) };
+static const struct builtin B_vec_splat_u8 = { { &T_immed_s5, NULL, NULL, }, "A", &T_vec_u8, 1, FALSE, FALSE, 4, "vec_splat_u8", "*vspltisb", CODE_FOR_xfA_perm, B_UID(797) };
+static const struct builtin B1_vec_vsrh = { { &T_vec_s16, &T_vec_u16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsrh:1", "*vsrh", CODE_FOR_xfxx_simple, B_UID(798) };
+static const struct builtin B1_vec_vsrw = { { &T_vec_s32, &T_vec_u32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsrw:1", "*vsrw", CODE_FOR_xfxx_simple, B_UID(799) };
+static const struct builtin B1_vec_vsrb = { { &T_vec_s8, &T_vec_u8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsrb:1", "*vsrb", CODE_FOR_xfxx_simple, B_UID(800) };
+static const struct builtin B2_vec_vsrh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsrh:2", "*vsrh", CODE_FOR_xfxx_simple, B_UID(801) };
+static const struct builtin B2_vec_vsrw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsrw:2", "*vsrw", CODE_FOR_xfxx_simple, B_UID(802) };
+static const struct builtin B2_vec_vsrb = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsrb:2", "*vsrb", CODE_FOR_xfxx_simple, B_UID(803) };
+static const struct builtin B1_vec_vsrah = { { &T_vec_s16, &T_vec_u16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsrah:1", "*vsrah", CODE_FOR_xfxx_simple, B_UID(804) };
+static const struct builtin B1_vec_vsraw = { { &T_vec_s32, &T_vec_u32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsraw:1", "*vsraw", CODE_FOR_xfxx_simple, B_UID(805) };
+static const struct builtin B1_vec_vsrab = { { &T_vec_s8, &T_vec_u8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsrab:1", "*vsrab", CODE_FOR_xfxx_simple, B_UID(806) };
+static const struct builtin B2_vec_vsrah = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsrah:2", "*vsrah", CODE_FOR_xfxx_simple, B_UID(807) };
+static const struct builtin B2_vec_vsraw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsraw:2", "*vsraw", CODE_FOR_xfxx_simple, B_UID(808) };
+static const struct builtin B2_vec_vsrab = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsrab:2", "*vsrab", CODE_FOR_xfxx_simple, B_UID(809) };
+static const struct builtin B1_vec_vsr = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vsr:1", "*vsr", CODE_FOR_xfxx_simple, B_UID(810) };
+static const struct builtin B2_vec_vsr = { { &T_vec_b16, &T_vec_u32, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vsr:2", "*vsr", CODE_FOR_xfxx_simple, B_UID(811) };
+static const struct builtin B3_vec_vsr = { { &T_vec_b16, &T_vec_u8, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 0, "vec_vsr:3", "*vsr", CODE_FOR_xfxx_simple, B_UID(812) };
+static const struct builtin B4_vec_vsr = { { &T_vec_b32, &T_vec_u16, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vsr:4", "*vsr", CODE_FOR_xfxx_simple, B_UID(813) };
+static const struct builtin B5_vec_vsr = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vsr:5", "*vsr", CODE_FOR_xfxx_simple, B_UID(814) };
+static const struct builtin B6_vec_vsr = { { &T_vec_b32, &T_vec_u8, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 0, "vec_vsr:6", "*vsr", CODE_FOR_xfxx_simple, B_UID(815) };
+static const struct builtin B7_vec_vsr = { { &T_vec_b8, &T_vec_u16, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vsr:7", "*vsr", CODE_FOR_xfxx_simple, B_UID(816) };
+static const struct builtin B8_vec_vsr = { { &T_vec_b8, &T_vec_u32, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vsr:8", "*vsr", CODE_FOR_xfxx_simple, B_UID(817) };
+static const struct builtin B9_vec_vsr = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 0, "vec_vsr:9", "*vsr", CODE_FOR_xfxx_simple, B_UID(818) };
+static const struct builtin B10_vec_vsr = { { &T_vec_p16, &T_vec_u16, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsr:10", "*vsr", CODE_FOR_xfxx_simple, B_UID(819) };
+static const struct builtin B11_vec_vsr = { { &T_vec_p16, &T_vec_u32, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsr:11", "*vsr", CODE_FOR_xfxx_simple, B_UID(820) };
+static const struct builtin B12_vec_vsr = { { &T_vec_p16, &T_vec_u8, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsr:12", "*vsr", CODE_FOR_xfxx_simple, B_UID(821) };
+static const struct builtin B13_vec_vsr = { { &T_vec_s16, &T_vec_u16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsr:13", "*vsr", CODE_FOR_xfxx_simple, B_UID(822) };
+static const struct builtin B14_vec_vsr = { { &T_vec_s16, &T_vec_u32, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsr:14", "*vsr", CODE_FOR_xfxx_simple, B_UID(823) };
+static const struct builtin B15_vec_vsr = { { &T_vec_s16, &T_vec_u8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsr:15", "*vsr", CODE_FOR_xfxx_simple, B_UID(824) };
+static const struct builtin B16_vec_vsr = { { &T_vec_s32, &T_vec_u16, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsr:16", "*vsr", CODE_FOR_xfxx_simple, B_UID(825) };
+static const struct builtin B17_vec_vsr = { { &T_vec_s32, &T_vec_u32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsr:17", "*vsr", CODE_FOR_xfxx_simple, B_UID(826) };
+static const struct builtin B18_vec_vsr = { { &T_vec_s32, &T_vec_u8, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsr:18", "*vsr", CODE_FOR_xfxx_simple, B_UID(827) };
+static const struct builtin B19_vec_vsr = { { &T_vec_s8, &T_vec_u16, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsr:19", "*vsr", CODE_FOR_xfxx_simple, B_UID(828) };
+static const struct builtin B20_vec_vsr = { { &T_vec_s8, &T_vec_u32, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsr:20", "*vsr", CODE_FOR_xfxx_simple, B_UID(829) };
+static const struct builtin B21_vec_vsr = { { &T_vec_s8, &T_vec_u8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsr:21", "*vsr", CODE_FOR_xfxx_simple, B_UID(830) };
+static const struct builtin B22_vec_vsr = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsr:22", "*vsr", CODE_FOR_xfxx_simple, B_UID(831) };
+static const struct builtin B23_vec_vsr = { { &T_vec_u16, &T_vec_u32, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsr:23", "*vsr", CODE_FOR_xfxx_simple, B_UID(832) };
+static const struct builtin B24_vec_vsr = { { &T_vec_u16, &T_vec_u8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsr:24", "*vsr", CODE_FOR_xfxx_simple, B_UID(833) };
+static const struct builtin B25_vec_vsr = { { &T_vec_u32, &T_vec_u16, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsr:25", "*vsr", CODE_FOR_xfxx_simple, B_UID(834) };
+static const struct builtin B26_vec_vsr = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsr:26", "*vsr", CODE_FOR_xfxx_simple, B_UID(835) };
+static const struct builtin B27_vec_vsr = { { &T_vec_u32, &T_vec_u8, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsr:27", "*vsr", CODE_FOR_xfxx_simple, B_UID(836) };
+static const struct builtin B28_vec_vsr = { { &T_vec_u8, &T_vec_u16, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsr:28", "*vsr", CODE_FOR_xfxx_simple, B_UID(837) };
+static const struct builtin B29_vec_vsr = { { &T_vec_u8, &T_vec_u32, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsr:29", "*vsr", CODE_FOR_xfxx_simple, B_UID(838) };
+static const struct builtin B30_vec_vsr = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsr:30", "*vsr", CODE_FOR_xfxx_simple, B_UID(839) };
+static const struct builtin B1_vec_vsro = { { &T_vec_f32, &T_vec_s8, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vsro:1", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(840) };
+static const struct builtin B2_vec_vsro = { { &T_vec_f32, &T_vec_u8, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 0, "vec_vsro:2", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(841) };
+static const struct builtin B3_vec_vsro = { { &T_vec_p16, &T_vec_s8, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsro:3", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(842) };
+static const struct builtin B4_vec_vsro = { { &T_vec_p16, &T_vec_u8, NULL, }, "xx", &T_vec_p16, 2, FALSE, FALSE, 0, "vec_vsro:4", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(843) };
+static const struct builtin B5_vec_vsro = { { &T_vec_s16, &T_vec_s8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsro:5", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(844) };
+static const struct builtin B6_vec_vsro = { { &T_vec_s16, &T_vec_u8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_vsro:6", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(845) };
+static const struct builtin B7_vec_vsro = { { &T_vec_s32, &T_vec_s8, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsro:7", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(846) };
+static const struct builtin B8_vec_vsro = { { &T_vec_s32, &T_vec_u8, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsro:8", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(847) };
+static const struct builtin B9_vec_vsro = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsro:9", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(848) };
+static const struct builtin B10_vec_vsro = { { &T_vec_s8, &T_vec_u8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 0, "vec_vsro:10", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(849) };
+static const struct builtin B11_vec_vsro = { { &T_vec_u16, &T_vec_s8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsro:11", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(850) };
+static const struct builtin B12_vec_vsro = { { &T_vec_u16, &T_vec_u8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_vsro:12", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(851) };
+static const struct builtin B13_vec_vsro = { { &T_vec_u32, &T_vec_s8, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsro:13", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(852) };
+static const struct builtin B14_vec_vsro = { { &T_vec_u32, &T_vec_u8, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsro:14", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(853) };
+static const struct builtin B15_vec_vsro = { { &T_vec_u8, &T_vec_s8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsro:15", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(854) };
+static const struct builtin B16_vec_vsro = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 0, "vec_vsro:16", "*vsro", CODE_FOR_xfxx_perm_bug, B_UID(855) };
+static const struct builtin B1_vec_stvx = { { &T_vec_b16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:1", "*stvx", CODE_FOR_sfxii_store, B_UID(856) };
+static const struct builtin B2_vec_stvx = { { &T_vec_b16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:2", "*stvx", CODE_FOR_sfxii_store, B_UID(857) };
+static const struct builtin B3_vec_stvx = { { &T_vec_b16, &T_int, &T_vec_b16_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:3", "*stvx", CODE_FOR_sfxii_store, B_UID(858) };
+static const struct builtin B4_vec_stvx = { { &T_vec_b32, &T_int, &T_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:4", "*stvx", CODE_FOR_sfxii_store, B_UID(859) };
+static const struct builtin B5_vec_stvx = { { &T_vec_b32, &T_int, &T_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:5", "*stvx", CODE_FOR_sfxii_store, B_UID(860) };
+static const struct builtin B6_vec_stvx = { { &T_vec_b32, &T_int, &T_unsigned_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:6", "*stvx", CODE_FOR_sfxii_store, B_UID(861) };
+static const struct builtin B7_vec_stvx = { { &T_vec_b32, &T_int, &T_unsigned_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:7", "*stvx", CODE_FOR_sfxii_store, B_UID(862) };
+static const struct builtin B8_vec_stvx = { { &T_vec_b32, &T_int, &T_vec_b32_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:8", "*stvx", CODE_FOR_sfxii_store, B_UID(863) };
+static const struct builtin B9_vec_stvx = { { &T_vec_b8, &T_int, &T_signed_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:9", "*stvx", CODE_FOR_sfxii_store, B_UID(864) };
+static const struct builtin B10_vec_stvx = { { &T_vec_b8, &T_int, &T_unsigned_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:10", "*stvx", CODE_FOR_sfxii_store, B_UID(865) };
+static const struct builtin B11_vec_stvx = { { &T_vec_b8, &T_int, &T_vec_b8_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:11", "*stvx", CODE_FOR_sfxii_store, B_UID(866) };
+static const struct builtin B12_vec_stvx = { { &T_vec_f32, &T_int, &T_float_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:12", "*stvx", CODE_FOR_sfxii_store, B_UID(867) };
+static const struct builtin B13_vec_stvx = { { &T_vec_f32, &T_int, &T_vec_f32_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:13", "*stvx", CODE_FOR_sfxii_store, B_UID(868) };
+static const struct builtin B14_vec_stvx = { { &T_vec_p16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:14", "*stvx", CODE_FOR_sfxii_store, B_UID(869) };
+static const struct builtin B15_vec_stvx = { { &T_vec_p16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:15", "*stvx", CODE_FOR_sfxii_store, B_UID(870) };
+static const struct builtin B16_vec_stvx = { { &T_vec_p16, &T_int, &T_vec_p16_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:16", "*stvx", CODE_FOR_sfxii_store, B_UID(871) };
+static const struct builtin B17_vec_stvx = { { &T_vec_s16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:17", "*stvx", CODE_FOR_sfxii_store, B_UID(872) };
+static const struct builtin B18_vec_stvx = { { &T_vec_s16, &T_int, &T_vec_s16_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:18", "*stvx", CODE_FOR_sfxii_store, B_UID(873) };
+static const struct builtin B19_vec_stvx = { { &T_vec_s32, &T_int, &T_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:19", "*stvx", CODE_FOR_sfxii_store, B_UID(874) };
+static const struct builtin B20_vec_stvx = { { &T_vec_s32, &T_int, &T_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:20", "*stvx", CODE_FOR_sfxii_store, B_UID(875) };
+static const struct builtin B21_vec_stvx = { { &T_vec_s32, &T_int, &T_vec_s32_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:21", "*stvx", CODE_FOR_sfxii_store, B_UID(876) };
+static const struct builtin B22_vec_stvx = { { &T_vec_s8, &T_int, &T_signed_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:22", "*stvx", CODE_FOR_sfxii_store, B_UID(877) };
+static const struct builtin B23_vec_stvx = { { &T_vec_s8, &T_int, &T_vec_s8_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:23", "*stvx", CODE_FOR_sfxii_store, B_UID(878) };
+static const struct builtin B24_vec_stvx = { { &T_vec_u16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:24", "*stvx", CODE_FOR_sfxii_store, B_UID(879) };
+static const struct builtin B25_vec_stvx = { { &T_vec_u16, &T_int, &T_vec_u16_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:25", "*stvx", CODE_FOR_sfxii_store, B_UID(880) };
+static const struct builtin B26_vec_stvx = { { &T_vec_u32, &T_int, &T_unsigned_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:26", "*stvx", CODE_FOR_sfxii_store, B_UID(881) };
+static const struct builtin B27_vec_stvx = { { &T_vec_u32, &T_int, &T_unsigned_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:27", "*stvx", CODE_FOR_sfxii_store, B_UID(882) };
+static const struct builtin B28_vec_stvx = { { &T_vec_u32, &T_int, &T_vec_u32_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:28", "*stvx", CODE_FOR_sfxii_store, B_UID(883) };
+static const struct builtin B29_vec_stvx = { { &T_vec_u8, &T_int, &T_unsigned_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:29", "*stvx", CODE_FOR_sfxii_store, B_UID(884) };
+static const struct builtin B30_vec_stvx = { { &T_vec_u8, &T_int, &T_vec_u8_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvx:30", "*stvx", CODE_FOR_sfxii_store, B_UID(885) };
+static const struct builtin B1_vec_stvebx = { { &T_vec_b16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvebx:1", "*stvebx", CODE_FOR_sfxii_store, B_UID(886) };
+static const struct builtin B2_vec_stvebx = { { &T_vec_b16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvebx:2", "*stvebx", CODE_FOR_sfxii_store, B_UID(887) };
+static const struct builtin B1_vec_stvewx = { { &T_vec_b32, &T_int, &T_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:1", "*stvewx", CODE_FOR_sfxii_store, B_UID(888) };
+static const struct builtin B2_vec_stvewx = { { &T_vec_b32, &T_int, &T_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:2", "*stvewx", CODE_FOR_sfxii_store, B_UID(889) };
+static const struct builtin B3_vec_stvewx = { { &T_vec_b32, &T_int, &T_unsigned_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:3", "*stvewx", CODE_FOR_sfxii_store, B_UID(890) };
+static const struct builtin B4_vec_stvewx = { { &T_vec_b32, &T_int, &T_unsigned_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:4", "*stvewx", CODE_FOR_sfxii_store, B_UID(891) };
+static const struct builtin B3_vec_stvebx = { { &T_vec_b8, &T_int, &T_signed_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvebx:3", "*stvebx", CODE_FOR_sfxii_store, B_UID(892) };
+static const struct builtin B4_vec_stvebx = { { &T_vec_b8, &T_int, &T_unsigned_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvebx:4", "*stvebx", CODE_FOR_sfxii_store, B_UID(893) };
+static const struct builtin B5_vec_stvewx = { { &T_vec_f32, &T_int, &T_float_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:5", "*stvewx", CODE_FOR_sfxii_store, B_UID(894) };
+static const struct builtin B1_vec_stvehx = { { &T_vec_p16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvehx:1", "*stvehx", CODE_FOR_sfxii_store, B_UID(895) };
+static const struct builtin B2_vec_stvehx = { { &T_vec_p16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvehx:2", "*stvehx", CODE_FOR_sfxii_store, B_UID(896) };
+static const struct builtin B3_vec_stvehx = { { &T_vec_s16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvehx:3", "*stvehx", CODE_FOR_sfxii_store, B_UID(897) };
+static const struct builtin B6_vec_stvewx = { { &T_vec_s32, &T_int, &T_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:6", "*stvewx", CODE_FOR_sfxii_store, B_UID(898) };
+static const struct builtin B7_vec_stvewx = { { &T_vec_s32, &T_int, &T_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:7", "*stvewx", CODE_FOR_sfxii_store, B_UID(899) };
+static const struct builtin B5_vec_stvebx = { { &T_vec_s8, &T_int, &T_signed_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvebx:5", "*stvebx", CODE_FOR_sfxii_store, B_UID(900) };
+static const struct builtin B4_vec_stvehx = { { &T_vec_u16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvehx:4", "*stvehx", CODE_FOR_sfxii_store, B_UID(901) };
+static const struct builtin B8_vec_stvewx = { { &T_vec_u32, &T_int, &T_unsigned_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:8", "*stvewx", CODE_FOR_sfxii_store, B_UID(902) };
+static const struct builtin B9_vec_stvewx = { { &T_vec_u32, &T_int, &T_unsigned_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvewx:9", "*stvewx", CODE_FOR_sfxii_store, B_UID(903) };
+static const struct builtin B6_vec_stvebx = { { &T_vec_u8, &T_int, &T_unsigned_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvebx:6", "*stvebx", CODE_FOR_sfxii_store, B_UID(904) };
+static const struct builtin B1_vec_stvxl = { { &T_vec_b16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:1", "*stvxl", CODE_FOR_sfxii_store, B_UID(905) };
+static const struct builtin B2_vec_stvxl = { { &T_vec_b16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:2", "*stvxl", CODE_FOR_sfxii_store, B_UID(906) };
+static const struct builtin B3_vec_stvxl = { { &T_vec_b16, &T_int, &T_vec_b16_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:3", "*stvxl", CODE_FOR_sfxii_store, B_UID(907) };
+static const struct builtin B4_vec_stvxl = { { &T_vec_b32, &T_int, &T_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:4", "*stvxl", CODE_FOR_sfxii_store, B_UID(908) };
+static const struct builtin B5_vec_stvxl = { { &T_vec_b32, &T_int, &T_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:5", "*stvxl", CODE_FOR_sfxii_store, B_UID(909) };
+static const struct builtin B6_vec_stvxl = { { &T_vec_b32, &T_int, &T_unsigned_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:6", "*stvxl", CODE_FOR_sfxii_store, B_UID(910) };
+static const struct builtin B7_vec_stvxl = { { &T_vec_b32, &T_int, &T_unsigned_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:7", "*stvxl", CODE_FOR_sfxii_store, B_UID(911) };
+static const struct builtin B8_vec_stvxl = { { &T_vec_b32, &T_int, &T_vec_b32_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:8", "*stvxl", CODE_FOR_sfxii_store, B_UID(912) };
+static const struct builtin B9_vec_stvxl = { { &T_vec_b8, &T_int, &T_signed_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:9", "*stvxl", CODE_FOR_sfxii_store, B_UID(913) };
+static const struct builtin B10_vec_stvxl = { { &T_vec_b8, &T_int, &T_unsigned_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:10", "*stvxl", CODE_FOR_sfxii_store, B_UID(914) };
+static const struct builtin B11_vec_stvxl = { { &T_vec_b8, &T_int, &T_vec_b8_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:11", "*stvxl", CODE_FOR_sfxii_store, B_UID(915) };
+static const struct builtin B12_vec_stvxl = { { &T_vec_f32, &T_int, &T_float_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:12", "*stvxl", CODE_FOR_sfxii_store, B_UID(916) };
+static const struct builtin B13_vec_stvxl = { { &T_vec_f32, &T_int, &T_vec_f32_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:13", "*stvxl", CODE_FOR_sfxii_store, B_UID(917) };
+static const struct builtin B14_vec_stvxl = { { &T_vec_p16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:14", "*stvxl", CODE_FOR_sfxii_store, B_UID(918) };
+static const struct builtin B15_vec_stvxl = { { &T_vec_p16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:15", "*stvxl", CODE_FOR_sfxii_store, B_UID(919) };
+static const struct builtin B16_vec_stvxl = { { &T_vec_p16, &T_int, &T_vec_p16_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:16", "*stvxl", CODE_FOR_sfxii_store, B_UID(920) };
+static const struct builtin B17_vec_stvxl = { { &T_vec_s16, &T_int, &T_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:17", "*stvxl", CODE_FOR_sfxii_store, B_UID(921) };
+static const struct builtin B18_vec_stvxl = { { &T_vec_s16, &T_int, &T_vec_s16_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:18", "*stvxl", CODE_FOR_sfxii_store, B_UID(922) };
+static const struct builtin B19_vec_stvxl = { { &T_vec_s32, &T_int, &T_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:19", "*stvxl", CODE_FOR_sfxii_store, B_UID(923) };
+static const struct builtin B20_vec_stvxl = { { &T_vec_s32, &T_int, &T_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:20", "*stvxl", CODE_FOR_sfxii_store, B_UID(924) };
+static const struct builtin B21_vec_stvxl = { { &T_vec_s32, &T_int, &T_vec_s32_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:21", "*stvxl", CODE_FOR_sfxii_store, B_UID(925) };
+static const struct builtin B22_vec_stvxl = { { &T_vec_s8, &T_int, &T_signed_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:22", "*stvxl", CODE_FOR_sfxii_store, B_UID(926) };
+static const struct builtin B23_vec_stvxl = { { &T_vec_s8, &T_int, &T_vec_s8_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:23", "*stvxl", CODE_FOR_sfxii_store, B_UID(927) };
+static const struct builtin B24_vec_stvxl = { { &T_vec_u16, &T_int, &T_unsigned_short_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:24", "*stvxl", CODE_FOR_sfxii_store, B_UID(928) };
+static const struct builtin B25_vec_stvxl = { { &T_vec_u16, &T_int, &T_vec_u16_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:25", "*stvxl", CODE_FOR_sfxii_store, B_UID(929) };
+static const struct builtin B26_vec_stvxl = { { &T_vec_u32, &T_int, &T_unsigned_int_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:26", "*stvxl", CODE_FOR_sfxii_store, B_UID(930) };
+static const struct builtin B27_vec_stvxl = { { &T_vec_u32, &T_int, &T_unsigned_long_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:27", "*stvxl", CODE_FOR_sfxii_store, B_UID(931) };
+static const struct builtin B28_vec_stvxl = { { &T_vec_u32, &T_int, &T_vec_u32_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:28", "*stvxl", CODE_FOR_sfxii_store, B_UID(932) };
+static const struct builtin B29_vec_stvxl = { { &T_vec_u8, &T_int, &T_unsigned_char_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:29", "*stvxl", CODE_FOR_sfxii_store, B_UID(933) };
+static const struct builtin B30_vec_stvxl = { { &T_vec_u8, &T_int, &T_vec_u8_ptr, }, "xii", &T_void, 3, FALSE, FALSE, 0, "vec_stvxl:30", "*stvxl", CODE_FOR_sfxii_store, B_UID(934) };
+static const struct builtin B1_vec_vsubuhm = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vsubuhm:1", "*vsubuhm", CODE_FOR_xfxx_simple, B_UID(935) };
+static const struct builtin B2_vec_vsubuhm = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vsubuhm:2", "*vsubuhm", CODE_FOR_xfxx_simple, B_UID(936) };
+static const struct builtin B1_vec_vsubuwm = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vsubuwm:1", "*vsubuwm", CODE_FOR_xfxx_simple, B_UID(937) };
+static const struct builtin B2_vec_vsubuwm = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vsubuwm:2", "*vsubuwm", CODE_FOR_xfxx_simple, B_UID(938) };
+static const struct builtin B1_vec_vsububm = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vsububm:1", "*vsububm", CODE_FOR_xfxx_simple, B_UID(939) };
+static const struct builtin B2_vec_vsububm = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vsububm:2", "*vsububm", CODE_FOR_xfxx_simple, B_UID(940) };
+static const struct builtin B_vec_vsubfp = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 1, "vec_vsubfp", "*vsubfp", CODE_FOR_xfxx_fp, B_UID(941) };
+static const struct builtin B3_vec_vsubuhm = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vsubuhm:3", "*vsubuhm", CODE_FOR_xfxx_simple, B_UID(942) };
+static const struct builtin B4_vec_vsubuhm = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vsubuhm:4", "*vsubuhm", CODE_FOR_xfxx_simple, B_UID(943) };
+static const struct builtin B3_vec_vsubuwm = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vsubuwm:3", "*vsubuwm", CODE_FOR_xfxx_simple, B_UID(944) };
+static const struct builtin B4_vec_vsubuwm = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vsubuwm:4", "*vsubuwm", CODE_FOR_xfxx_simple, B_UID(945) };
+static const struct builtin B3_vec_vsububm = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vsububm:3", "*vsububm", CODE_FOR_xfxx_simple, B_UID(946) };
+static const struct builtin B4_vec_vsububm = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vsububm:4", "*vsububm", CODE_FOR_xfxx_simple, B_UID(947) };
+static const struct builtin B5_vec_vsubuhm = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vsubuhm:5", "*vsubuhm", CODE_FOR_xfxx_simple, B_UID(948) };
+static const struct builtin B6_vec_vsubuhm = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vsubuhm:6", "*vsubuhm", CODE_FOR_xfxx_simple, B_UID(949) };
+static const struct builtin B5_vec_vsubuwm = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vsubuwm:5", "*vsubuwm", CODE_FOR_xfxx_simple, B_UID(950) };
+static const struct builtin B6_vec_vsubuwm = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vsubuwm:6", "*vsubuwm", CODE_FOR_xfxx_simple, B_UID(951) };
+static const struct builtin B5_vec_vsububm = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vsububm:5", "*vsububm", CODE_FOR_xfxx_simple, B_UID(952) };
+static const struct builtin B6_vec_vsububm = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vsububm:6", "*vsububm", CODE_FOR_xfxx_simple, B_UID(953) };
+static const struct builtin B_vec_vsubcuw = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsubcuw", "*vsubcuw", CODE_FOR_xfxx_simple, B_UID(954) };
+static const struct builtin B1_vec_vsubshs = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vsubshs:1", "*vsubshs", CODE_FOR_xfxx_simple, B_UID(955) };
+static const struct builtin B1_vec_vsubuhs = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vsubuhs:1", "*vsubuhs", CODE_FOR_xfxx_simple, B_UID(956) };
+static const struct builtin B1_vec_vsubsws = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vsubsws:1", "*vsubsws", CODE_FOR_xfxx_simple, B_UID(957) };
+static const struct builtin B1_vec_vsubuws = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vsubuws:1", "*vsubuws", CODE_FOR_xfxx_simple, B_UID(958) };
+static const struct builtin B1_vec_vsubsbs = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vsubsbs:1", "*vsubsbs", CODE_FOR_xfxx_simple, B_UID(959) };
+static const struct builtin B1_vec_vsububs = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vsububs:1", "*vsububs", CODE_FOR_xfxx_simple, B_UID(960) };
+static const struct builtin B2_vec_vsubshs = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vsubshs:2", "*vsubshs", CODE_FOR_xfxx_simple, B_UID(961) };
+static const struct builtin B3_vec_vsubshs = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vsubshs:3", "*vsubshs", CODE_FOR_xfxx_simple, B_UID(962) };
+static const struct builtin B2_vec_vsubsws = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vsubsws:2", "*vsubsws", CODE_FOR_xfxx_simple, B_UID(963) };
+static const struct builtin B3_vec_vsubsws = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vsubsws:3", "*vsubsws", CODE_FOR_xfxx_simple, B_UID(964) };
+static const struct builtin B2_vec_vsubsbs = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vsubsbs:2", "*vsubsbs", CODE_FOR_xfxx_simple, B_UID(965) };
+static const struct builtin B3_vec_vsubsbs = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vsubsbs:3", "*vsubsbs", CODE_FOR_xfxx_simple, B_UID(966) };
+static const struct builtin B2_vec_vsubuhs = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vsubuhs:2", "*vsubuhs", CODE_FOR_xfxx_simple, B_UID(967) };
+static const struct builtin B3_vec_vsubuhs = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vsubuhs:3", "*vsubuhs", CODE_FOR_xfxx_simple, B_UID(968) };
+static const struct builtin B2_vec_vsubuws = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vsubuws:2", "*vsubuws", CODE_FOR_xfxx_simple, B_UID(969) };
+static const struct builtin B3_vec_vsubuws = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vsubuws:3", "*vsubuws", CODE_FOR_xfxx_simple, B_UID(970) };
+static const struct builtin B2_vec_vsububs = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vsububs:2", "*vsububs", CODE_FOR_xfxx_simple, B_UID(971) };
+static const struct builtin B3_vec_vsububs = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vsububs:3", "*vsububs", CODE_FOR_xfxx_simple, B_UID(972) };
+static const struct builtin B_vec_vsum2sws = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsum2sws", "*vsum2sws", CODE_FOR_xfxx_complex, B_UID(973) };
+static const struct builtin B_vec_vsum4shs = { { &T_vec_s16, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsum4shs", "*vsum4shs", CODE_FOR_xfxx_complex, B_UID(974) };
+static const struct builtin B_vec_vsum4sbs = { { &T_vec_s8, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsum4sbs", "*vsum4sbs", CODE_FOR_xfxx_complex, B_UID(975) };
+static const struct builtin B_vec_vsum4ubs = { { &T_vec_u8, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_vsum4ubs", "*vsum4ubs", CODE_FOR_xfxx_complex, B_UID(976) };
+static const struct builtin B_vec_vsumsws = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_vsumsws", "*vsumsws", CODE_FOR_xfxx_complex, B_UID(977) };
+static const struct builtin B_vec_vrfiz = { { &T_vec_f32, NULL, NULL, }, "x", &T_vec_f32, 1, FALSE, FALSE, 0, "vec_vrfiz", "*vrfiz", CODE_FOR_xfx_fp, B_UID(978) };
+static const struct builtin B1_vec_unpack2sh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_unpack2sh:1", "*vmrghh", CODE_FOR_xfxx_perm, B_UID(979) };
+static const struct builtin B2_vec_unpack2sh = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_unpack2sh:2", "*vmrghb", CODE_FOR_xfxx_perm, B_UID(980) };
+static const struct builtin B1_vec_unpack2sl = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 0, "vec_unpack2sl:1", "*vmrglh", CODE_FOR_xfxx_perm, B_UID(981) };
+static const struct builtin B2_vec_unpack2sl = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 0, "vec_unpack2sl:2", "*vmrglb", CODE_FOR_xfxx_perm, B_UID(982) };
+static const struct builtin B1_vec_unpack2uh = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_unpack2uh:1", "*vmrghh", CODE_FOR_xfxx_perm, B_UID(983) };
+static const struct builtin B2_vec_unpack2uh = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_unpack2uh:2", "*vmrghb", CODE_FOR_xfxx_perm, B_UID(984) };
+static const struct builtin B1_vec_unpack2ul = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 0, "vec_unpack2ul:1", "*vmrglh", CODE_FOR_xfxx_perm, B_UID(985) };
+static const struct builtin B2_vec_unpack2ul = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 0, "vec_unpack2ul:2", "*vmrglb", CODE_FOR_xfxx_perm, B_UID(986) };
+static const struct builtin B1_vec_vupkhsh = { { &T_vec_b16, NULL, NULL, }, "x", &T_vec_b32, 1, FALSE, FALSE, 0, "vec_vupkhsh:1", "*vupkhsh", CODE_FOR_xfx_perm, B_UID(987) };
+static const struct builtin B1_vec_vupkhsb = { { &T_vec_b8, NULL, NULL, }, "x", &T_vec_b16, 1, FALSE, FALSE, 0, "vec_vupkhsb:1", "*vupkhsb", CODE_FOR_xfx_perm, B_UID(988) };
+static const struct builtin B_vec_vupkhpx = { { &T_vec_p16, NULL, NULL, }, "x", &T_vec_u32, 1, FALSE, FALSE, 0, "vec_vupkhpx", "*vupkhpx", CODE_FOR_xfx_perm, B_UID(989) };
+static const struct builtin B2_vec_vupkhsh = { { &T_vec_s16, NULL, NULL, }, "x", &T_vec_s32, 1, FALSE, FALSE, 0, "vec_vupkhsh:2", "*vupkhsh", CODE_FOR_xfx_perm, B_UID(990) };
+static const struct builtin B2_vec_vupkhsb = { { &T_vec_s8, NULL, NULL, }, "x", &T_vec_s16, 1, FALSE, FALSE, 0, "vec_vupkhsb:2", "*vupkhsb", CODE_FOR_xfx_perm, B_UID(991) };
+static const struct builtin B1_vec_vupklsh = { { &T_vec_b16, NULL, NULL, }, "x", &T_vec_b32, 1, FALSE, FALSE, 0, "vec_vupklsh:1", "*vupklsh", CODE_FOR_xfx_perm, B_UID(992) };
+static const struct builtin B1_vec_vupklsb = { { &T_vec_b8, NULL, NULL, }, "x", &T_vec_b16, 1, FALSE, FALSE, 0, "vec_vupklsb:1", "*vupklsb", CODE_FOR_xfx_perm, B_UID(993) };
+static const struct builtin B_vec_vupklpx = { { &T_vec_p16, NULL, NULL, }, "x", &T_vec_u32, 1, FALSE, FALSE, 0, "vec_vupklpx", "*vupklpx", CODE_FOR_xfx_perm, B_UID(994) };
+static const struct builtin B2_vec_vupklsh = { { &T_vec_s16, NULL, NULL, }, "x", &T_vec_s32, 1, FALSE, FALSE, 0, "vec_vupklsh:2", "*vupklsh", CODE_FOR_xfx_perm, B_UID(995) };
+static const struct builtin B2_vec_vupklsb = { { &T_vec_s8, NULL, NULL, }, "x", &T_vec_s16, 1, FALSE, FALSE, 0, "vec_vupklsb:2", "*vupklsb", CODE_FOR_xfx_perm, B_UID(996) };
+static const struct builtin B1_vec_vxor = { { &T_vec_b16, &T_vec_b16, NULL, }, "xx", &T_vec_b16, 2, FALSE, FALSE, 1, "vec_vxor:1", "*vxor", CODE_FOR_xfxx_simple, B_UID(997) };
+static const struct builtin B2_vec_vxor = { { &T_vec_b16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vxor:2", "*vxor", CODE_FOR_xfxx_simple, B_UID(998) };
+static const struct builtin B3_vec_vxor = { { &T_vec_b16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vxor:3", "*vxor", CODE_FOR_xfxx_simple, B_UID(999) };
+static const struct builtin B4_vec_vxor = { { &T_vec_b32, &T_vec_b32, NULL, }, "xx", &T_vec_b32, 2, FALSE, FALSE, 1, "vec_vxor:4", "*vxor", CODE_FOR_xfxx_simple, B_UID(1000) };
+static const struct builtin B5_vec_vxor = { { &T_vec_b32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 1, "vec_vxor:5", "*vxor", CODE_FOR_xfxx_simple, B_UID(1001) };
+static const struct builtin B6_vec_vxor = { { &T_vec_b32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vxor:6", "*vxor", CODE_FOR_xfxx_simple, B_UID(1002) };
+static const struct builtin B7_vec_vxor = { { &T_vec_b32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vxor:7", "*vxor", CODE_FOR_xfxx_simple, B_UID(1003) };
+static const struct builtin B8_vec_vxor = { { &T_vec_b8, &T_vec_b8, NULL, }, "xx", &T_vec_b8, 2, FALSE, FALSE, 1, "vec_vxor:8", "*vxor", CODE_FOR_xfxx_simple, B_UID(1004) };
+static const struct builtin B9_vec_vxor = { { &T_vec_b8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vxor:9", "*vxor", CODE_FOR_xfxx_simple, B_UID(1005) };
+static const struct builtin B10_vec_vxor = { { &T_vec_b8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vxor:10", "*vxor", CODE_FOR_xfxx_simple, B_UID(1006) };
+static const struct builtin B11_vec_vxor = { { &T_vec_f32, &T_vec_b32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 1, "vec_vxor:11", "*vxor", CODE_FOR_xfxx_simple, B_UID(1007) };
+static const struct builtin B12_vec_vxor = { { &T_vec_f32, &T_vec_f32, NULL, }, "xx", &T_vec_f32, 2, FALSE, FALSE, 1, "vec_vxor:12", "*vxor", CODE_FOR_xfxx_simple, B_UID(1008) };
+static const struct builtin B13_vec_vxor = { { &T_vec_s16, &T_vec_b16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vxor:13", "*vxor", CODE_FOR_xfxx_simple, B_UID(1009) };
+static const struct builtin B14_vec_vxor = { { &T_vec_s16, &T_vec_s16, NULL, }, "xx", &T_vec_s16, 2, FALSE, FALSE, 1, "vec_vxor:14", "*vxor", CODE_FOR_xfxx_simple, B_UID(1010) };
+static const struct builtin B15_vec_vxor = { { &T_vec_s32, &T_vec_b32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vxor:15", "*vxor", CODE_FOR_xfxx_simple, B_UID(1011) };
+static const struct builtin B16_vec_vxor = { { &T_vec_s32, &T_vec_s32, NULL, }, "xx", &T_vec_s32, 2, FALSE, FALSE, 1, "vec_vxor:16", "*vxor", CODE_FOR_xfxx_simple, B_UID(1012) };
+static const struct builtin B17_vec_vxor = { { &T_vec_s8, &T_vec_b8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vxor:17", "*vxor", CODE_FOR_xfxx_simple, B_UID(1013) };
+static const struct builtin B18_vec_vxor = { { &T_vec_s8, &T_vec_s8, NULL, }, "xx", &T_vec_s8, 2, FALSE, FALSE, 1, "vec_vxor:18", "*vxor", CODE_FOR_xfxx_simple, B_UID(1014) };
+static const struct builtin B19_vec_vxor = { { &T_vec_u16, &T_vec_b16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vxor:19", "*vxor", CODE_FOR_xfxx_simple, B_UID(1015) };
+static const struct builtin B20_vec_vxor = { { &T_vec_u16, &T_vec_u16, NULL, }, "xx", &T_vec_u16, 2, FALSE, FALSE, 1, "vec_vxor:20", "*vxor", CODE_FOR_xfxx_simple, B_UID(1016) };
+static const struct builtin B21_vec_vxor = { { &T_vec_u32, &T_vec_b32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vxor:21", "*vxor", CODE_FOR_xfxx_simple, B_UID(1017) };
+static const struct builtin B22_vec_vxor = { { &T_vec_u32, &T_vec_u32, NULL, }, "xx", &T_vec_u32, 2, FALSE, FALSE, 1, "vec_vxor:22", "*vxor", CODE_FOR_xfxx_simple, B_UID(1018) };
+static const struct builtin B23_vec_vxor = { { &T_vec_u8, &T_vec_b8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vxor:23", "*vxor", CODE_FOR_xfxx_simple, B_UID(1019) };
+static const struct builtin B24_vec_vxor = { { &T_vec_u8, &T_vec_u8, NULL, }, "xx", &T_vec_u8, 2, FALSE, FALSE, 1, "vec_vxor:24", "*vxor", CODE_FOR_xfxx_simple, B_UID(1020) };
+#define LAST_B_UID B_UID(1021)
+
+const struct builtin * const Builtin[] = {
+ &B1_vec_abs,
+ &B2_vec_abs,
+ &B3_vec_abs,
+ &B4_vec_abs,
+ &B1_vec_abss,
+ &B2_vec_abss,
+ &B3_vec_abss,
+ &B1_vec_vadduhm,
+ &B2_vec_vadduhm,
+ &B1_vec_vadduwm,
+ &B2_vec_vadduwm,
+ &B1_vec_vaddubm,
+ &B2_vec_vaddubm,
+ &B_vec_vaddfp,
+ &B3_vec_vadduhm,
+ &B4_vec_vadduhm,
+ &B3_vec_vadduwm,
+ &B4_vec_vadduwm,
+ &B3_vec_vaddubm,
+ &B4_vec_vaddubm,
+ &B5_vec_vadduhm,
+ &B6_vec_vadduhm,
+ &B5_vec_vadduwm,
+ &B6_vec_vadduwm,
+ &B5_vec_vaddubm,
+ &B6_vec_vaddubm,
+ &B_vec_vaddcuw,
+ &B1_vec_vaddshs,
+ &B1_vec_vadduhs,
+ &B1_vec_vaddsws,
+ &B1_vec_vadduws,
+ &B1_vec_vaddsbs,
+ &B1_vec_vaddubs,
+ &B2_vec_vaddshs,
+ &B3_vec_vaddshs,
+ &B2_vec_vaddsws,
+ &B3_vec_vaddsws,
+ &B2_vec_vaddsbs,
+ &B3_vec_vaddsbs,
+ &B2_vec_vadduhs,
+ &B3_vec_vadduhs,
+ &B2_vec_vadduws,
+ &B3_vec_vadduws,
+ &B2_vec_vaddubs,
+ &B3_vec_vaddubs,
+ &B1_vec_all_eq,
+ &B2_vec_all_eq,
+ &B3_vec_all_eq,
+ &B4_vec_all_eq,
+ &B5_vec_all_eq,
+ &B6_vec_all_eq,
+ &B7_vec_all_eq,
+ &B8_vec_all_eq,
+ &B9_vec_all_eq,
+ &B10_vec_all_eq,
+ &B11_vec_all_eq,
+ &B12_vec_all_eq,
+ &B13_vec_all_eq,
+ &B14_vec_all_eq,
+ &B15_vec_all_eq,
+ &B16_vec_all_eq,
+ &B17_vec_all_eq,
+ &B18_vec_all_eq,
+ &B19_vec_all_eq,
+ &B20_vec_all_eq,
+ &B21_vec_all_eq,
+ &B22_vec_all_eq,
+ &B23_vec_all_eq,
+ &B1_vec_all_ge,
+ &B2_vec_all_ge,
+ &B3_vec_all_ge,
+ &B4_vec_all_ge,
+ &B5_vec_all_ge,
+ &B6_vec_all_ge,
+ &B7_vec_all_ge,
+ &B8_vec_all_ge,
+ &B9_vec_all_ge,
+ &B10_vec_all_ge,
+ &B11_vec_all_ge,
+ &B12_vec_all_ge,
+ &B13_vec_all_ge,
+ &B14_vec_all_ge,
+ &B15_vec_all_ge,
+ &B16_vec_all_ge,
+ &B17_vec_all_ge,
+ &B18_vec_all_ge,
+ &B19_vec_all_ge,
+ &B1_vec_all_gt,
+ &B2_vec_all_gt,
+ &B3_vec_all_gt,
+ &B4_vec_all_gt,
+ &B5_vec_all_gt,
+ &B6_vec_all_gt,
+ &B7_vec_all_gt,
+ &B8_vec_all_gt,
+ &B9_vec_all_gt,
+ &B10_vec_all_gt,
+ &B11_vec_all_gt,
+ &B12_vec_all_gt,
+ &B13_vec_all_gt,
+ &B14_vec_all_gt,
+ &B15_vec_all_gt,
+ &B16_vec_all_gt,
+ &B17_vec_all_gt,
+ &B18_vec_all_gt,
+ &B19_vec_all_gt,
+ &B_vec_all_in,
+ &B1_vec_all_le,
+ &B2_vec_all_le,
+ &B3_vec_all_le,
+ &B4_vec_all_le,
+ &B5_vec_all_le,
+ &B6_vec_all_le,
+ &B7_vec_all_le,
+ &B8_vec_all_le,
+ &B9_vec_all_le,
+ &B10_vec_all_le,
+ &B11_vec_all_le,
+ &B12_vec_all_le,
+ &B13_vec_all_le,
+ &B14_vec_all_le,
+ &B15_vec_all_le,
+ &B16_vec_all_le,
+ &B17_vec_all_le,
+ &B18_vec_all_le,
+ &B19_vec_all_le,
+ &B1_vec_all_lt,
+ &B2_vec_all_lt,
+ &B3_vec_all_lt,
+ &B4_vec_all_lt,
+ &B5_vec_all_lt,
+ &B6_vec_all_lt,
+ &B7_vec_all_lt,
+ &B8_vec_all_lt,
+ &B9_vec_all_lt,
+ &B10_vec_all_lt,
+ &B11_vec_all_lt,
+ &B12_vec_all_lt,
+ &B13_vec_all_lt,
+ &B14_vec_all_lt,
+ &B15_vec_all_lt,
+ &B16_vec_all_lt,
+ &B17_vec_all_lt,
+ &B18_vec_all_lt,
+ &B19_vec_all_lt,
+ &B_vec_all_nan,
+ &B1_vec_all_ne,
+ &B2_vec_all_ne,
+ &B3_vec_all_ne,
+ &B4_vec_all_ne,
+ &B5_vec_all_ne,
+ &B6_vec_all_ne,
+ &B7_vec_all_ne,
+ &B8_vec_all_ne,
+ &B9_vec_all_ne,
+ &B10_vec_all_ne,
+ &B11_vec_all_ne,
+ &B12_vec_all_ne,
+ &B13_vec_all_ne,
+ &B14_vec_all_ne,
+ &B15_vec_all_ne,
+ &B16_vec_all_ne,
+ &B17_vec_all_ne,
+ &B18_vec_all_ne,
+ &B19_vec_all_ne,
+ &B20_vec_all_ne,
+ &B21_vec_all_ne,
+ &B22_vec_all_ne,
+ &B23_vec_all_ne,
+ &B_vec_all_nge,
+ &B_vec_all_ngt,
+ &B_vec_all_nle,
+ &B_vec_all_nlt,
+ &B_vec_all_numeric,
+ &B1_vec_vand,
+ &B2_vec_vand,
+ &B3_vec_vand,
+ &B4_vec_vand,
+ &B5_vec_vand,
+ &B6_vec_vand,
+ &B7_vec_vand,
+ &B8_vec_vand,
+ &B9_vec_vand,
+ &B10_vec_vand,
+ &B11_vec_vand,
+ &B12_vec_vand,
+ &B13_vec_vand,
+ &B14_vec_vand,
+ &B15_vec_vand,
+ &B16_vec_vand,
+ &B17_vec_vand,
+ &B18_vec_vand,
+ &B19_vec_vand,
+ &B20_vec_vand,
+ &B21_vec_vand,
+ &B22_vec_vand,
+ &B23_vec_vand,
+ &B24_vec_vand,
+ &B1_vec_vandc,
+ &B2_vec_vandc,
+ &B3_vec_vandc,
+ &B4_vec_vandc,
+ &B5_vec_vandc,
+ &B6_vec_vandc,
+ &B7_vec_vandc,
+ &B8_vec_vandc,
+ &B9_vec_vandc,
+ &B10_vec_vandc,
+ &B11_vec_vandc,
+ &B12_vec_vandc,
+ &B13_vec_vandc,
+ &B14_vec_vandc,
+ &B15_vec_vandc,
+ &B16_vec_vandc,
+ &B17_vec_vandc,
+ &B18_vec_vandc,
+ &B19_vec_vandc,
+ &B20_vec_vandc,
+ &B21_vec_vandc,
+ &B22_vec_vandc,
+ &B23_vec_vandc,
+ &B24_vec_vandc,
+ &B1_vec_any_eq,
+ &B2_vec_any_eq,
+ &B3_vec_any_eq,
+ &B4_vec_any_eq,
+ &B5_vec_any_eq,
+ &B6_vec_any_eq,
+ &B7_vec_any_eq,
+ &B8_vec_any_eq,
+ &B9_vec_any_eq,
+ &B10_vec_any_eq,
+ &B11_vec_any_eq,
+ &B12_vec_any_eq,
+ &B13_vec_any_eq,
+ &B14_vec_any_eq,
+ &B15_vec_any_eq,
+ &B16_vec_any_eq,
+ &B17_vec_any_eq,
+ &B18_vec_any_eq,
+ &B19_vec_any_eq,
+ &B20_vec_any_eq,
+ &B21_vec_any_eq,
+ &B22_vec_any_eq,
+ &B23_vec_any_eq,
+ &B1_vec_any_ge,
+ &B2_vec_any_ge,
+ &B3_vec_any_ge,
+ &B4_vec_any_ge,
+ &B5_vec_any_ge,
+ &B6_vec_any_ge,
+ &B7_vec_any_ge,
+ &B8_vec_any_ge,
+ &B9_vec_any_ge,
+ &B10_vec_any_ge,
+ &B11_vec_any_ge,
+ &B12_vec_any_ge,
+ &B13_vec_any_ge,
+ &B14_vec_any_ge,
+ &B15_vec_any_ge,
+ &B16_vec_any_ge,
+ &B17_vec_any_ge,
+ &B18_vec_any_ge,
+ &B19_vec_any_ge,
+ &B1_vec_any_gt,
+ &B2_vec_any_gt,
+ &B3_vec_any_gt,
+ &B4_vec_any_gt,
+ &B5_vec_any_gt,
+ &B6_vec_any_gt,
+ &B7_vec_any_gt,
+ &B8_vec_any_gt,
+ &B9_vec_any_gt,
+ &B10_vec_any_gt,
+ &B11_vec_any_gt,
+ &B12_vec_any_gt,
+ &B13_vec_any_gt,
+ &B14_vec_any_gt,
+ &B15_vec_any_gt,
+ &B16_vec_any_gt,
+ &B17_vec_any_gt,
+ &B18_vec_any_gt,
+ &B19_vec_any_gt,
+ &B1_vec_any_le,
+ &B2_vec_any_le,
+ &B3_vec_any_le,
+ &B4_vec_any_le,
+ &B5_vec_any_le,
+ &B6_vec_any_le,
+ &B7_vec_any_le,
+ &B8_vec_any_le,
+ &B9_vec_any_le,
+ &B10_vec_any_le,
+ &B11_vec_any_le,
+ &B12_vec_any_le,
+ &B13_vec_any_le,
+ &B14_vec_any_le,
+ &B15_vec_any_le,
+ &B16_vec_any_le,
+ &B17_vec_any_le,
+ &B18_vec_any_le,
+ &B19_vec_any_le,
+ &B1_vec_any_lt,
+ &B2_vec_any_lt,
+ &B3_vec_any_lt,
+ &B4_vec_any_lt,
+ &B5_vec_any_lt,
+ &B6_vec_any_lt,
+ &B7_vec_any_lt,
+ &B8_vec_any_lt,
+ &B9_vec_any_lt,
+ &B10_vec_any_lt,
+ &B11_vec_any_lt,
+ &B12_vec_any_lt,
+ &B13_vec_any_lt,
+ &B14_vec_any_lt,
+ &B15_vec_any_lt,
+ &B16_vec_any_lt,
+ &B17_vec_any_lt,
+ &B18_vec_any_lt,
+ &B19_vec_any_lt,
+ &B_vec_any_nan,
+ &B1_vec_any_ne,
+ &B2_vec_any_ne,
+ &B3_vec_any_ne,
+ &B4_vec_any_ne,
+ &B5_vec_any_ne,
+ &B6_vec_any_ne,
+ &B7_vec_any_ne,
+ &B8_vec_any_ne,
+ &B9_vec_any_ne,
+ &B10_vec_any_ne,
+ &B11_vec_any_ne,
+ &B12_vec_any_ne,
+ &B13_vec_any_ne,
+ &B14_vec_any_ne,
+ &B15_vec_any_ne,
+ &B16_vec_any_ne,
+ &B17_vec_any_ne,
+ &B18_vec_any_ne,
+ &B19_vec_any_ne,
+ &B20_vec_any_ne,
+ &B21_vec_any_ne,
+ &B22_vec_any_ne,
+ &B23_vec_any_ne,
+ &B_vec_any_nge,
+ &B_vec_any_ngt,
+ &B_vec_any_nle,
+ &B_vec_any_nlt,
+ &B_vec_any_numeric,
+ &B_vec_any_out,
+ &B_vec_vavgsh,
+ &B_vec_vavgsw,
+ &B_vec_vavgsb,
+ &B_vec_vavguh,
+ &B_vec_vavguw,
+ &B_vec_vavgub,
+ &B_vec_vrfip,
+ &B_vec_vcmpbfp,
+ &B_vec_vcmpeqfp,
+ &B1_vec_vcmpequh,
+ &B1_vec_vcmpequw,
+ &B1_vec_vcmpequb,
+ &B2_vec_vcmpequh,
+ &B2_vec_vcmpequw,
+ &B2_vec_vcmpequb,
+ &B_vec_vcmpgefp,
+ &B_vec_vcmpgtfp,
+ &B_vec_vcmpgtsh,
+ &B_vec_vcmpgtsw,
+ &B_vec_vcmpgtsb,
+ &B_vec_vcmpgtuh,
+ &B_vec_vcmpgtuw,
+ &B_vec_vcmpgtub,
+ &B_vec_cmple,
+ &B1_vec_cmplt,
+ &B2_vec_cmplt,
+ &B3_vec_cmplt,
+ &B4_vec_cmplt,
+ &B5_vec_cmplt,
+ &B6_vec_cmplt,
+ &B7_vec_cmplt,
+ &B_vec_vcfsx,
+ &B_vec_vcfux,
+ &B_vec_vctsxs,
+ &B_vec_vctuxs,
+ &B_vec_dss,
+ &B_vec_dssall,
+ &B1_vec_dst,
+ &B2_vec_dst,
+ &B3_vec_dst,
+ &B4_vec_dst,
+ &B5_vec_dst,
+ &B6_vec_dst,
+ &B7_vec_dst,
+ &B8_vec_dst,
+ &B9_vec_dst,
+ &B10_vec_dst,
+ &B11_vec_dst,
+ &B12_vec_dst,
+ &B13_vec_dst,
+ &B14_vec_dst,
+ &B15_vec_dst,
+ &B16_vec_dst,
+ &B17_vec_dst,
+ &B18_vec_dst,
+ &B19_vec_dst,
+ &B20_vec_dst,
+ &B1_vec_dstst,
+ &B2_vec_dstst,
+ &B3_vec_dstst,
+ &B4_vec_dstst,
+ &B5_vec_dstst,
+ &B6_vec_dstst,
+ &B7_vec_dstst,
+ &B8_vec_dstst,
+ &B9_vec_dstst,
+ &B10_vec_dstst,
+ &B11_vec_dstst,
+ &B12_vec_dstst,
+ &B13_vec_dstst,
+ &B14_vec_dstst,
+ &B15_vec_dstst,
+ &B16_vec_dstst,
+ &B17_vec_dstst,
+ &B18_vec_dstst,
+ &B19_vec_dstst,
+ &B20_vec_dstst,
+ &B1_vec_dststt,
+ &B2_vec_dststt,
+ &B3_vec_dststt,
+ &B4_vec_dststt,
+ &B5_vec_dststt,
+ &B6_vec_dststt,
+ &B7_vec_dststt,
+ &B8_vec_dststt,
+ &B9_vec_dststt,
+ &B10_vec_dststt,
+ &B11_vec_dststt,
+ &B12_vec_dststt,
+ &B13_vec_dststt,
+ &B14_vec_dststt,
+ &B15_vec_dststt,
+ &B16_vec_dststt,
+ &B17_vec_dststt,
+ &B18_vec_dststt,
+ &B19_vec_dststt,
+ &B20_vec_dststt,
+ &B1_vec_dstt,
+ &B2_vec_dstt,
+ &B3_vec_dstt,
+ &B4_vec_dstt,
+ &B5_vec_dstt,
+ &B6_vec_dstt,
+ &B7_vec_dstt,
+ &B8_vec_dstt,
+ &B9_vec_dstt,
+ &B10_vec_dstt,
+ &B11_vec_dstt,
+ &B12_vec_dstt,
+ &B13_vec_dstt,
+ &B14_vec_dstt,
+ &B15_vec_dstt,
+ &B16_vec_dstt,
+ &B17_vec_dstt,
+ &B18_vec_dstt,
+ &B19_vec_dstt,
+ &B20_vec_dstt,
+ &B_vec_vexptefp,
+ &B_vec_vrfim,
+ &B1_vec_lvx,
+ &B2_vec_lvx,
+ &B3_vec_lvx,
+ &B4_vec_lvx,
+ &B5_vec_lvx,
+ &B6_vec_lvx,
+ &B7_vec_lvx,
+ &B8_vec_lvx,
+ &B9_vec_lvx,
+ &B10_vec_lvx,
+ &B11_vec_lvx,
+ &B12_vec_lvx,
+ &B13_vec_lvx,
+ &B14_vec_lvx,
+ &B15_vec_lvx,
+ &B16_vec_lvx,
+ &B17_vec_lvx,
+ &B18_vec_lvx,
+ &B19_vec_lvx,
+ &B20_vec_lvx,
+ &B1_vec_lvewx,
+ &B2_vec_lvewx,
+ &B3_vec_lvewx,
+ &B1_vec_lvehx,
+ &B1_vec_lvebx,
+ &B2_vec_lvebx,
+ &B4_vec_lvewx,
+ &B5_vec_lvewx,
+ &B2_vec_lvehx,
+ &B1_vec_lvxl,
+ &B2_vec_lvxl,
+ &B3_vec_lvxl,
+ &B4_vec_lvxl,
+ &B5_vec_lvxl,
+ &B6_vec_lvxl,
+ &B7_vec_lvxl,
+ &B8_vec_lvxl,
+ &B9_vec_lvxl,
+ &B10_vec_lvxl,
+ &B11_vec_lvxl,
+ &B12_vec_lvxl,
+ &B13_vec_lvxl,
+ &B14_vec_lvxl,
+ &B15_vec_lvxl,
+ &B16_vec_lvxl,
+ &B17_vec_lvxl,
+ &B18_vec_lvxl,
+ &B19_vec_lvxl,
+ &B20_vec_lvxl,
+ &B_vec_vlogefp,
+ &B1_vec_lvsl,
+ &B2_vec_lvsl,
+ &B3_vec_lvsl,
+ &B4_vec_lvsl,
+ &B5_vec_lvsl,
+ &B6_vec_lvsl,
+ &B7_vec_lvsl,
+ &B8_vec_lvsl,
+ &B9_vec_lvsl,
+ &B1_vec_lvsr,
+ &B2_vec_lvsr,
+ &B3_vec_lvsr,
+ &B4_vec_lvsr,
+ &B5_vec_lvsr,
+ &B6_vec_lvsr,
+ &B7_vec_lvsr,
+ &B8_vec_lvsr,
+ &B9_vec_lvsr,
+ &B_vec_vmaddfp,
+ &B_vec_vmhaddshs,
+ &B1_vec_vmaxsh,
+ &B1_vec_vmaxuh,
+ &B1_vec_vmaxsw,
+ &B1_vec_vmaxuw,
+ &B1_vec_vmaxsb,
+ &B1_vec_vmaxub,
+ &B_vec_vmaxfp,
+ &B2_vec_vmaxsh,
+ &B3_vec_vmaxsh,
+ &B2_vec_vmaxsw,
+ &B3_vec_vmaxsw,
+ &B2_vec_vmaxsb,
+ &B3_vec_vmaxsb,
+ &B2_vec_vmaxuh,
+ &B3_vec_vmaxuh,
+ &B2_vec_vmaxuw,
+ &B3_vec_vmaxuw,
+ &B2_vec_vmaxub,
+ &B3_vec_vmaxub,
+ &B1_vec_vmrghh,
+ &B1_vec_vmrghw,
+ &B1_vec_vmrghb,
+ &B2_vec_vmrghw,
+ &B2_vec_vmrghh,
+ &B3_vec_vmrghh,
+ &B3_vec_vmrghw,
+ &B2_vec_vmrghb,
+ &B4_vec_vmrghh,
+ &B4_vec_vmrghw,
+ &B3_vec_vmrghb,
+ &B1_vec_vmrglh,
+ &B1_vec_vmrglw,
+ &B1_vec_vmrglb,
+ &B2_vec_vmrglw,
+ &B2_vec_vmrglh,
+ &B3_vec_vmrglh,
+ &B3_vec_vmrglw,
+ &B2_vec_vmrglb,
+ &B4_vec_vmrglh,
+ &B4_vec_vmrglw,
+ &B3_vec_vmrglb,
+ &B_vec_mfvscr,
+ &B1_vec_vminsh,
+ &B1_vec_vminuh,
+ &B1_vec_vminsw,
+ &B1_vec_vminuw,
+ &B1_vec_vminsb,
+ &B1_vec_vminub,
+ &B_vec_vminfp,
+ &B2_vec_vminsh,
+ &B3_vec_vminsh,
+ &B2_vec_vminsw,
+ &B3_vec_vminsw,
+ &B2_vec_vminsb,
+ &B3_vec_vminsb,
+ &B2_vec_vminuh,
+ &B3_vec_vminuh,
+ &B2_vec_vminuw,
+ &B3_vec_vminuw,
+ &B2_vec_vminub,
+ &B3_vec_vminub,
+ &B1_vec_vmladduhm,
+ &B2_vec_vmladduhm,
+ &B3_vec_vmladduhm,
+ &B4_vec_vmladduhm,
+ &B_vec_vmhraddshs,
+ &B_vec_vmsumshm,
+ &B_vec_vmsummbm,
+ &B_vec_vmsumuhm,
+ &B_vec_vmsumubm,
+ &B_vec_vmsumshs,
+ &B_vec_vmsumuhs,
+ &B1_vec_mtvscr,
+ &B2_vec_mtvscr,
+ &B3_vec_mtvscr,
+ &B4_vec_mtvscr,
+ &B5_vec_mtvscr,
+ &B6_vec_mtvscr,
+ &B7_vec_mtvscr,
+ &B8_vec_mtvscr,
+ &B9_vec_mtvscr,
+ &B10_vec_mtvscr,
+ &B_vec_vmulesh,
+ &B_vec_vmulesb,
+ &B_vec_vmuleuh,
+ &B_vec_vmuleub,
+ &B_vec_vmulosh,
+ &B_vec_vmulosb,
+ &B_vec_vmulouh,
+ &B_vec_vmuloub,
+ &B_vec_vnmsubfp,
+ &B1_vec_vnor,
+ &B2_vec_vnor,
+ &B3_vec_vnor,
+ &B4_vec_vnor,
+ &B5_vec_vnor,
+ &B6_vec_vnor,
+ &B7_vec_vnor,
+ &B8_vec_vnor,
+ &B9_vec_vnor,
+ &B10_vec_vnor,
+ &B1_vec_vor,
+ &B2_vec_vor,
+ &B3_vec_vor,
+ &B4_vec_vor,
+ &B5_vec_vor,
+ &B6_vec_vor,
+ &B7_vec_vor,
+ &B8_vec_vor,
+ &B9_vec_vor,
+ &B10_vec_vor,
+ &B11_vec_vor,
+ &B12_vec_vor,
+ &B13_vec_vor,
+ &B14_vec_vor,
+ &B15_vec_vor,
+ &B16_vec_vor,
+ &B17_vec_vor,
+ &B18_vec_vor,
+ &B19_vec_vor,
+ &B20_vec_vor,
+ &B21_vec_vor,
+ &B22_vec_vor,
+ &B23_vec_vor,
+ &B24_vec_vor,
+ &B1_vec_vpkuhum,
+ &B1_vec_vpkuwum,
+ &B2_vec_vpkuhum,
+ &B2_vec_vpkuwum,
+ &B3_vec_vpkuhum,
+ &B3_vec_vpkuwum,
+ &B_vec_vpkpx,
+ &B_vec_vpkshss,
+ &B_vec_vpkswss,
+ &B_vec_vpkuhus,
+ &B_vec_vpkuwus,
+ &B_vec_vpkshus,
+ &B_vec_vpkswus,
+ &B1_vec_vperm,
+ &B2_vec_vperm,
+ &B3_vec_vperm,
+ &B4_vec_vperm,
+ &B5_vec_vperm,
+ &B6_vec_vperm,
+ &B7_vec_vperm,
+ &B8_vec_vperm,
+ &B9_vec_vperm,
+ &B10_vec_vperm,
+ &B11_vec_vperm,
+ &B_vec_vrefp,
+ &B1_vec_vrlh,
+ &B1_vec_vrlw,
+ &B1_vec_vrlb,
+ &B2_vec_vrlh,
+ &B2_vec_vrlw,
+ &B2_vec_vrlb,
+ &B_vec_vrfin,
+ &B_vec_vrsqrtefp,
+ &B1_vec_vsel,
+ &B2_vec_vsel,
+ &B3_vec_vsel,
+ &B4_vec_vsel,
+ &B5_vec_vsel,
+ &B6_vec_vsel,
+ &B7_vec_vsel,
+ &B8_vec_vsel,
+ &B9_vec_vsel,
+ &B10_vec_vsel,
+ &B11_vec_vsel,
+ &B12_vec_vsel,
+ &B13_vec_vsel,
+ &B14_vec_vsel,
+ &B15_vec_vsel,
+ &B16_vec_vsel,
+ &B17_vec_vsel,
+ &B18_vec_vsel,
+ &B19_vec_vsel,
+ &B20_vec_vsel,
+ &B1_vec_vslh,
+ &B1_vec_vslw,
+ &B1_vec_vslb,
+ &B2_vec_vslh,
+ &B2_vec_vslw,
+ &B2_vec_vslb,
+ &B1_vec_vsldoi,
+ &B2_vec_vsldoi,
+ &B3_vec_vsldoi,
+ &B4_vec_vsldoi,
+ &B5_vec_vsldoi,
+ &B6_vec_vsldoi,
+ &B7_vec_vsldoi,
+ &B8_vec_vsldoi,
+ &B9_vec_vsldoi,
+ &B10_vec_vsldoi,
+ &B11_vec_vsldoi,
+ &B1_vec_vsl,
+ &B2_vec_vsl,
+ &B3_vec_vsl,
+ &B4_vec_vsl,
+ &B5_vec_vsl,
+ &B6_vec_vsl,
+ &B7_vec_vsl,
+ &B8_vec_vsl,
+ &B9_vec_vsl,
+ &B10_vec_vsl,
+ &B11_vec_vsl,
+ &B12_vec_vsl,
+ &B13_vec_vsl,
+ &B14_vec_vsl,
+ &B15_vec_vsl,
+ &B16_vec_vsl,
+ &B17_vec_vsl,
+ &B18_vec_vsl,
+ &B19_vec_vsl,
+ &B20_vec_vsl,
+ &B21_vec_vsl,
+ &B22_vec_vsl,
+ &B23_vec_vsl,
+ &B24_vec_vsl,
+ &B25_vec_vsl,
+ &B26_vec_vsl,
+ &B27_vec_vsl,
+ &B28_vec_vsl,
+ &B29_vec_vsl,
+ &B30_vec_vsl,
+ &B1_vec_vslo,
+ &B2_vec_vslo,
+ &B3_vec_vslo,
+ &B4_vec_vslo,
+ &B5_vec_vslo,
+ &B6_vec_vslo,
+ &B7_vec_vslo,
+ &B8_vec_vslo,
+ &B9_vec_vslo,
+ &B10_vec_vslo,
+ &B11_vec_vslo,
+ &B12_vec_vslo,
+ &B13_vec_vslo,
+ &B14_vec_vslo,
+ &B15_vec_vslo,
+ &B16_vec_vslo,
+ &B1_vec_vsplth,
+ &B1_vec_vspltw,
+ &B1_vec_vspltb,
+ &B2_vec_vspltw,
+ &B2_vec_vsplth,
+ &B3_vec_vsplth,
+ &B3_vec_vspltw,
+ &B2_vec_vspltb,
+ &B4_vec_vsplth,
+ &B4_vec_vspltw,
+ &B3_vec_vspltb,
+ &B_vec_vspltish,
+ &B_vec_vspltisw,
+ &B_vec_vspltisb,
+ &B_vec_splat_u16,
+ &B_vec_splat_u32,
+ &B_vec_splat_u8,
+ &B1_vec_vsrh,
+ &B1_vec_vsrw,
+ &B1_vec_vsrb,
+ &B2_vec_vsrh,
+ &B2_vec_vsrw,
+ &B2_vec_vsrb,
+ &B1_vec_vsrah,
+ &B1_vec_vsraw,
+ &B1_vec_vsrab,
+ &B2_vec_vsrah,
+ &B2_vec_vsraw,
+ &B2_vec_vsrab,
+ &B1_vec_vsr,
+ &B2_vec_vsr,
+ &B3_vec_vsr,
+ &B4_vec_vsr,
+ &B5_vec_vsr,
+ &B6_vec_vsr,
+ &B7_vec_vsr,
+ &B8_vec_vsr,
+ &B9_vec_vsr,
+ &B10_vec_vsr,
+ &B11_vec_vsr,
+ &B12_vec_vsr,
+ &B13_vec_vsr,
+ &B14_vec_vsr,
+ &B15_vec_vsr,
+ &B16_vec_vsr,
+ &B17_vec_vsr,
+ &B18_vec_vsr,
+ &B19_vec_vsr,
+ &B20_vec_vsr,
+ &B21_vec_vsr,
+ &B22_vec_vsr,
+ &B23_vec_vsr,
+ &B24_vec_vsr,
+ &B25_vec_vsr,
+ &B26_vec_vsr,
+ &B27_vec_vsr,
+ &B28_vec_vsr,
+ &B29_vec_vsr,
+ &B30_vec_vsr,
+ &B1_vec_vsro,
+ &B2_vec_vsro,
+ &B3_vec_vsro,
+ &B4_vec_vsro,
+ &B5_vec_vsro,
+ &B6_vec_vsro,
+ &B7_vec_vsro,
+ &B8_vec_vsro,
+ &B9_vec_vsro,
+ &B10_vec_vsro,
+ &B11_vec_vsro,
+ &B12_vec_vsro,
+ &B13_vec_vsro,
+ &B14_vec_vsro,
+ &B15_vec_vsro,
+ &B16_vec_vsro,
+ &B1_vec_stvx,
+ &B2_vec_stvx,
+ &B3_vec_stvx,
+ &B4_vec_stvx,
+ &B5_vec_stvx,
+ &B6_vec_stvx,
+ &B7_vec_stvx,
+ &B8_vec_stvx,
+ &B9_vec_stvx,
+ &B10_vec_stvx,
+ &B11_vec_stvx,
+ &B12_vec_stvx,
+ &B13_vec_stvx,
+ &B14_vec_stvx,
+ &B15_vec_stvx,
+ &B16_vec_stvx,
+ &B17_vec_stvx,
+ &B18_vec_stvx,
+ &B19_vec_stvx,
+ &B20_vec_stvx,
+ &B21_vec_stvx,
+ &B22_vec_stvx,
+ &B23_vec_stvx,
+ &B24_vec_stvx,
+ &B25_vec_stvx,
+ &B26_vec_stvx,
+ &B27_vec_stvx,
+ &B28_vec_stvx,
+ &B29_vec_stvx,
+ &B30_vec_stvx,
+ &B1_vec_stvebx,
+ &B2_vec_stvebx,
+ &B1_vec_stvewx,
+ &B2_vec_stvewx,
+ &B3_vec_stvewx,
+ &B4_vec_stvewx,
+ &B3_vec_stvebx,
+ &B4_vec_stvebx,
+ &B5_vec_stvewx,
+ &B1_vec_stvehx,
+ &B2_vec_stvehx,
+ &B3_vec_stvehx,
+ &B6_vec_stvewx,
+ &B7_vec_stvewx,
+ &B5_vec_stvebx,
+ &B4_vec_stvehx,
+ &B8_vec_stvewx,
+ &B9_vec_stvewx,
+ &B6_vec_stvebx,
+ &B1_vec_stvxl,
+ &B2_vec_stvxl,
+ &B3_vec_stvxl,
+ &B4_vec_stvxl,
+ &B5_vec_stvxl,
+ &B6_vec_stvxl,
+ &B7_vec_stvxl,
+ &B8_vec_stvxl,
+ &B9_vec_stvxl,
+ &B10_vec_stvxl,
+ &B11_vec_stvxl,
+ &B12_vec_stvxl,
+ &B13_vec_stvxl,
+ &B14_vec_stvxl,
+ &B15_vec_stvxl,
+ &B16_vec_stvxl,
+ &B17_vec_stvxl,
+ &B18_vec_stvxl,
+ &B19_vec_stvxl,
+ &B20_vec_stvxl,
+ &B21_vec_stvxl,
+ &B22_vec_stvxl,
+ &B23_vec_stvxl,
+ &B24_vec_stvxl,
+ &B25_vec_stvxl,
+ &B26_vec_stvxl,
+ &B27_vec_stvxl,
+ &B28_vec_stvxl,
+ &B29_vec_stvxl,
+ &B30_vec_stvxl,
+ &B1_vec_vsubuhm,
+ &B2_vec_vsubuhm,
+ &B1_vec_vsubuwm,
+ &B2_vec_vsubuwm,
+ &B1_vec_vsububm,
+ &B2_vec_vsububm,
+ &B_vec_vsubfp,
+ &B3_vec_vsubuhm,
+ &B4_vec_vsubuhm,
+ &B3_vec_vsubuwm,
+ &B4_vec_vsubuwm,
+ &B3_vec_vsububm,
+ &B4_vec_vsububm,
+ &B5_vec_vsubuhm,
+ &B6_vec_vsubuhm,
+ &B5_vec_vsubuwm,
+ &B6_vec_vsubuwm,
+ &B5_vec_vsububm,
+ &B6_vec_vsububm,
+ &B_vec_vsubcuw,
+ &B1_vec_vsubshs,
+ &B1_vec_vsubuhs,
+ &B1_vec_vsubsws,
+ &B1_vec_vsubuws,
+ &B1_vec_vsubsbs,
+ &B1_vec_vsububs,
+ &B2_vec_vsubshs,
+ &B3_vec_vsubshs,
+ &B2_vec_vsubsws,
+ &B3_vec_vsubsws,
+ &B2_vec_vsubsbs,
+ &B3_vec_vsubsbs,
+ &B2_vec_vsubuhs,
+ &B3_vec_vsubuhs,
+ &B2_vec_vsubuws,
+ &B3_vec_vsubuws,
+ &B2_vec_vsububs,
+ &B3_vec_vsububs,
+ &B_vec_vsum2sws,
+ &B_vec_vsum4shs,
+ &B_vec_vsum4sbs,
+ &B_vec_vsum4ubs,
+ &B_vec_vsumsws,
+ &B_vec_vrfiz,
+ &B1_vec_unpack2sh,
+ &B2_vec_unpack2sh,
+ &B1_vec_unpack2sl,
+ &B2_vec_unpack2sl,
+ &B1_vec_unpack2uh,
+ &B2_vec_unpack2uh,
+ &B1_vec_unpack2ul,
+ &B2_vec_unpack2ul,
+ &B1_vec_vupkhsh,
+ &B1_vec_vupkhsb,
+ &B_vec_vupkhpx,
+ &B2_vec_vupkhsh,
+ &B2_vec_vupkhsb,
+ &B1_vec_vupklsh,
+ &B1_vec_vupklsb,
+ &B_vec_vupklpx,
+ &B2_vec_vupklsh,
+ &B2_vec_vupklsb,
+ &B1_vec_vxor,
+ &B2_vec_vxor,
+ &B3_vec_vxor,
+ &B4_vec_vxor,
+ &B5_vec_vxor,
+ &B6_vec_vxor,
+ &B7_vec_vxor,
+ &B8_vec_vxor,
+ &B9_vec_vxor,
+ &B10_vec_vxor,
+ &B11_vec_vxor,
+ &B12_vec_vxor,
+ &B13_vec_vxor,
+ &B14_vec_vxor,
+ &B15_vec_vxor,
+ &B16_vec_vxor,
+ &B17_vec_vxor,
+ &B18_vec_vxor,
+ &B19_vec_vxor,
+ &B20_vec_vxor,
+ &B21_vec_vxor,
+ &B22_vec_vxor,
+ &B23_vec_vxor,
+ &B24_vec_vxor,
+};
+
+static const struct builtin *const O_vec_abs[4] = {
+ &B1_vec_abs,
+ &B2_vec_abs,
+ &B3_vec_abs,
+ &B4_vec_abs,
+};
+static const struct builtin *const O_vec_abss[3] = {
+ &B1_vec_abss,
+ &B2_vec_abss,
+ &B3_vec_abss,
+};
+static const struct builtin *const O_vec_add[19] = {
+ &B1_vec_vadduhm,
+ &B2_vec_vadduhm,
+ &B1_vec_vadduwm,
+ &B2_vec_vadduwm,
+ &B1_vec_vaddubm,
+ &B2_vec_vaddubm,
+ &B_vec_vaddfp,
+ &B3_vec_vadduhm,
+ &B4_vec_vadduhm,
+ &B3_vec_vadduwm,
+ &B4_vec_vadduwm,
+ &B3_vec_vaddubm,
+ &B4_vec_vaddubm,
+ &B5_vec_vadduhm,
+ &B6_vec_vadduhm,
+ &B5_vec_vadduwm,
+ &B6_vec_vadduwm,
+ &B5_vec_vaddubm,
+ &B6_vec_vaddubm,
+};
+static const struct builtin *const O_vec_addc[1] = {
+ &B_vec_vaddcuw,
+};
+static const struct builtin *const O_vec_adds[18] = {
+ &B1_vec_vaddshs,
+ &B1_vec_vadduhs,
+ &B1_vec_vaddsws,
+ &B1_vec_vadduws,
+ &B1_vec_vaddsbs,
+ &B1_vec_vaddubs,
+ &B2_vec_vaddshs,
+ &B3_vec_vaddshs,
+ &B2_vec_vaddsws,
+ &B3_vec_vaddsws,
+ &B2_vec_vaddsbs,
+ &B3_vec_vaddsbs,
+ &B2_vec_vadduhs,
+ &B3_vec_vadduhs,
+ &B2_vec_vadduws,
+ &B3_vec_vadduws,
+ &B2_vec_vaddubs,
+ &B3_vec_vaddubs,
+};
+static const struct builtin *const O_vec_all_eq[23] = {
+ &B1_vec_all_eq,
+ &B2_vec_all_eq,
+ &B3_vec_all_eq,
+ &B4_vec_all_eq,
+ &B5_vec_all_eq,
+ &B6_vec_all_eq,
+ &B7_vec_all_eq,
+ &B8_vec_all_eq,
+ &B9_vec_all_eq,
+ &B10_vec_all_eq,
+ &B11_vec_all_eq,
+ &B12_vec_all_eq,
+ &B13_vec_all_eq,
+ &B14_vec_all_eq,
+ &B15_vec_all_eq,
+ &B16_vec_all_eq,
+ &B17_vec_all_eq,
+ &B18_vec_all_eq,
+ &B19_vec_all_eq,
+ &B20_vec_all_eq,
+ &B21_vec_all_eq,
+ &B22_vec_all_eq,
+ &B23_vec_all_eq,
+};
+static const struct builtin *const O_vec_all_ge[19] = {
+ &B1_vec_all_ge,
+ &B2_vec_all_ge,
+ &B3_vec_all_ge,
+ &B4_vec_all_ge,
+ &B5_vec_all_ge,
+ &B6_vec_all_ge,
+ &B7_vec_all_ge,
+ &B8_vec_all_ge,
+ &B9_vec_all_ge,
+ &B10_vec_all_ge,
+ &B11_vec_all_ge,
+ &B12_vec_all_ge,
+ &B13_vec_all_ge,
+ &B14_vec_all_ge,
+ &B15_vec_all_ge,
+ &B16_vec_all_ge,
+ &B17_vec_all_ge,
+ &B18_vec_all_ge,
+ &B19_vec_all_ge,
+};
+static const struct builtin *const O_vec_all_gt[19] = {
+ &B1_vec_all_gt,
+ &B2_vec_all_gt,
+ &B3_vec_all_gt,
+ &B4_vec_all_gt,
+ &B5_vec_all_gt,
+ &B6_vec_all_gt,
+ &B7_vec_all_gt,
+ &B8_vec_all_gt,
+ &B9_vec_all_gt,
+ &B10_vec_all_gt,
+ &B11_vec_all_gt,
+ &B12_vec_all_gt,
+ &B13_vec_all_gt,
+ &B14_vec_all_gt,
+ &B15_vec_all_gt,
+ &B16_vec_all_gt,
+ &B17_vec_all_gt,
+ &B18_vec_all_gt,
+ &B19_vec_all_gt,
+};
+static const struct builtin *const O_vec_all_in[1] = {
+ &B_vec_all_in,
+};
+static const struct builtin *const O_vec_all_le[19] = {
+ &B1_vec_all_le,
+ &B2_vec_all_le,
+ &B3_vec_all_le,
+ &B4_vec_all_le,
+ &B5_vec_all_le,
+ &B6_vec_all_le,
+ &B7_vec_all_le,
+ &B8_vec_all_le,
+ &B9_vec_all_le,
+ &B10_vec_all_le,
+ &B11_vec_all_le,
+ &B12_vec_all_le,
+ &B13_vec_all_le,
+ &B14_vec_all_le,
+ &B15_vec_all_le,
+ &B16_vec_all_le,
+ &B17_vec_all_le,
+ &B18_vec_all_le,
+ &B19_vec_all_le,
+};
+static const struct builtin *const O_vec_all_lt[19] = {
+ &B1_vec_all_lt,
+ &B2_vec_all_lt,
+ &B3_vec_all_lt,
+ &B4_vec_all_lt,
+ &B5_vec_all_lt,
+ &B6_vec_all_lt,
+ &B7_vec_all_lt,
+ &B8_vec_all_lt,
+ &B9_vec_all_lt,
+ &B10_vec_all_lt,
+ &B11_vec_all_lt,
+ &B12_vec_all_lt,
+ &B13_vec_all_lt,
+ &B14_vec_all_lt,
+ &B15_vec_all_lt,
+ &B16_vec_all_lt,
+ &B17_vec_all_lt,
+ &B18_vec_all_lt,
+ &B19_vec_all_lt,
+};
+static const struct builtin *const O_vec_all_nan[1] = {
+ &B_vec_all_nan,
+};
+static const struct builtin *const O_vec_all_ne[23] = {
+ &B1_vec_all_ne,
+ &B2_vec_all_ne,
+ &B3_vec_all_ne,
+ &B4_vec_all_ne,
+ &B5_vec_all_ne,
+ &B6_vec_all_ne,
+ &B7_vec_all_ne,
+ &B8_vec_all_ne,
+ &B9_vec_all_ne,
+ &B10_vec_all_ne,
+ &B11_vec_all_ne,
+ &B12_vec_all_ne,
+ &B13_vec_all_ne,
+ &B14_vec_all_ne,
+ &B15_vec_all_ne,
+ &B16_vec_all_ne,
+ &B17_vec_all_ne,
+ &B18_vec_all_ne,
+ &B19_vec_all_ne,
+ &B20_vec_all_ne,
+ &B21_vec_all_ne,
+ &B22_vec_all_ne,
+ &B23_vec_all_ne,
+};
+static const struct builtin *const O_vec_all_nge[1] = {
+ &B_vec_all_nge,
+};
+static const struct builtin *const O_vec_all_ngt[1] = {
+ &B_vec_all_ngt,
+};
+static const struct builtin *const O_vec_all_nle[1] = {
+ &B_vec_all_nle,
+};
+static const struct builtin *const O_vec_all_nlt[1] = {
+ &B_vec_all_nlt,
+};
+static const struct builtin *const O_vec_all_numeric[1] = {
+ &B_vec_all_numeric,
+};
+static const struct builtin *const O_vec_and[24] = {
+ &B1_vec_vand,
+ &B2_vec_vand,
+ &B3_vec_vand,
+ &B4_vec_vand,
+ &B5_vec_vand,
+ &B6_vec_vand,
+ &B7_vec_vand,
+ &B8_vec_vand,
+ &B9_vec_vand,
+ &B10_vec_vand,
+ &B11_vec_vand,
+ &B12_vec_vand,
+ &B13_vec_vand,
+ &B14_vec_vand,
+ &B15_vec_vand,
+ &B16_vec_vand,
+ &B17_vec_vand,
+ &B18_vec_vand,
+ &B19_vec_vand,
+ &B20_vec_vand,
+ &B21_vec_vand,
+ &B22_vec_vand,
+ &B23_vec_vand,
+ &B24_vec_vand,
+};
+static const struct builtin *const O_vec_andc[24] = {
+ &B1_vec_vandc,
+ &B2_vec_vandc,
+ &B3_vec_vandc,
+ &B4_vec_vandc,
+ &B5_vec_vandc,
+ &B6_vec_vandc,
+ &B7_vec_vandc,
+ &B8_vec_vandc,
+ &B9_vec_vandc,
+ &B10_vec_vandc,
+ &B11_vec_vandc,
+ &B12_vec_vandc,
+ &B13_vec_vandc,
+ &B14_vec_vandc,
+ &B15_vec_vandc,
+ &B16_vec_vandc,
+ &B17_vec_vandc,
+ &B18_vec_vandc,
+ &B19_vec_vandc,
+ &B20_vec_vandc,
+ &B21_vec_vandc,
+ &B22_vec_vandc,
+ &B23_vec_vandc,
+ &B24_vec_vandc,
+};
+static const struct builtin *const O_vec_any_eq[23] = {
+ &B1_vec_any_eq,
+ &B2_vec_any_eq,
+ &B3_vec_any_eq,
+ &B4_vec_any_eq,
+ &B5_vec_any_eq,
+ &B6_vec_any_eq,
+ &B7_vec_any_eq,
+ &B8_vec_any_eq,
+ &B9_vec_any_eq,
+ &B10_vec_any_eq,
+ &B11_vec_any_eq,
+ &B12_vec_any_eq,
+ &B13_vec_any_eq,
+ &B14_vec_any_eq,
+ &B15_vec_any_eq,
+ &B16_vec_any_eq,
+ &B17_vec_any_eq,
+ &B18_vec_any_eq,
+ &B19_vec_any_eq,
+ &B20_vec_any_eq,
+ &B21_vec_any_eq,
+ &B22_vec_any_eq,
+ &B23_vec_any_eq,
+};
+static const struct builtin *const O_vec_any_ge[19] = {
+ &B1_vec_any_ge,
+ &B2_vec_any_ge,
+ &B3_vec_any_ge,
+ &B4_vec_any_ge,
+ &B5_vec_any_ge,
+ &B6_vec_any_ge,
+ &B7_vec_any_ge,
+ &B8_vec_any_ge,
+ &B9_vec_any_ge,
+ &B10_vec_any_ge,
+ &B11_vec_any_ge,
+ &B12_vec_any_ge,
+ &B13_vec_any_ge,
+ &B14_vec_any_ge,
+ &B15_vec_any_ge,
+ &B16_vec_any_ge,
+ &B17_vec_any_ge,
+ &B18_vec_any_ge,
+ &B19_vec_any_ge,
+};
+static const struct builtin *const O_vec_any_gt[19] = {
+ &B1_vec_any_gt,
+ &B2_vec_any_gt,
+ &B3_vec_any_gt,
+ &B4_vec_any_gt,
+ &B5_vec_any_gt,
+ &B6_vec_any_gt,
+ &B7_vec_any_gt,
+ &B8_vec_any_gt,
+ &B9_vec_any_gt,
+ &B10_vec_any_gt,
+ &B11_vec_any_gt,
+ &B12_vec_any_gt,
+ &B13_vec_any_gt,
+ &B14_vec_any_gt,
+ &B15_vec_any_gt,
+ &B16_vec_any_gt,
+ &B17_vec_any_gt,
+ &B18_vec_any_gt,
+ &B19_vec_any_gt,
+};
+static const struct builtin *const O_vec_any_le[19] = {
+ &B1_vec_any_le,
+ &B2_vec_any_le,
+ &B3_vec_any_le,
+ &B4_vec_any_le,
+ &B5_vec_any_le,
+ &B6_vec_any_le,
+ &B7_vec_any_le,
+ &B8_vec_any_le,
+ &B9_vec_any_le,
+ &B10_vec_any_le,
+ &B11_vec_any_le,
+ &B12_vec_any_le,
+ &B13_vec_any_le,
+ &B14_vec_any_le,
+ &B15_vec_any_le,
+ &B16_vec_any_le,
+ &B17_vec_any_le,
+ &B18_vec_any_le,
+ &B19_vec_any_le,
+};
+static const struct builtin *const O_vec_any_lt[19] = {
+ &B1_vec_any_lt,
+ &B2_vec_any_lt,
+ &B3_vec_any_lt,
+ &B4_vec_any_lt,
+ &B5_vec_any_lt,
+ &B6_vec_any_lt,
+ &B7_vec_any_lt,
+ &B8_vec_any_lt,
+ &B9_vec_any_lt,
+ &B10_vec_any_lt,
+ &B11_vec_any_lt,
+ &B12_vec_any_lt,
+ &B13_vec_any_lt,
+ &B14_vec_any_lt,
+ &B15_vec_any_lt,
+ &B16_vec_any_lt,
+ &B17_vec_any_lt,
+ &B18_vec_any_lt,
+ &B19_vec_any_lt,
+};
+static const struct builtin *const O_vec_any_nan[1] = {
+ &B_vec_any_nan,
+};
+static const struct builtin *const O_vec_any_ne[23] = {
+ &B1_vec_any_ne,
+ &B2_vec_any_ne,
+ &B3_vec_any_ne,
+ &B4_vec_any_ne,
+ &B5_vec_any_ne,
+ &B6_vec_any_ne,
+ &B7_vec_any_ne,
+ &B8_vec_any_ne,
+ &B9_vec_any_ne,
+ &B10_vec_any_ne,
+ &B11_vec_any_ne,
+ &B12_vec_any_ne,
+ &B13_vec_any_ne,
+ &B14_vec_any_ne,
+ &B15_vec_any_ne,
+ &B16_vec_any_ne,
+ &B17_vec_any_ne,
+ &B18_vec_any_ne,
+ &B19_vec_any_ne,
+ &B20_vec_any_ne,
+ &B21_vec_any_ne,
+ &B22_vec_any_ne,
+ &B23_vec_any_ne,
+};
+static const struct builtin *const O_vec_any_nge[1] = {
+ &B_vec_any_nge,
+};
+static const struct builtin *const O_vec_any_ngt[1] = {
+ &B_vec_any_ngt,
+};
+static const struct builtin *const O_vec_any_nle[1] = {
+ &B_vec_any_nle,
+};
+static const struct builtin *const O_vec_any_nlt[1] = {
+ &B_vec_any_nlt,
+};
+static const struct builtin *const O_vec_any_numeric[1] = {
+ &B_vec_any_numeric,
+};
+static const struct builtin *const O_vec_any_out[1] = {
+ &B_vec_any_out,
+};
+static const struct builtin *const O_vec_avg[6] = {
+ &B_vec_vavgsh,
+ &B_vec_vavgsw,
+ &B_vec_vavgsb,
+ &B_vec_vavguh,
+ &B_vec_vavguw,
+ &B_vec_vavgub,
+};
+static const struct builtin *const O_vec_ceil[1] = {
+ &B_vec_vrfip,
+};
+static const struct builtin *const O_vec_cmpb[1] = {
+ &B_vec_vcmpbfp,
+};
+static const struct builtin *const O_vec_cmpeq[7] = {
+ &B_vec_vcmpeqfp,
+ &B1_vec_vcmpequh,
+ &B1_vec_vcmpequw,
+ &B1_vec_vcmpequb,
+ &B2_vec_vcmpequh,
+ &B2_vec_vcmpequw,
+ &B2_vec_vcmpequb,
+};
+static const struct builtin *const O_vec_cmpge[1] = {
+ &B_vec_vcmpgefp,
+};
+static const struct builtin *const O_vec_cmpgt[7] = {
+ &B_vec_vcmpgtfp,
+ &B_vec_vcmpgtsh,
+ &B_vec_vcmpgtsw,
+ &B_vec_vcmpgtsb,
+ &B_vec_vcmpgtuh,
+ &B_vec_vcmpgtuw,
+ &B_vec_vcmpgtub,
+};
+static const struct builtin *const O_vec_cmple[1] = {
+ &B_vec_cmple,
+};
+static const struct builtin *const O_vec_cmplt[7] = {
+ &B1_vec_cmplt,
+ &B2_vec_cmplt,
+ &B3_vec_cmplt,
+ &B4_vec_cmplt,
+ &B5_vec_cmplt,
+ &B6_vec_cmplt,
+ &B7_vec_cmplt,
+};
+static const struct builtin *const O_vec_ctf[2] = {
+ &B_vec_vcfsx,
+ &B_vec_vcfux,
+};
+static const struct builtin *const O_vec_cts[1] = {
+ &B_vec_vctsxs,
+};
+static const struct builtin *const O_vec_ctu[1] = {
+ &B_vec_vctuxs,
+};
+static const struct builtin *const O_vec_dss[1] = {
+ &B_vec_dss,
+};
+static const struct builtin *const O_vec_dssall[1] = {
+ &B_vec_dssall,
+};
+static const struct builtin *const O_vec_dst[20] = {
+ &B1_vec_dst,
+ &B2_vec_dst,
+ &B3_vec_dst,
+ &B4_vec_dst,
+ &B5_vec_dst,
+ &B6_vec_dst,
+ &B7_vec_dst,
+ &B8_vec_dst,
+ &B9_vec_dst,
+ &B10_vec_dst,
+ &B11_vec_dst,
+ &B12_vec_dst,
+ &B13_vec_dst,
+ &B14_vec_dst,
+ &B15_vec_dst,
+ &B16_vec_dst,
+ &B17_vec_dst,
+ &B18_vec_dst,
+ &B19_vec_dst,
+ &B20_vec_dst,
+};
+static const struct builtin *const O_vec_dstst[20] = {
+ &B1_vec_dstst,
+ &B2_vec_dstst,
+ &B3_vec_dstst,
+ &B4_vec_dstst,
+ &B5_vec_dstst,
+ &B6_vec_dstst,
+ &B7_vec_dstst,
+ &B8_vec_dstst,
+ &B9_vec_dstst,
+ &B10_vec_dstst,
+ &B11_vec_dstst,
+ &B12_vec_dstst,
+ &B13_vec_dstst,
+ &B14_vec_dstst,
+ &B15_vec_dstst,
+ &B16_vec_dstst,
+ &B17_vec_dstst,
+ &B18_vec_dstst,
+ &B19_vec_dstst,
+ &B20_vec_dstst,
+};
+static const struct builtin *const O_vec_dststt[20] = {
+ &B1_vec_dststt,
+ &B2_vec_dststt,
+ &B3_vec_dststt,
+ &B4_vec_dststt,
+ &B5_vec_dststt,
+ &B6_vec_dststt,
+ &B7_vec_dststt,
+ &B8_vec_dststt,
+ &B9_vec_dststt,
+ &B10_vec_dststt,
+ &B11_vec_dststt,
+ &B12_vec_dststt,
+ &B13_vec_dststt,
+ &B14_vec_dststt,
+ &B15_vec_dststt,
+ &B16_vec_dststt,
+ &B17_vec_dststt,
+ &B18_vec_dststt,
+ &B19_vec_dststt,
+ &B20_vec_dststt,
+};
+static const struct builtin *const O_vec_dstt[20] = {
+ &B1_vec_dstt,
+ &B2_vec_dstt,
+ &B3_vec_dstt,
+ &B4_vec_dstt,
+ &B5_vec_dstt,
+ &B6_vec_dstt,
+ &B7_vec_dstt,
+ &B8_vec_dstt,
+ &B9_vec_dstt,
+ &B10_vec_dstt,
+ &B11_vec_dstt,
+ &B12_vec_dstt,
+ &B13_vec_dstt,
+ &B14_vec_dstt,
+ &B15_vec_dstt,
+ &B16_vec_dstt,
+ &B17_vec_dstt,
+ &B18_vec_dstt,
+ &B19_vec_dstt,
+ &B20_vec_dstt,
+};
+static const struct builtin *const O_vec_expte[1] = {
+ &B_vec_vexptefp,
+};
+static const struct builtin *const O_vec_floor[1] = {
+ &B_vec_vrfim,
+};
+static const struct builtin *const O_vec_ld[20] = {
+ &B1_vec_lvx,
+ &B2_vec_lvx,
+ &B3_vec_lvx,
+ &B4_vec_lvx,
+ &B5_vec_lvx,
+ &B6_vec_lvx,
+ &B7_vec_lvx,
+ &B8_vec_lvx,
+ &B9_vec_lvx,
+ &B10_vec_lvx,
+ &B11_vec_lvx,
+ &B12_vec_lvx,
+ &B13_vec_lvx,
+ &B14_vec_lvx,
+ &B15_vec_lvx,
+ &B16_vec_lvx,
+ &B17_vec_lvx,
+ &B18_vec_lvx,
+ &B19_vec_lvx,
+ &B20_vec_lvx,
+};
+static const struct builtin *const O_vec_lde[9] = {
+ &B1_vec_lvewx,
+ &B2_vec_lvewx,
+ &B3_vec_lvewx,
+ &B1_vec_lvehx,
+ &B1_vec_lvebx,
+ &B2_vec_lvebx,
+ &B4_vec_lvewx,
+ &B5_vec_lvewx,
+ &B2_vec_lvehx,
+};
+static const struct builtin *const O_vec_ldl[20] = {
+ &B1_vec_lvxl,
+ &B2_vec_lvxl,
+ &B3_vec_lvxl,
+ &B4_vec_lvxl,
+ &B5_vec_lvxl,
+ &B6_vec_lvxl,
+ &B7_vec_lvxl,
+ &B8_vec_lvxl,
+ &B9_vec_lvxl,
+ &B10_vec_lvxl,
+ &B11_vec_lvxl,
+ &B12_vec_lvxl,
+ &B13_vec_lvxl,
+ &B14_vec_lvxl,
+ &B15_vec_lvxl,
+ &B16_vec_lvxl,
+ &B17_vec_lvxl,
+ &B18_vec_lvxl,
+ &B19_vec_lvxl,
+ &B20_vec_lvxl,
+};
+static const struct builtin *const O_vec_loge[1] = {
+ &B_vec_vlogefp,
+};
+static const struct builtin *const O_vec_lvebx[2] = {
+ &B1_vec_lvebx,
+ &B2_vec_lvebx,
+};
+static const struct builtin *const O_vec_lvehx[2] = {
+ &B1_vec_lvehx,
+ &B2_vec_lvehx,
+};
+static const struct builtin *const O_vec_lvewx[5] = {
+ &B1_vec_lvewx,
+ &B2_vec_lvewx,
+ &B3_vec_lvewx,
+ &B4_vec_lvewx,
+ &B5_vec_lvewx,
+};
+static const struct builtin *const O_vec_lvsl[9] = {
+ &B1_vec_lvsl,
+ &B2_vec_lvsl,
+ &B3_vec_lvsl,
+ &B4_vec_lvsl,
+ &B5_vec_lvsl,
+ &B6_vec_lvsl,
+ &B7_vec_lvsl,
+ &B8_vec_lvsl,
+ &B9_vec_lvsl,
+};
+static const struct builtin *const O_vec_lvsr[9] = {
+ &B1_vec_lvsr,
+ &B2_vec_lvsr,
+ &B3_vec_lvsr,
+ &B4_vec_lvsr,
+ &B5_vec_lvsr,
+ &B6_vec_lvsr,
+ &B7_vec_lvsr,
+ &B8_vec_lvsr,
+ &B9_vec_lvsr,
+};
+static const struct builtin *const O_vec_lvx[20] = {
+ &B1_vec_lvx,
+ &B2_vec_lvx,
+ &B3_vec_lvx,
+ &B4_vec_lvx,
+ &B5_vec_lvx,
+ &B6_vec_lvx,
+ &B7_vec_lvx,
+ &B8_vec_lvx,
+ &B9_vec_lvx,
+ &B10_vec_lvx,
+ &B11_vec_lvx,
+ &B12_vec_lvx,
+ &B13_vec_lvx,
+ &B14_vec_lvx,
+ &B15_vec_lvx,
+ &B16_vec_lvx,
+ &B17_vec_lvx,
+ &B18_vec_lvx,
+ &B19_vec_lvx,
+ &B20_vec_lvx,
+};
+static const struct builtin *const O_vec_lvxl[20] = {
+ &B1_vec_lvxl,
+ &B2_vec_lvxl,
+ &B3_vec_lvxl,
+ &B4_vec_lvxl,
+ &B5_vec_lvxl,
+ &B6_vec_lvxl,
+ &B7_vec_lvxl,
+ &B8_vec_lvxl,
+ &B9_vec_lvxl,
+ &B10_vec_lvxl,
+ &B11_vec_lvxl,
+ &B12_vec_lvxl,
+ &B13_vec_lvxl,
+ &B14_vec_lvxl,
+ &B15_vec_lvxl,
+ &B16_vec_lvxl,
+ &B17_vec_lvxl,
+ &B18_vec_lvxl,
+ &B19_vec_lvxl,
+ &B20_vec_lvxl,
+};
+static const struct builtin *const O_vec_madd[1] = {
+ &B_vec_vmaddfp,
+};
+static const struct builtin *const O_vec_madds[1] = {
+ &B_vec_vmhaddshs,
+};
+static const struct builtin *const O_vec_max[19] = {
+ &B1_vec_vmaxsh,
+ &B1_vec_vmaxuh,
+ &B1_vec_vmaxsw,
+ &B1_vec_vmaxuw,
+ &B1_vec_vmaxsb,
+ &B1_vec_vmaxub,
+ &B_vec_vmaxfp,
+ &B2_vec_vmaxsh,
+ &B3_vec_vmaxsh,
+ &B2_vec_vmaxsw,
+ &B3_vec_vmaxsw,
+ &B2_vec_vmaxsb,
+ &B3_vec_vmaxsb,
+ &B2_vec_vmaxuh,
+ &B3_vec_vmaxuh,
+ &B2_vec_vmaxuw,
+ &B3_vec_vmaxuw,
+ &B2_vec_vmaxub,
+ &B3_vec_vmaxub,
+};
+static const struct builtin *const O_vec_mergeh[11] = {
+ &B1_vec_vmrghh,
+ &B1_vec_vmrghw,
+ &B1_vec_vmrghb,
+ &B2_vec_vmrghw,
+ &B2_vec_vmrghh,
+ &B3_vec_vmrghh,
+ &B3_vec_vmrghw,
+ &B2_vec_vmrghb,
+ &B4_vec_vmrghh,
+ &B4_vec_vmrghw,
+ &B3_vec_vmrghb,
+};
+static const struct builtin *const O_vec_mergel[11] = {
+ &B1_vec_vmrglh,
+ &B1_vec_vmrglw,
+ &B1_vec_vmrglb,
+ &B2_vec_vmrglw,
+ &B2_vec_vmrglh,
+ &B3_vec_vmrglh,
+ &B3_vec_vmrglw,
+ &B2_vec_vmrglb,
+ &B4_vec_vmrglh,
+ &B4_vec_vmrglw,
+ &B3_vec_vmrglb,
+};
+static const struct builtin *const O_vec_mfvscr[1] = {
+ &B_vec_mfvscr,
+};
+static const struct builtin *const O_vec_min[19] = {
+ &B1_vec_vminsh,
+ &B1_vec_vminuh,
+ &B1_vec_vminsw,
+ &B1_vec_vminuw,
+ &B1_vec_vminsb,
+ &B1_vec_vminub,
+ &B_vec_vminfp,
+ &B2_vec_vminsh,
+ &B3_vec_vminsh,
+ &B2_vec_vminsw,
+ &B3_vec_vminsw,
+ &B2_vec_vminsb,
+ &B3_vec_vminsb,
+ &B2_vec_vminuh,
+ &B3_vec_vminuh,
+ &B2_vec_vminuw,
+ &B3_vec_vminuw,
+ &B2_vec_vminub,
+ &B3_vec_vminub,
+};
+static const struct builtin *const O_vec_mladd[4] = {
+ &B1_vec_vmladduhm,
+ &B2_vec_vmladduhm,
+ &B3_vec_vmladduhm,
+ &B4_vec_vmladduhm,
+};
+static const struct builtin *const O_vec_mradds[1] = {
+ &B_vec_vmhraddshs,
+};
+static const struct builtin *const O_vec_msum[4] = {
+ &B_vec_vmsumshm,
+ &B_vec_vmsummbm,
+ &B_vec_vmsumuhm,
+ &B_vec_vmsumubm,
+};
+static const struct builtin *const O_vec_msums[2] = {
+ &B_vec_vmsumshs,
+ &B_vec_vmsumuhs,
+};
+static const struct builtin *const O_vec_mtvscr[10] = {
+ &B1_vec_mtvscr,
+ &B2_vec_mtvscr,
+ &B3_vec_mtvscr,
+ &B4_vec_mtvscr,
+ &B5_vec_mtvscr,
+ &B6_vec_mtvscr,
+ &B7_vec_mtvscr,
+ &B8_vec_mtvscr,
+ &B9_vec_mtvscr,
+ &B10_vec_mtvscr,
+};
+static const struct builtin *const O_vec_mule[4] = {
+ &B_vec_vmulesh,
+ &B_vec_vmulesb,
+ &B_vec_vmuleuh,
+ &B_vec_vmuleub,
+};
+static const struct builtin *const O_vec_mulo[4] = {
+ &B_vec_vmulosh,
+ &B_vec_vmulosb,
+ &B_vec_vmulouh,
+ &B_vec_vmuloub,
+};
+static const struct builtin *const O_vec_nmsub[1] = {
+ &B_vec_vnmsubfp,
+};
+static const struct builtin *const O_vec_nor[10] = {
+ &B1_vec_vnor,
+ &B2_vec_vnor,
+ &B3_vec_vnor,
+ &B4_vec_vnor,
+ &B5_vec_vnor,
+ &B6_vec_vnor,
+ &B7_vec_vnor,
+ &B8_vec_vnor,
+ &B9_vec_vnor,
+ &B10_vec_vnor,
+};
+static const struct builtin *const O_vec_or[24] = {
+ &B1_vec_vor,
+ &B2_vec_vor,
+ &B3_vec_vor,
+ &B4_vec_vor,
+ &B5_vec_vor,
+ &B6_vec_vor,
+ &B7_vec_vor,
+ &B8_vec_vor,
+ &B9_vec_vor,
+ &B10_vec_vor,
+ &B11_vec_vor,
+ &B12_vec_vor,
+ &B13_vec_vor,
+ &B14_vec_vor,
+ &B15_vec_vor,
+ &B16_vec_vor,
+ &B17_vec_vor,
+ &B18_vec_vor,
+ &B19_vec_vor,
+ &B20_vec_vor,
+ &B21_vec_vor,
+ &B22_vec_vor,
+ &B23_vec_vor,
+ &B24_vec_vor,
+};
+static const struct builtin *const O_vec_pack[6] = {
+ &B1_vec_vpkuhum,
+ &B1_vec_vpkuwum,
+ &B2_vec_vpkuhum,
+ &B2_vec_vpkuwum,
+ &B3_vec_vpkuhum,
+ &B3_vec_vpkuwum,
+};
+static const struct builtin *const O_vec_packpx[1] = {
+ &B_vec_vpkpx,
+};
+static const struct builtin *const O_vec_packs[4] = {
+ &B_vec_vpkshss,
+ &B_vec_vpkswss,
+ &B_vec_vpkuhus,
+ &B_vec_vpkuwus,
+};
+static const struct builtin *const O_vec_packsu[4] = {
+ &B_vec_vpkshus,
+ &B_vec_vpkswus,
+ &B_vec_vpkuhus,
+ &B_vec_vpkuwus,
+};
+static const struct builtin *const O_vec_perm[11] = {
+ &B1_vec_vperm,
+ &B2_vec_vperm,
+ &B3_vec_vperm,
+ &B4_vec_vperm,
+ &B5_vec_vperm,
+ &B6_vec_vperm,
+ &B7_vec_vperm,
+ &B8_vec_vperm,
+ &B9_vec_vperm,
+ &B10_vec_vperm,
+ &B11_vec_vperm,
+};
+static const struct builtin *const O_vec_re[1] = {
+ &B_vec_vrefp,
+};
+static const struct builtin *const O_vec_rl[6] = {
+ &B1_vec_vrlh,
+ &B1_vec_vrlw,
+ &B1_vec_vrlb,
+ &B2_vec_vrlh,
+ &B2_vec_vrlw,
+ &B2_vec_vrlb,
+};
+static const struct builtin *const O_vec_round[1] = {
+ &B_vec_vrfin,
+};
+static const struct builtin *const O_vec_rsqrte[1] = {
+ &B_vec_vrsqrtefp,
+};
+static const struct builtin *const O_vec_sel[20] = {
+ &B1_vec_vsel,
+ &B2_vec_vsel,
+ &B3_vec_vsel,
+ &B4_vec_vsel,
+ &B5_vec_vsel,
+ &B6_vec_vsel,
+ &B7_vec_vsel,
+ &B8_vec_vsel,
+ &B9_vec_vsel,
+ &B10_vec_vsel,
+ &B11_vec_vsel,
+ &B12_vec_vsel,
+ &B13_vec_vsel,
+ &B14_vec_vsel,
+ &B15_vec_vsel,
+ &B16_vec_vsel,
+ &B17_vec_vsel,
+ &B18_vec_vsel,
+ &B19_vec_vsel,
+ &B20_vec_vsel,
+};
+static const struct builtin *const O_vec_sl[6] = {
+ &B1_vec_vslh,
+ &B1_vec_vslw,
+ &B1_vec_vslb,
+ &B2_vec_vslh,
+ &B2_vec_vslw,
+ &B2_vec_vslb,
+};
+static const struct builtin *const O_vec_sld[11] = {
+ &B1_vec_vsldoi,
+ &B2_vec_vsldoi,
+ &B3_vec_vsldoi,
+ &B4_vec_vsldoi,
+ &B5_vec_vsldoi,
+ &B6_vec_vsldoi,
+ &B7_vec_vsldoi,
+ &B8_vec_vsldoi,
+ &B9_vec_vsldoi,
+ &B10_vec_vsldoi,
+ &B11_vec_vsldoi,
+};
+static const struct builtin *const O_vec_sll[30] = {
+ &B1_vec_vsl,
+ &B2_vec_vsl,
+ &B3_vec_vsl,
+ &B4_vec_vsl,
+ &B5_vec_vsl,
+ &B6_vec_vsl,
+ &B7_vec_vsl,
+ &B8_vec_vsl,
+ &B9_vec_vsl,
+ &B10_vec_vsl,
+ &B11_vec_vsl,
+ &B12_vec_vsl,
+ &B13_vec_vsl,
+ &B14_vec_vsl,
+ &B15_vec_vsl,
+ &B16_vec_vsl,
+ &B17_vec_vsl,
+ &B18_vec_vsl,
+ &B19_vec_vsl,
+ &B20_vec_vsl,
+ &B21_vec_vsl,
+ &B22_vec_vsl,
+ &B23_vec_vsl,
+ &B24_vec_vsl,
+ &B25_vec_vsl,
+ &B26_vec_vsl,
+ &B27_vec_vsl,
+ &B28_vec_vsl,
+ &B29_vec_vsl,
+ &B30_vec_vsl,
+};
+static const struct builtin *const O_vec_slo[16] = {
+ &B1_vec_vslo,
+ &B2_vec_vslo,
+ &B3_vec_vslo,
+ &B4_vec_vslo,
+ &B5_vec_vslo,
+ &B6_vec_vslo,
+ &B7_vec_vslo,
+ &B8_vec_vslo,
+ &B9_vec_vslo,
+ &B10_vec_vslo,
+ &B11_vec_vslo,
+ &B12_vec_vslo,
+ &B13_vec_vslo,
+ &B14_vec_vslo,
+ &B15_vec_vslo,
+ &B16_vec_vslo,
+};
+static const struct builtin *const O_vec_splat[11] = {
+ &B1_vec_vsplth,
+ &B1_vec_vspltw,
+ &B1_vec_vspltb,
+ &B2_vec_vspltw,
+ &B2_vec_vsplth,
+ &B3_vec_vsplth,
+ &B3_vec_vspltw,
+ &B2_vec_vspltb,
+ &B4_vec_vsplth,
+ &B4_vec_vspltw,
+ &B3_vec_vspltb,
+};
+static const struct builtin *const O_vec_splat_s16[1] = {
+ &B_vec_vspltish,
+};
+static const struct builtin *const O_vec_splat_s32[1] = {
+ &B_vec_vspltisw,
+};
+static const struct builtin *const O_vec_splat_s8[1] = {
+ &B_vec_vspltisb,
+};
+static const struct builtin *const O_vec_splat_u16[1] = {
+ &B_vec_splat_u16,
+};
+static const struct builtin *const O_vec_splat_u32[1] = {
+ &B_vec_splat_u32,
+};
+static const struct builtin *const O_vec_splat_u8[1] = {
+ &B_vec_splat_u8,
+};
+static const struct builtin *const O_vec_sr[6] = {
+ &B1_vec_vsrh,
+ &B1_vec_vsrw,
+ &B1_vec_vsrb,
+ &B2_vec_vsrh,
+ &B2_vec_vsrw,
+ &B2_vec_vsrb,
+};
+static const struct builtin *const O_vec_sra[6] = {
+ &B1_vec_vsrah,
+ &B1_vec_vsraw,
+ &B1_vec_vsrab,
+ &B2_vec_vsrah,
+ &B2_vec_vsraw,
+ &B2_vec_vsrab,
+};
+static const struct builtin *const O_vec_srl[30] = {
+ &B1_vec_vsr,
+ &B2_vec_vsr,
+ &B3_vec_vsr,
+ &B4_vec_vsr,
+ &B5_vec_vsr,
+ &B6_vec_vsr,
+ &B7_vec_vsr,
+ &B8_vec_vsr,
+ &B9_vec_vsr,
+ &B10_vec_vsr,
+ &B11_vec_vsr,
+ &B12_vec_vsr,
+ &B13_vec_vsr,
+ &B14_vec_vsr,
+ &B15_vec_vsr,
+ &B16_vec_vsr,
+ &B17_vec_vsr,
+ &B18_vec_vsr,
+ &B19_vec_vsr,
+ &B20_vec_vsr,
+ &B21_vec_vsr,
+ &B22_vec_vsr,
+ &B23_vec_vsr,
+ &B24_vec_vsr,
+ &B25_vec_vsr,
+ &B26_vec_vsr,
+ &B27_vec_vsr,
+ &B28_vec_vsr,
+ &B29_vec_vsr,
+ &B30_vec_vsr,
+};
+static const struct builtin *const O_vec_sro[16] = {
+ &B1_vec_vsro,
+ &B2_vec_vsro,
+ &B3_vec_vsro,
+ &B4_vec_vsro,
+ &B5_vec_vsro,
+ &B6_vec_vsro,
+ &B7_vec_vsro,
+ &B8_vec_vsro,
+ &B9_vec_vsro,
+ &B10_vec_vsro,
+ &B11_vec_vsro,
+ &B12_vec_vsro,
+ &B13_vec_vsro,
+ &B14_vec_vsro,
+ &B15_vec_vsro,
+ &B16_vec_vsro,
+};
+static const struct builtin *const O_vec_st[30] = {
+ &B1_vec_stvx,
+ &B2_vec_stvx,
+ &B3_vec_stvx,
+ &B4_vec_stvx,
+ &B5_vec_stvx,
+ &B6_vec_stvx,
+ &B7_vec_stvx,
+ &B8_vec_stvx,
+ &B9_vec_stvx,
+ &B10_vec_stvx,
+ &B11_vec_stvx,
+ &B12_vec_stvx,
+ &B13_vec_stvx,
+ &B14_vec_stvx,
+ &B15_vec_stvx,
+ &B16_vec_stvx,
+ &B17_vec_stvx,
+ &B18_vec_stvx,
+ &B19_vec_stvx,
+ &B20_vec_stvx,
+ &B21_vec_stvx,
+ &B22_vec_stvx,
+ &B23_vec_stvx,
+ &B24_vec_stvx,
+ &B25_vec_stvx,
+ &B26_vec_stvx,
+ &B27_vec_stvx,
+ &B28_vec_stvx,
+ &B29_vec_stvx,
+ &B30_vec_stvx,
+};
+static const struct builtin *const O_vec_ste[19] = {
+ &B1_vec_stvebx,
+ &B2_vec_stvebx,
+ &B1_vec_stvewx,
+ &B2_vec_stvewx,
+ &B3_vec_stvewx,
+ &B4_vec_stvewx,
+ &B3_vec_stvebx,
+ &B4_vec_stvebx,
+ &B5_vec_stvewx,
+ &B1_vec_stvehx,
+ &B2_vec_stvehx,
+ &B3_vec_stvehx,
+ &B6_vec_stvewx,
+ &B7_vec_stvewx,
+ &B5_vec_stvebx,
+ &B4_vec_stvehx,
+ &B8_vec_stvewx,
+ &B9_vec_stvewx,
+ &B6_vec_stvebx,
+};
+static const struct builtin *const O_vec_stl[30] = {
+ &B1_vec_stvxl,
+ &B2_vec_stvxl,
+ &B3_vec_stvxl,
+ &B4_vec_stvxl,
+ &B5_vec_stvxl,
+ &B6_vec_stvxl,
+ &B7_vec_stvxl,
+ &B8_vec_stvxl,
+ &B9_vec_stvxl,
+ &B10_vec_stvxl,
+ &B11_vec_stvxl,
+ &B12_vec_stvxl,
+ &B13_vec_stvxl,
+ &B14_vec_stvxl,
+ &B15_vec_stvxl,
+ &B16_vec_stvxl,
+ &B17_vec_stvxl,
+ &B18_vec_stvxl,
+ &B19_vec_stvxl,
+ &B20_vec_stvxl,
+ &B21_vec_stvxl,
+ &B22_vec_stvxl,
+ &B23_vec_stvxl,
+ &B24_vec_stvxl,
+ &B25_vec_stvxl,
+ &B26_vec_stvxl,
+ &B27_vec_stvxl,
+ &B28_vec_stvxl,
+ &B29_vec_stvxl,
+ &B30_vec_stvxl,
+};
+static const struct builtin *const O_vec_stvebx[6] = {
+ &B1_vec_stvebx,
+ &B2_vec_stvebx,
+ &B3_vec_stvebx,
+ &B4_vec_stvebx,
+ &B5_vec_stvebx,
+ &B6_vec_stvebx,
+};
+static const struct builtin *const O_vec_stvehx[4] = {
+ &B1_vec_stvehx,
+ &B2_vec_stvehx,
+ &B3_vec_stvehx,
+ &B4_vec_stvehx,
+};
+static const struct builtin *const O_vec_stvewx[9] = {
+ &B1_vec_stvewx,
+ &B2_vec_stvewx,
+ &B3_vec_stvewx,
+ &B4_vec_stvewx,
+ &B5_vec_stvewx,
+ &B6_vec_stvewx,
+ &B7_vec_stvewx,
+ &B8_vec_stvewx,
+ &B9_vec_stvewx,
+};
+static const struct builtin *const O_vec_stvx[30] = {
+ &B1_vec_stvx,
+ &B2_vec_stvx,
+ &B3_vec_stvx,
+ &B4_vec_stvx,
+ &B5_vec_stvx,
+ &B6_vec_stvx,
+ &B7_vec_stvx,
+ &B8_vec_stvx,
+ &B9_vec_stvx,
+ &B10_vec_stvx,
+ &B11_vec_stvx,
+ &B12_vec_stvx,
+ &B13_vec_stvx,
+ &B14_vec_stvx,
+ &B15_vec_stvx,
+ &B16_vec_stvx,
+ &B17_vec_stvx,
+ &B18_vec_stvx,
+ &B19_vec_stvx,
+ &B20_vec_stvx,
+ &B21_vec_stvx,
+ &B22_vec_stvx,
+ &B23_vec_stvx,
+ &B24_vec_stvx,
+ &B25_vec_stvx,
+ &B26_vec_stvx,
+ &B27_vec_stvx,
+ &B28_vec_stvx,
+ &B29_vec_stvx,
+ &B30_vec_stvx,
+};
+static const struct builtin *const O_vec_stvxl[30] = {
+ &B1_vec_stvxl,
+ &B2_vec_stvxl,
+ &B3_vec_stvxl,
+ &B4_vec_stvxl,
+ &B5_vec_stvxl,
+ &B6_vec_stvxl,
+ &B7_vec_stvxl,
+ &B8_vec_stvxl,
+ &B9_vec_stvxl,
+ &B10_vec_stvxl,
+ &B11_vec_stvxl,
+ &B12_vec_stvxl,
+ &B13_vec_stvxl,
+ &B14_vec_stvxl,
+ &B15_vec_stvxl,
+ &B16_vec_stvxl,
+ &B17_vec_stvxl,
+ &B18_vec_stvxl,
+ &B19_vec_stvxl,
+ &B20_vec_stvxl,
+ &B21_vec_stvxl,
+ &B22_vec_stvxl,
+ &B23_vec_stvxl,
+ &B24_vec_stvxl,
+ &B25_vec_stvxl,
+ &B26_vec_stvxl,
+ &B27_vec_stvxl,
+ &B28_vec_stvxl,
+ &B29_vec_stvxl,
+ &B30_vec_stvxl,
+};
+static const struct builtin *const O_vec_sub[19] = {
+ &B1_vec_vsubuhm,
+ &B2_vec_vsubuhm,
+ &B1_vec_vsubuwm,
+ &B2_vec_vsubuwm,
+ &B1_vec_vsububm,
+ &B2_vec_vsububm,
+ &B_vec_vsubfp,
+ &B3_vec_vsubuhm,
+ &B4_vec_vsubuhm,
+ &B3_vec_vsubuwm,
+ &B4_vec_vsubuwm,
+ &B3_vec_vsububm,
+ &B4_vec_vsububm,
+ &B5_vec_vsubuhm,
+ &B6_vec_vsubuhm,
+ &B5_vec_vsubuwm,
+ &B6_vec_vsubuwm,
+ &B5_vec_vsububm,
+ &B6_vec_vsububm,
+};
+static const struct builtin *const O_vec_subc[1] = {
+ &B_vec_vsubcuw,
+};
+static const struct builtin *const O_vec_subs[18] = {
+ &B1_vec_vsubshs,
+ &B1_vec_vsubuhs,
+ &B1_vec_vsubsws,
+ &B1_vec_vsubuws,
+ &B1_vec_vsubsbs,
+ &B1_vec_vsububs,
+ &B2_vec_vsubshs,
+ &B3_vec_vsubshs,
+ &B2_vec_vsubsws,
+ &B3_vec_vsubsws,
+ &B2_vec_vsubsbs,
+ &B3_vec_vsubsbs,
+ &B2_vec_vsubuhs,
+ &B3_vec_vsubuhs,
+ &B2_vec_vsubuws,
+ &B3_vec_vsubuws,
+ &B2_vec_vsububs,
+ &B3_vec_vsububs,
+};
+static const struct builtin *const O_vec_sum2s[1] = {
+ &B_vec_vsum2sws,
+};
+static const struct builtin *const O_vec_sum4s[3] = {
+ &B_vec_vsum4shs,
+ &B_vec_vsum4sbs,
+ &B_vec_vsum4ubs,
+};
+static const struct builtin *const O_vec_sums[1] = {
+ &B_vec_vsumsws,
+};
+static const struct builtin *const O_vec_trunc[1] = {
+ &B_vec_vrfiz,
+};
+static const struct builtin *const O_vec_unpack2sh[2] = {
+ &B1_vec_unpack2sh,
+ &B2_vec_unpack2sh,
+};
+static const struct builtin *const O_vec_unpack2sl[2] = {
+ &B1_vec_unpack2sl,
+ &B2_vec_unpack2sl,
+};
+static const struct builtin *const O_vec_unpack2uh[2] = {
+ &B1_vec_unpack2uh,
+ &B2_vec_unpack2uh,
+};
+static const struct builtin *const O_vec_unpack2ul[2] = {
+ &B1_vec_unpack2ul,
+ &B2_vec_unpack2ul,
+};
+static const struct builtin *const O_vec_unpackh[5] = {
+ &B1_vec_vupkhsh,
+ &B1_vec_vupkhsb,
+ &B_vec_vupkhpx,
+ &B2_vec_vupkhsh,
+ &B2_vec_vupkhsb,
+};
+static const struct builtin *const O_vec_unpackl[5] = {
+ &B1_vec_vupklsh,
+ &B1_vec_vupklsb,
+ &B_vec_vupklpx,
+ &B2_vec_vupklsh,
+ &B2_vec_vupklsb,
+};
+static const struct builtin *const O_vec_vaddcuw[1] = {
+ &B_vec_vaddcuw,
+};
+static const struct builtin *const O_vec_vaddfp[1] = {
+ &B_vec_vaddfp,
+};
+static const struct builtin *const O_vec_vaddsbs[3] = {
+ &B1_vec_vaddsbs,
+ &B2_vec_vaddsbs,
+ &B3_vec_vaddsbs,
+};
+static const struct builtin *const O_vec_vaddshs[3] = {
+ &B1_vec_vaddshs,
+ &B2_vec_vaddshs,
+ &B3_vec_vaddshs,
+};
+static const struct builtin *const O_vec_vaddsws[3] = {
+ &B1_vec_vaddsws,
+ &B2_vec_vaddsws,
+ &B3_vec_vaddsws,
+};
+static const struct builtin *const O_vec_vaddubm[6] = {
+ &B1_vec_vaddubm,
+ &B2_vec_vaddubm,
+ &B3_vec_vaddubm,
+ &B4_vec_vaddubm,
+ &B5_vec_vaddubm,
+ &B6_vec_vaddubm,
+};
+static const struct builtin *const O_vec_vaddubs[3] = {
+ &B1_vec_vaddubs,
+ &B2_vec_vaddubs,
+ &B3_vec_vaddubs,
+};
+static const struct builtin *const O_vec_vadduhm[6] = {
+ &B1_vec_vadduhm,
+ &B2_vec_vadduhm,
+ &B3_vec_vadduhm,
+ &B4_vec_vadduhm,
+ &B5_vec_vadduhm,
+ &B6_vec_vadduhm,
+};
+static const struct builtin *const O_vec_vadduhs[3] = {
+ &B1_vec_vadduhs,
+ &B2_vec_vadduhs,
+ &B3_vec_vadduhs,
+};
+static const struct builtin *const O_vec_vadduwm[6] = {
+ &B1_vec_vadduwm,
+ &B2_vec_vadduwm,
+ &B3_vec_vadduwm,
+ &B4_vec_vadduwm,
+ &B5_vec_vadduwm,
+ &B6_vec_vadduwm,
+};
+static const struct builtin *const O_vec_vadduws[3] = {
+ &B1_vec_vadduws,
+ &B2_vec_vadduws,
+ &B3_vec_vadduws,
+};
+static const struct builtin *const O_vec_vand[24] = {
+ &B1_vec_vand,
+ &B2_vec_vand,
+ &B3_vec_vand,
+ &B4_vec_vand,
+ &B5_vec_vand,
+ &B6_vec_vand,
+ &B7_vec_vand,
+ &B8_vec_vand,
+ &B9_vec_vand,
+ &B10_vec_vand,
+ &B11_vec_vand,
+ &B12_vec_vand,
+ &B13_vec_vand,
+ &B14_vec_vand,
+ &B15_vec_vand,
+ &B16_vec_vand,
+ &B17_vec_vand,
+ &B18_vec_vand,
+ &B19_vec_vand,
+ &B20_vec_vand,
+ &B21_vec_vand,
+ &B22_vec_vand,
+ &B23_vec_vand,
+ &B24_vec_vand,
+};
+static const struct builtin *const O_vec_vandc[24] = {
+ &B1_vec_vandc,
+ &B2_vec_vandc,
+ &B3_vec_vandc,
+ &B4_vec_vandc,
+ &B5_vec_vandc,
+ &B6_vec_vandc,
+ &B7_vec_vandc,
+ &B8_vec_vandc,
+ &B9_vec_vandc,
+ &B10_vec_vandc,
+ &B11_vec_vandc,
+ &B12_vec_vandc,
+ &B13_vec_vandc,
+ &B14_vec_vandc,
+ &B15_vec_vandc,
+ &B16_vec_vandc,
+ &B17_vec_vandc,
+ &B18_vec_vandc,
+ &B19_vec_vandc,
+ &B20_vec_vandc,
+ &B21_vec_vandc,
+ &B22_vec_vandc,
+ &B23_vec_vandc,
+ &B24_vec_vandc,
+};
+static const struct builtin *const O_vec_vavgsb[1] = {
+ &B_vec_vavgsb,
+};
+static const struct builtin *const O_vec_vavgsh[1] = {
+ &B_vec_vavgsh,
+};
+static const struct builtin *const O_vec_vavgsw[1] = {
+ &B_vec_vavgsw,
+};
+static const struct builtin *const O_vec_vavgub[1] = {
+ &B_vec_vavgub,
+};
+static const struct builtin *const O_vec_vavguh[1] = {
+ &B_vec_vavguh,
+};
+static const struct builtin *const O_vec_vavguw[1] = {
+ &B_vec_vavguw,
+};
+static const struct builtin *const O_vec_vcfsx[1] = {
+ &B_vec_vcfsx,
+};
+static const struct builtin *const O_vec_vcfux[1] = {
+ &B_vec_vcfux,
+};
+static const struct builtin *const O_vec_vcmpbfp[1] = {
+ &B_vec_vcmpbfp,
+};
+static const struct builtin *const O_vec_vcmpeqfp[1] = {
+ &B_vec_vcmpeqfp,
+};
+static const struct builtin *const O_vec_vcmpequb[2] = {
+ &B1_vec_vcmpequb,
+ &B2_vec_vcmpequb,
+};
+static const struct builtin *const O_vec_vcmpequh[2] = {
+ &B1_vec_vcmpequh,
+ &B2_vec_vcmpequh,
+};
+static const struct builtin *const O_vec_vcmpequw[2] = {
+ &B1_vec_vcmpequw,
+ &B2_vec_vcmpequw,
+};
+static const struct builtin *const O_vec_vcmpgefp[1] = {
+ &B_vec_vcmpgefp,
+};
+static const struct builtin *const O_vec_vcmpgtfp[1] = {
+ &B_vec_vcmpgtfp,
+};
+static const struct builtin *const O_vec_vcmpgtsb[1] = {
+ &B_vec_vcmpgtsb,
+};
+static const struct builtin *const O_vec_vcmpgtsh[1] = {
+ &B_vec_vcmpgtsh,
+};
+static const struct builtin *const O_vec_vcmpgtsw[1] = {
+ &B_vec_vcmpgtsw,
+};
+static const struct builtin *const O_vec_vcmpgtub[1] = {
+ &B_vec_vcmpgtub,
+};
+static const struct builtin *const O_vec_vcmpgtuh[1] = {
+ &B_vec_vcmpgtuh,
+};
+static const struct builtin *const O_vec_vcmpgtuw[1] = {
+ &B_vec_vcmpgtuw,
+};
+static const struct builtin *const O_vec_vctsxs[1] = {
+ &B_vec_vctsxs,
+};
+static const struct builtin *const O_vec_vctuxs[1] = {
+ &B_vec_vctuxs,
+};
+static const struct builtin *const O_vec_vexptefp[1] = {
+ &B_vec_vexptefp,
+};
+static const struct builtin *const O_vec_vlogefp[1] = {
+ &B_vec_vlogefp,
+};
+static const struct builtin *const O_vec_vmaddfp[1] = {
+ &B_vec_vmaddfp,
+};
+static const struct builtin *const O_vec_vmaxfp[1] = {
+ &B_vec_vmaxfp,
+};
+static const struct builtin *const O_vec_vmaxsb[3] = {
+ &B1_vec_vmaxsb,
+ &B2_vec_vmaxsb,
+ &B3_vec_vmaxsb,
+};
+static const struct builtin *const O_vec_vmaxsh[3] = {
+ &B1_vec_vmaxsh,
+ &B2_vec_vmaxsh,
+ &B3_vec_vmaxsh,
+};
+static const struct builtin *const O_vec_vmaxsw[3] = {
+ &B1_vec_vmaxsw,
+ &B2_vec_vmaxsw,
+ &B3_vec_vmaxsw,
+};
+static const struct builtin *const O_vec_vmaxub[3] = {
+ &B1_vec_vmaxub,
+ &B2_vec_vmaxub,
+ &B3_vec_vmaxub,
+};
+static const struct builtin *const O_vec_vmaxuh[3] = {
+ &B1_vec_vmaxuh,
+ &B2_vec_vmaxuh,
+ &B3_vec_vmaxuh,
+};
+static const struct builtin *const O_vec_vmaxuw[3] = {
+ &B1_vec_vmaxuw,
+ &B2_vec_vmaxuw,
+ &B3_vec_vmaxuw,
+};
+static const struct builtin *const O_vec_vmhaddshs[1] = {
+ &B_vec_vmhaddshs,
+};
+static const struct builtin *const O_vec_vmhraddshs[1] = {
+ &B_vec_vmhraddshs,
+};
+static const struct builtin *const O_vec_vminfp[1] = {
+ &B_vec_vminfp,
+};
+static const struct builtin *const O_vec_vminsb[3] = {
+ &B1_vec_vminsb,
+ &B2_vec_vminsb,
+ &B3_vec_vminsb,
+};
+static const struct builtin *const O_vec_vminsh[3] = {
+ &B1_vec_vminsh,
+ &B2_vec_vminsh,
+ &B3_vec_vminsh,
+};
+static const struct builtin *const O_vec_vminsw[3] = {
+ &B1_vec_vminsw,
+ &B2_vec_vminsw,
+ &B3_vec_vminsw,
+};
+static const struct builtin *const O_vec_vminub[3] = {
+ &B1_vec_vminub,
+ &B2_vec_vminub,
+ &B3_vec_vminub,
+};
+static const struct builtin *const O_vec_vminuh[3] = {
+ &B1_vec_vminuh,
+ &B2_vec_vminuh,
+ &B3_vec_vminuh,
+};
+static const struct builtin *const O_vec_vminuw[3] = {
+ &B1_vec_vminuw,
+ &B2_vec_vminuw,
+ &B3_vec_vminuw,
+};
+static const struct builtin *const O_vec_vmladduhm[4] = {
+ &B1_vec_vmladduhm,
+ &B2_vec_vmladduhm,
+ &B3_vec_vmladduhm,
+ &B4_vec_vmladduhm,
+};
+static const struct builtin *const O_vec_vmrghb[3] = {
+ &B1_vec_vmrghb,
+ &B2_vec_vmrghb,
+ &B3_vec_vmrghb,
+};
+static const struct builtin *const O_vec_vmrghh[4] = {
+ &B1_vec_vmrghh,
+ &B2_vec_vmrghh,
+ &B3_vec_vmrghh,
+ &B4_vec_vmrghh,
+};
+static const struct builtin *const O_vec_vmrghw[4] = {
+ &B1_vec_vmrghw,
+ &B2_vec_vmrghw,
+ &B3_vec_vmrghw,
+ &B4_vec_vmrghw,
+};
+static const struct builtin *const O_vec_vmrglb[3] = {
+ &B1_vec_vmrglb,
+ &B2_vec_vmrglb,
+ &B3_vec_vmrglb,
+};
+static const struct builtin *const O_vec_vmrglh[4] = {
+ &B1_vec_vmrglh,
+ &B2_vec_vmrglh,
+ &B3_vec_vmrglh,
+ &B4_vec_vmrglh,
+};
+static const struct builtin *const O_vec_vmrglw[4] = {
+ &B1_vec_vmrglw,
+ &B2_vec_vmrglw,
+ &B3_vec_vmrglw,
+ &B4_vec_vmrglw,
+};
+static const struct builtin *const O_vec_vmsummbm[1] = {
+ &B_vec_vmsummbm,
+};
+static const struct builtin *const O_vec_vmsumshm[1] = {
+ &B_vec_vmsumshm,
+};
+static const struct builtin *const O_vec_vmsumshs[1] = {
+ &B_vec_vmsumshs,
+};
+static const struct builtin *const O_vec_vmsumubm[1] = {
+ &B_vec_vmsumubm,
+};
+static const struct builtin *const O_vec_vmsumuhm[1] = {
+ &B_vec_vmsumuhm,
+};
+static const struct builtin *const O_vec_vmsumuhs[1] = {
+ &B_vec_vmsumuhs,
+};
+static const struct builtin *const O_vec_vmulesb[1] = {
+ &B_vec_vmulesb,
+};
+static const struct builtin *const O_vec_vmulesh[1] = {
+ &B_vec_vmulesh,
+};
+static const struct builtin *const O_vec_vmuleub[1] = {
+ &B_vec_vmuleub,
+};
+static const struct builtin *const O_vec_vmuleuh[1] = {
+ &B_vec_vmuleuh,
+};
+static const struct builtin *const O_vec_vmulosb[1] = {
+ &B_vec_vmulosb,
+};
+static const struct builtin *const O_vec_vmulosh[1] = {
+ &B_vec_vmulosh,
+};
+static const struct builtin *const O_vec_vmuloub[1] = {
+ &B_vec_vmuloub,
+};
+static const struct builtin *const O_vec_vmulouh[1] = {
+ &B_vec_vmulouh,
+};
+static const struct builtin *const O_vec_vnmsubfp[1] = {
+ &B_vec_vnmsubfp,
+};
+static const struct builtin *const O_vec_vnor[10] = {
+ &B1_vec_vnor,
+ &B2_vec_vnor,
+ &B3_vec_vnor,
+ &B4_vec_vnor,
+ &B5_vec_vnor,
+ &B6_vec_vnor,
+ &B7_vec_vnor,
+ &B8_vec_vnor,
+ &B9_vec_vnor,
+ &B10_vec_vnor,
+};
+static const struct builtin *const O_vec_vor[24] = {
+ &B1_vec_vor,
+ &B2_vec_vor,
+ &B3_vec_vor,
+ &B4_vec_vor,
+ &B5_vec_vor,
+ &B6_vec_vor,
+ &B7_vec_vor,
+ &B8_vec_vor,
+ &B9_vec_vor,
+ &B10_vec_vor,
+ &B11_vec_vor,
+ &B12_vec_vor,
+ &B13_vec_vor,
+ &B14_vec_vor,
+ &B15_vec_vor,
+ &B16_vec_vor,
+ &B17_vec_vor,
+ &B18_vec_vor,
+ &B19_vec_vor,
+ &B20_vec_vor,
+ &B21_vec_vor,
+ &B22_vec_vor,
+ &B23_vec_vor,
+ &B24_vec_vor,
+};
+static const struct builtin *const O_vec_vperm[11] = {
+ &B1_vec_vperm,
+ &B2_vec_vperm,
+ &B3_vec_vperm,
+ &B4_vec_vperm,
+ &B5_vec_vperm,
+ &B6_vec_vperm,
+ &B7_vec_vperm,
+ &B8_vec_vperm,
+ &B9_vec_vperm,
+ &B10_vec_vperm,
+ &B11_vec_vperm,
+};
+static const struct builtin *const O_vec_vpkpx[1] = {
+ &B_vec_vpkpx,
+};
+static const struct builtin *const O_vec_vpkshss[1] = {
+ &B_vec_vpkshss,
+};
+static const struct builtin *const O_vec_vpkshus[1] = {
+ &B_vec_vpkshus,
+};
+static const struct builtin *const O_vec_vpkswss[1] = {
+ &B_vec_vpkswss,
+};
+static const struct builtin *const O_vec_vpkswus[1] = {
+ &B_vec_vpkswus,
+};
+static const struct builtin *const O_vec_vpkuhum[3] = {
+ &B1_vec_vpkuhum,
+ &B2_vec_vpkuhum,
+ &B3_vec_vpkuhum,
+};
+static const struct builtin *const O_vec_vpkuhus[1] = {
+ &B_vec_vpkuhus,
+};
+static const struct builtin *const O_vec_vpkuwum[3] = {
+ &B1_vec_vpkuwum,
+ &B2_vec_vpkuwum,
+ &B3_vec_vpkuwum,
+};
+static const struct builtin *const O_vec_vpkuwus[1] = {
+ &B_vec_vpkuwus,
+};
+static const struct builtin *const O_vec_vrefp[1] = {
+ &B_vec_vrefp,
+};
+static const struct builtin *const O_vec_vrfim[1] = {
+ &B_vec_vrfim,
+};
+static const struct builtin *const O_vec_vrfin[1] = {
+ &B_vec_vrfin,
+};
+static const struct builtin *const O_vec_vrfip[1] = {
+ &B_vec_vrfip,
+};
+static const struct builtin *const O_vec_vrfiz[1] = {
+ &B_vec_vrfiz,
+};
+static const struct builtin *const O_vec_vrlb[2] = {
+ &B1_vec_vrlb,
+ &B2_vec_vrlb,
+};
+static const struct builtin *const O_vec_vrlh[2] = {
+ &B1_vec_vrlh,
+ &B2_vec_vrlh,
+};
+static const struct builtin *const O_vec_vrlw[2] = {
+ &B1_vec_vrlw,
+ &B2_vec_vrlw,
+};
+static const struct builtin *const O_vec_vrsqrtefp[1] = {
+ &B_vec_vrsqrtefp,
+};
+static const struct builtin *const O_vec_vsel[20] = {
+ &B1_vec_vsel,
+ &B2_vec_vsel,
+ &B3_vec_vsel,
+ &B4_vec_vsel,
+ &B5_vec_vsel,
+ &B6_vec_vsel,
+ &B7_vec_vsel,
+ &B8_vec_vsel,
+ &B9_vec_vsel,
+ &B10_vec_vsel,
+ &B11_vec_vsel,
+ &B12_vec_vsel,
+ &B13_vec_vsel,
+ &B14_vec_vsel,
+ &B15_vec_vsel,
+ &B16_vec_vsel,
+ &B17_vec_vsel,
+ &B18_vec_vsel,
+ &B19_vec_vsel,
+ &B20_vec_vsel,
+};
+static const struct builtin *const O_vec_vsl[30] = {
+ &B1_vec_vsl,
+ &B2_vec_vsl,
+ &B3_vec_vsl,
+ &B4_vec_vsl,
+ &B5_vec_vsl,
+ &B6_vec_vsl,
+ &B7_vec_vsl,
+ &B8_vec_vsl,
+ &B9_vec_vsl,
+ &B10_vec_vsl,
+ &B11_vec_vsl,
+ &B12_vec_vsl,
+ &B13_vec_vsl,
+ &B14_vec_vsl,
+ &B15_vec_vsl,
+ &B16_vec_vsl,
+ &B17_vec_vsl,
+ &B18_vec_vsl,
+ &B19_vec_vsl,
+ &B20_vec_vsl,
+ &B21_vec_vsl,
+ &B22_vec_vsl,
+ &B23_vec_vsl,
+ &B24_vec_vsl,
+ &B25_vec_vsl,
+ &B26_vec_vsl,
+ &B27_vec_vsl,
+ &B28_vec_vsl,
+ &B29_vec_vsl,
+ &B30_vec_vsl,
+};
+static const struct builtin *const O_vec_vslb[2] = {
+ &B1_vec_vslb,
+ &B2_vec_vslb,
+};
+static const struct builtin *const O_vec_vsldoi[11] = {
+ &B1_vec_vsldoi,
+ &B2_vec_vsldoi,
+ &B3_vec_vsldoi,
+ &B4_vec_vsldoi,
+ &B5_vec_vsldoi,
+ &B6_vec_vsldoi,
+ &B7_vec_vsldoi,
+ &B8_vec_vsldoi,
+ &B9_vec_vsldoi,
+ &B10_vec_vsldoi,
+ &B11_vec_vsldoi,
+};
+static const struct builtin *const O_vec_vslh[2] = {
+ &B1_vec_vslh,
+ &B2_vec_vslh,
+};
+static const struct builtin *const O_vec_vslo[16] = {
+ &B1_vec_vslo,
+ &B2_vec_vslo,
+ &B3_vec_vslo,
+ &B4_vec_vslo,
+ &B5_vec_vslo,
+ &B6_vec_vslo,
+ &B7_vec_vslo,
+ &B8_vec_vslo,
+ &B9_vec_vslo,
+ &B10_vec_vslo,
+ &B11_vec_vslo,
+ &B12_vec_vslo,
+ &B13_vec_vslo,
+ &B14_vec_vslo,
+ &B15_vec_vslo,
+ &B16_vec_vslo,
+};
+static const struct builtin *const O_vec_vslw[2] = {
+ &B1_vec_vslw,
+ &B2_vec_vslw,
+};
+static const struct builtin *const O_vec_vspltb[3] = {
+ &B1_vec_vspltb,
+ &B2_vec_vspltb,
+ &B3_vec_vspltb,
+};
+static const struct builtin *const O_vec_vsplth[4] = {
+ &B1_vec_vsplth,
+ &B2_vec_vsplth,
+ &B3_vec_vsplth,
+ &B4_vec_vsplth,
+};
+static const struct builtin *const O_vec_vspltisb[1] = {
+ &B_vec_vspltisb,
+};
+static const struct builtin *const O_vec_vspltish[1] = {
+ &B_vec_vspltish,
+};
+static const struct builtin *const O_vec_vspltisw[1] = {
+ &B_vec_vspltisw,
+};
+static const struct builtin *const O_vec_vspltw[4] = {
+ &B1_vec_vspltw,
+ &B2_vec_vspltw,
+ &B3_vec_vspltw,
+ &B4_vec_vspltw,
+};
+static const struct builtin *const O_vec_vsr[30] = {
+ &B1_vec_vsr,
+ &B2_vec_vsr,
+ &B3_vec_vsr,
+ &B4_vec_vsr,
+ &B5_vec_vsr,
+ &B6_vec_vsr,
+ &B7_vec_vsr,
+ &B8_vec_vsr,
+ &B9_vec_vsr,
+ &B10_vec_vsr,
+ &B11_vec_vsr,
+ &B12_vec_vsr,
+ &B13_vec_vsr,
+ &B14_vec_vsr,
+ &B15_vec_vsr,
+ &B16_vec_vsr,
+ &B17_vec_vsr,
+ &B18_vec_vsr,
+ &B19_vec_vsr,
+ &B20_vec_vsr,
+ &B21_vec_vsr,
+ &B22_vec_vsr,
+ &B23_vec_vsr,
+ &B24_vec_vsr,
+ &B25_vec_vsr,
+ &B26_vec_vsr,
+ &B27_vec_vsr,
+ &B28_vec_vsr,
+ &B29_vec_vsr,
+ &B30_vec_vsr,
+};
+static const struct builtin *const O_vec_vsrab[2] = {
+ &B1_vec_vsrab,
+ &B2_vec_vsrab,
+};
+static const struct builtin *const O_vec_vsrah[2] = {
+ &B1_vec_vsrah,
+ &B2_vec_vsrah,
+};
+static const struct builtin *const O_vec_vsraw[2] = {
+ &B1_vec_vsraw,
+ &B2_vec_vsraw,
+};
+static const struct builtin *const O_vec_vsrb[2] = {
+ &B1_vec_vsrb,
+ &B2_vec_vsrb,
+};
+static const struct builtin *const O_vec_vsrh[2] = {
+ &B1_vec_vsrh,
+ &B2_vec_vsrh,
+};
+static const struct builtin *const O_vec_vsro[16] = {
+ &B1_vec_vsro,
+ &B2_vec_vsro,
+ &B3_vec_vsro,
+ &B4_vec_vsro,
+ &B5_vec_vsro,
+ &B6_vec_vsro,
+ &B7_vec_vsro,
+ &B8_vec_vsro,
+ &B9_vec_vsro,
+ &B10_vec_vsro,
+ &B11_vec_vsro,
+ &B12_vec_vsro,
+ &B13_vec_vsro,
+ &B14_vec_vsro,
+ &B15_vec_vsro,
+ &B16_vec_vsro,
+};
+static const struct builtin *const O_vec_vsrw[2] = {
+ &B1_vec_vsrw,
+ &B2_vec_vsrw,
+};
+static const struct builtin *const O_vec_vsubcuw[1] = {
+ &B_vec_vsubcuw,
+};
+static const struct builtin *const O_vec_vsubfp[1] = {
+ &B_vec_vsubfp,
+};
+static const struct builtin *const O_vec_vsubsbs[3] = {
+ &B1_vec_vsubsbs,
+ &B2_vec_vsubsbs,
+ &B3_vec_vsubsbs,
+};
+static const struct builtin *const O_vec_vsubshs[3] = {
+ &B1_vec_vsubshs,
+ &B2_vec_vsubshs,
+ &B3_vec_vsubshs,
+};
+static const struct builtin *const O_vec_vsubsws[3] = {
+ &B1_vec_vsubsws,
+ &B2_vec_vsubsws,
+ &B3_vec_vsubsws,
+};
+static const struct builtin *const O_vec_vsububm[6] = {
+ &B1_vec_vsububm,
+ &B2_vec_vsububm,
+ &B3_vec_vsububm,
+ &B4_vec_vsububm,
+ &B5_vec_vsububm,
+ &B6_vec_vsububm,
+};
+static const struct builtin *const O_vec_vsububs[3] = {
+ &B1_vec_vsububs,
+ &B2_vec_vsububs,
+ &B3_vec_vsububs,
+};
+static const struct builtin *const O_vec_vsubuhm[6] = {
+ &B1_vec_vsubuhm,
+ &B2_vec_vsubuhm,
+ &B3_vec_vsubuhm,
+ &B4_vec_vsubuhm,
+ &B5_vec_vsubuhm,
+ &B6_vec_vsubuhm,
+};
+static const struct builtin *const O_vec_vsubuhs[3] = {
+ &B1_vec_vsubuhs,
+ &B2_vec_vsubuhs,
+ &B3_vec_vsubuhs,
+};
+static const struct builtin *const O_vec_vsubuwm[6] = {
+ &B1_vec_vsubuwm,
+ &B2_vec_vsubuwm,
+ &B3_vec_vsubuwm,
+ &B4_vec_vsubuwm,
+ &B5_vec_vsubuwm,
+ &B6_vec_vsubuwm,
+};
+static const struct builtin *const O_vec_vsubuws[3] = {
+ &B1_vec_vsubuws,
+ &B2_vec_vsubuws,
+ &B3_vec_vsubuws,
+};
+static const struct builtin *const O_vec_vsum2sws[1] = {
+ &B_vec_vsum2sws,
+};
+static const struct builtin *const O_vec_vsum4sbs[1] = {
+ &B_vec_vsum4sbs,
+};
+static const struct builtin *const O_vec_vsum4shs[1] = {
+ &B_vec_vsum4shs,
+};
+static const struct builtin *const O_vec_vsum4ubs[1] = {
+ &B_vec_vsum4ubs,
+};
+static const struct builtin *const O_vec_vsumsws[1] = {
+ &B_vec_vsumsws,
+};
+static const struct builtin *const O_vec_vupkhpx[1] = {
+ &B_vec_vupkhpx,
+};
+static const struct builtin *const O_vec_vupkhsb[2] = {
+ &B1_vec_vupkhsb,
+ &B2_vec_vupkhsb,
+};
+static const struct builtin *const O_vec_vupkhsh[2] = {
+ &B1_vec_vupkhsh,
+ &B2_vec_vupkhsh,
+};
+static const struct builtin *const O_vec_vupklpx[1] = {
+ &B_vec_vupklpx,
+};
+static const struct builtin *const O_vec_vupklsb[2] = {
+ &B1_vec_vupklsb,
+ &B2_vec_vupklsb,
+};
+static const struct builtin *const O_vec_vupklsh[2] = {
+ &B1_vec_vupklsh,
+ &B2_vec_vupklsh,
+};
+static const struct builtin *const O_vec_vxor[24] = {
+ &B1_vec_vxor,
+ &B2_vec_vxor,
+ &B3_vec_vxor,
+ &B4_vec_vxor,
+ &B5_vec_vxor,
+ &B6_vec_vxor,
+ &B7_vec_vxor,
+ &B8_vec_vxor,
+ &B9_vec_vxor,
+ &B10_vec_vxor,
+ &B11_vec_vxor,
+ &B12_vec_vxor,
+ &B13_vec_vxor,
+ &B14_vec_vxor,
+ &B15_vec_vxor,
+ &B16_vec_vxor,
+ &B17_vec_vxor,
+ &B18_vec_vxor,
+ &B19_vec_vxor,
+ &B20_vec_vxor,
+ &B21_vec_vxor,
+ &B22_vec_vxor,
+ &B23_vec_vxor,
+ &B24_vec_vxor,
+};
+static const struct builtin *const O_vec_xor[24] = {
+ &B1_vec_vxor,
+ &B2_vec_vxor,
+ &B3_vec_vxor,
+ &B4_vec_vxor,
+ &B5_vec_vxor,
+ &B6_vec_vxor,
+ &B7_vec_vxor,
+ &B8_vec_vxor,
+ &B9_vec_vxor,
+ &B10_vec_vxor,
+ &B11_vec_vxor,
+ &B12_vec_vxor,
+ &B13_vec_vxor,
+ &B14_vec_vxor,
+ &B15_vec_vxor,
+ &B16_vec_vxor,
+ &B17_vec_vxor,
+ &B18_vec_vxor,
+ &B19_vec_vxor,
+ &B20_vec_vxor,
+ &B21_vec_vxor,
+ &B22_vec_vxor,
+ &B23_vec_vxor,
+ &B24_vec_vxor,
+};
+
+const struct overloadx Overload[] = {
+ { "vec_abs", 4, 1, O_vec_abs, O_UID(0) },
+ { "vec_abss", 3, 1, O_vec_abss, O_UID(1) },
+ { "vec_add", 19, 2, O_vec_add, O_UID(2) },
+ { "vec_addc", 1, 2, O_vec_addc, O_UID(3) },
+ { "vec_adds", 18, 2, O_vec_adds, O_UID(4) },
+ { "vec_all_eq", 23, 2, O_vec_all_eq, O_UID(5) },
+ { "vec_all_ge", 19, 2, O_vec_all_ge, O_UID(6) },
+ { "vec_all_gt", 19, 2, O_vec_all_gt, O_UID(7) },
+ { "vec_all_in", 1, 2, O_vec_all_in, O_UID(8) },
+ { "vec_all_le", 19, 2, O_vec_all_le, O_UID(9) },
+ { "vec_all_lt", 19, 2, O_vec_all_lt, O_UID(10) },
+ { "vec_all_nan", 1, 1, O_vec_all_nan, O_UID(11) },
+ { "vec_all_ne", 23, 2, O_vec_all_ne, O_UID(12) },
+ { "vec_all_nge", 1, 2, O_vec_all_nge, O_UID(13) },
+ { "vec_all_ngt", 1, 2, O_vec_all_ngt, O_UID(14) },
+ { "vec_all_nle", 1, 2, O_vec_all_nle, O_UID(15) },
+ { "vec_all_nlt", 1, 2, O_vec_all_nlt, O_UID(16) },
+ { "vec_all_numeric", 1, 1, O_vec_all_numeric, O_UID(17) },
+ { "vec_and", 24, 2, O_vec_and, O_UID(18) },
+ { "vec_andc", 24, 2, O_vec_andc, O_UID(19) },
+ { "vec_any_eq", 23, 2, O_vec_any_eq, O_UID(20) },
+ { "vec_any_ge", 19, 2, O_vec_any_ge, O_UID(21) },
+ { "vec_any_gt", 19, 2, O_vec_any_gt, O_UID(22) },
+ { "vec_any_le", 19, 2, O_vec_any_le, O_UID(23) },
+ { "vec_any_lt", 19, 2, O_vec_any_lt, O_UID(24) },
+ { "vec_any_nan", 1, 1, O_vec_any_nan, O_UID(25) },
+ { "vec_any_ne", 23, 2, O_vec_any_ne, O_UID(26) },
+ { "vec_any_nge", 1, 2, O_vec_any_nge, O_UID(27) },
+ { "vec_any_ngt", 1, 2, O_vec_any_ngt, O_UID(28) },
+ { "vec_any_nle", 1, 2, O_vec_any_nle, O_UID(29) },
+ { "vec_any_nlt", 1, 2, O_vec_any_nlt, O_UID(30) },
+ { "vec_any_numeric", 1, 1, O_vec_any_numeric, O_UID(31) },
+ { "vec_any_out", 1, 2, O_vec_any_out, O_UID(32) },
+ { "vec_avg", 6, 2, O_vec_avg, O_UID(33) },
+ { "vec_ceil", 1, 1, O_vec_ceil, O_UID(34) },
+ { "vec_cmpb", 1, 2, O_vec_cmpb, O_UID(35) },
+ { "vec_cmpeq", 7, 2, O_vec_cmpeq, O_UID(36) },
+ { "vec_cmpge", 1, 2, O_vec_cmpge, O_UID(37) },
+ { "vec_cmpgt", 7, 2, O_vec_cmpgt, O_UID(38) },
+ { "vec_cmple", 1, 2, O_vec_cmple, O_UID(39) },
+ { "vec_cmplt", 7, 2, O_vec_cmplt, O_UID(40) },
+ { "vec_ctf", 2, 2, O_vec_ctf, O_UID(41) },
+ { "vec_cts", 1, 2, O_vec_cts, O_UID(42) },
+ { "vec_ctu", 1, 2, O_vec_ctu, O_UID(43) },
+ { "vec_dss", 1, 1, O_vec_dss, O_UID(44) },
+ { "vec_dssall", 1, 0, O_vec_dssall, O_UID(45) },
+ { "vec_dst", 20, 3, O_vec_dst, O_UID(46) },
+ { "vec_dstst", 20, 3, O_vec_dstst, O_UID(47) },
+ { "vec_dststt", 20, 3, O_vec_dststt, O_UID(48) },
+ { "vec_dstt", 20, 3, O_vec_dstt, O_UID(49) },
+ { "vec_expte", 1, 1, O_vec_expte, O_UID(50) },
+ { "vec_floor", 1, 1, O_vec_floor, O_UID(51) },
+ { "vec_ld", 20, 2, O_vec_ld, O_UID(52) },
+ { "vec_lde", 9, 2, O_vec_lde, O_UID(53) },
+ { "vec_ldl", 20, 2, O_vec_ldl, O_UID(54) },
+ { "vec_loge", 1, 1, O_vec_loge, O_UID(55) },
+ { "vec_lvebx", 2, 2, O_vec_lvebx, O_UID(56) },
+ { "vec_lvehx", 2, 2, O_vec_lvehx, O_UID(57) },
+ { "vec_lvewx", 5, 2, O_vec_lvewx, O_UID(58) },
+ { "vec_lvsl", 9, 2, O_vec_lvsl, O_UID(59) },
+ { "vec_lvsr", 9, 2, O_vec_lvsr, O_UID(60) },
+ { "vec_lvx", 20, 2, O_vec_lvx, O_UID(61) },
+ { "vec_lvxl", 20, 2, O_vec_lvxl, O_UID(62) },
+ { "vec_madd", 1, 3, O_vec_madd, O_UID(63) },
+ { "vec_madds", 1, 3, O_vec_madds, O_UID(64) },
+ { "vec_max", 19, 2, O_vec_max, O_UID(65) },
+ { "vec_mergeh", 11, 2, O_vec_mergeh, O_UID(66) },
+ { "vec_mergel", 11, 2, O_vec_mergel, O_UID(67) },
+ { "vec_mfvscr", 1, 0, O_vec_mfvscr, O_UID(68) },
+ { "vec_min", 19, 2, O_vec_min, O_UID(69) },
+ { "vec_mladd", 4, 3, O_vec_mladd, O_UID(70) },
+ { "vec_mradds", 1, 3, O_vec_mradds, O_UID(71) },
+ { "vec_msum", 4, 3, O_vec_msum, O_UID(72) },
+ { "vec_msums", 2, 3, O_vec_msums, O_UID(73) },
+ { "vec_mtvscr", 10, 1, O_vec_mtvscr, O_UID(74) },
+ { "vec_mule", 4, 2, O_vec_mule, O_UID(75) },
+ { "vec_mulo", 4, 2, O_vec_mulo, O_UID(76) },
+ { "vec_nmsub", 1, 3, O_vec_nmsub, O_UID(77) },
+ { "vec_nor", 10, 2, O_vec_nor, O_UID(78) },
+ { "vec_or", 24, 2, O_vec_or, O_UID(79) },
+ { "vec_pack", 6, 2, O_vec_pack, O_UID(80) },
+ { "vec_packpx", 1, 2, O_vec_packpx, O_UID(81) },
+ { "vec_packs", 4, 2, O_vec_packs, O_UID(82) },
+ { "vec_packsu", 4, 2, O_vec_packsu, O_UID(83) },
+ { "vec_perm", 11, 3, O_vec_perm, O_UID(84) },
+ { "vec_re", 1, 1, O_vec_re, O_UID(85) },
+ { "vec_rl", 6, 2, O_vec_rl, O_UID(86) },
+ { "vec_round", 1, 1, O_vec_round, O_UID(87) },
+ { "vec_rsqrte", 1, 1, O_vec_rsqrte, O_UID(88) },
+ { "vec_sel", 20, 3, O_vec_sel, O_UID(89) },
+ { "vec_sl", 6, 2, O_vec_sl, O_UID(90) },
+ { "vec_sld", 11, 3, O_vec_sld, O_UID(91) },
+ { "vec_sll", 30, 2, O_vec_sll, O_UID(92) },
+ { "vec_slo", 16, 2, O_vec_slo, O_UID(93) },
+ { "vec_splat", 11, 2, O_vec_splat, O_UID(94) },
+ { "vec_splat_s16", 1, 1, O_vec_splat_s16, O_UID(95) },
+ { "vec_splat_s32", 1, 1, O_vec_splat_s32, O_UID(96) },
+ { "vec_splat_s8", 1, 1, O_vec_splat_s8, O_UID(97) },
+ { "vec_splat_u16", 1, 1, O_vec_splat_u16, O_UID(98) },
+ { "vec_splat_u32", 1, 1, O_vec_splat_u32, O_UID(99) },
+ { "vec_splat_u8", 1, 1, O_vec_splat_u8, O_UID(100) },
+ { "vec_sr", 6, 2, O_vec_sr, O_UID(101) },
+ { "vec_sra", 6, 2, O_vec_sra, O_UID(102) },
+ { "vec_srl", 30, 2, O_vec_srl, O_UID(103) },
+ { "vec_sro", 16, 2, O_vec_sro, O_UID(104) },
+ { "vec_st", 30, 3, O_vec_st, O_UID(105) },
+ { "vec_ste", 19, 3, O_vec_ste, O_UID(106) },
+ { "vec_stl", 30, 3, O_vec_stl, O_UID(107) },
+ { "vec_stvebx", 6, 3, O_vec_stvebx, O_UID(108) },
+ { "vec_stvehx", 4, 3, O_vec_stvehx, O_UID(109) },
+ { "vec_stvewx", 9, 3, O_vec_stvewx, O_UID(110) },
+ { "vec_stvx", 30, 3, O_vec_stvx, O_UID(111) },
+ { "vec_stvxl", 30, 3, O_vec_stvxl, O_UID(112) },
+ { "vec_sub", 19, 2, O_vec_sub, O_UID(113) },
+ { "vec_subc", 1, 2, O_vec_subc, O_UID(114) },
+ { "vec_subs", 18, 2, O_vec_subs, O_UID(115) },
+ { "vec_sum2s", 1, 2, O_vec_sum2s, O_UID(116) },
+ { "vec_sum4s", 3, 2, O_vec_sum4s, O_UID(117) },
+ { "vec_sums", 1, 2, O_vec_sums, O_UID(118) },
+ { "vec_trunc", 1, 1, O_vec_trunc, O_UID(119) },
+ { "vec_unpack2sh", 2, 2, O_vec_unpack2sh, O_UID(120) },
+ { "vec_unpack2sl", 2, 2, O_vec_unpack2sl, O_UID(121) },
+ { "vec_unpack2uh", 2, 2, O_vec_unpack2uh, O_UID(122) },
+ { "vec_unpack2ul", 2, 2, O_vec_unpack2ul, O_UID(123) },
+ { "vec_unpackh", 5, 1, O_vec_unpackh, O_UID(124) },
+ { "vec_unpackl", 5, 1, O_vec_unpackl, O_UID(125) },
+ { "vec_vaddcuw", 1, 2, O_vec_vaddcuw, O_UID(126) },
+ { "vec_vaddfp", 1, 2, O_vec_vaddfp, O_UID(127) },
+ { "vec_vaddsbs", 3, 2, O_vec_vaddsbs, O_UID(128) },
+ { "vec_vaddshs", 3, 2, O_vec_vaddshs, O_UID(129) },
+ { "vec_vaddsws", 3, 2, O_vec_vaddsws, O_UID(130) },
+ { "vec_vaddubm", 6, 2, O_vec_vaddubm, O_UID(131) },
+ { "vec_vaddubs", 3, 2, O_vec_vaddubs, O_UID(132) },
+ { "vec_vadduhm", 6, 2, O_vec_vadduhm, O_UID(133) },
+ { "vec_vadduhs", 3, 2, O_vec_vadduhs, O_UID(134) },
+ { "vec_vadduwm", 6, 2, O_vec_vadduwm, O_UID(135) },
+ { "vec_vadduws", 3, 2, O_vec_vadduws, O_UID(136) },
+ { "vec_vand", 24, 2, O_vec_vand, O_UID(137) },
+ { "vec_vandc", 24, 2, O_vec_vandc, O_UID(138) },
+ { "vec_vavgsb", 1, 2, O_vec_vavgsb, O_UID(139) },
+ { "vec_vavgsh", 1, 2, O_vec_vavgsh, O_UID(140) },
+ { "vec_vavgsw", 1, 2, O_vec_vavgsw, O_UID(141) },
+ { "vec_vavgub", 1, 2, O_vec_vavgub, O_UID(142) },
+ { "vec_vavguh", 1, 2, O_vec_vavguh, O_UID(143) },
+ { "vec_vavguw", 1, 2, O_vec_vavguw, O_UID(144) },
+ { "vec_vcfsx", 1, 2, O_vec_vcfsx, O_UID(145) },
+ { "vec_vcfux", 1, 2, O_vec_vcfux, O_UID(146) },
+ { "vec_vcmpbfp", 1, 2, O_vec_vcmpbfp, O_UID(147) },
+ { "vec_vcmpeqfp", 1, 2, O_vec_vcmpeqfp, O_UID(148) },
+ { "vec_vcmpequb", 2, 2, O_vec_vcmpequb, O_UID(149) },
+ { "vec_vcmpequh", 2, 2, O_vec_vcmpequh, O_UID(150) },
+ { "vec_vcmpequw", 2, 2, O_vec_vcmpequw, O_UID(151) },
+ { "vec_vcmpgefp", 1, 2, O_vec_vcmpgefp, O_UID(152) },
+ { "vec_vcmpgtfp", 1, 2, O_vec_vcmpgtfp, O_UID(153) },
+ { "vec_vcmpgtsb", 1, 2, O_vec_vcmpgtsb, O_UID(154) },
+ { "vec_vcmpgtsh", 1, 2, O_vec_vcmpgtsh, O_UID(155) },
+ { "vec_vcmpgtsw", 1, 2, O_vec_vcmpgtsw, O_UID(156) },
+ { "vec_vcmpgtub", 1, 2, O_vec_vcmpgtub, O_UID(157) },
+ { "vec_vcmpgtuh", 1, 2, O_vec_vcmpgtuh, O_UID(158) },
+ { "vec_vcmpgtuw", 1, 2, O_vec_vcmpgtuw, O_UID(159) },
+ { "vec_vctsxs", 1, 2, O_vec_vctsxs, O_UID(160) },
+ { "vec_vctuxs", 1, 2, O_vec_vctuxs, O_UID(161) },
+ { "vec_vexptefp", 1, 1, O_vec_vexptefp, O_UID(162) },
+ { "vec_vlogefp", 1, 1, O_vec_vlogefp, O_UID(163) },
+ { "vec_vmaddfp", 1, 3, O_vec_vmaddfp, O_UID(164) },
+ { "vec_vmaxfp", 1, 2, O_vec_vmaxfp, O_UID(165) },
+ { "vec_vmaxsb", 3, 2, O_vec_vmaxsb, O_UID(166) },
+ { "vec_vmaxsh", 3, 2, O_vec_vmaxsh, O_UID(167) },
+ { "vec_vmaxsw", 3, 2, O_vec_vmaxsw, O_UID(168) },
+ { "vec_vmaxub", 3, 2, O_vec_vmaxub, O_UID(169) },
+ { "vec_vmaxuh", 3, 2, O_vec_vmaxuh, O_UID(170) },
+ { "vec_vmaxuw", 3, 2, O_vec_vmaxuw, O_UID(171) },
+ { "vec_vmhaddshs", 1, 3, O_vec_vmhaddshs, O_UID(172) },
+ { "vec_vmhraddshs", 1, 3, O_vec_vmhraddshs, O_UID(173) },
+ { "vec_vminfp", 1, 2, O_vec_vminfp, O_UID(174) },
+ { "vec_vminsb", 3, 2, O_vec_vminsb, O_UID(175) },
+ { "vec_vminsh", 3, 2, O_vec_vminsh, O_UID(176) },
+ { "vec_vminsw", 3, 2, O_vec_vminsw, O_UID(177) },
+ { "vec_vminub", 3, 2, O_vec_vminub, O_UID(178) },
+ { "vec_vminuh", 3, 2, O_vec_vminuh, O_UID(179) },
+ { "vec_vminuw", 3, 2, O_vec_vminuw, O_UID(180) },
+ { "vec_vmladduhm", 4, 3, O_vec_vmladduhm, O_UID(181) },
+ { "vec_vmrghb", 3, 2, O_vec_vmrghb, O_UID(182) },
+ { "vec_vmrghh", 4, 2, O_vec_vmrghh, O_UID(183) },
+ { "vec_vmrghw", 4, 2, O_vec_vmrghw, O_UID(184) },
+ { "vec_vmrglb", 3, 2, O_vec_vmrglb, O_UID(185) },
+ { "vec_vmrglh", 4, 2, O_vec_vmrglh, O_UID(186) },
+ { "vec_vmrglw", 4, 2, O_vec_vmrglw, O_UID(187) },
+ { "vec_vmsummbm", 1, 3, O_vec_vmsummbm, O_UID(188) },
+ { "vec_vmsumshm", 1, 3, O_vec_vmsumshm, O_UID(189) },
+ { "vec_vmsumshs", 1, 3, O_vec_vmsumshs, O_UID(190) },
+ { "vec_vmsumubm", 1, 3, O_vec_vmsumubm, O_UID(191) },
+ { "vec_vmsumuhm", 1, 3, O_vec_vmsumuhm, O_UID(192) },
+ { "vec_vmsumuhs", 1, 3, O_vec_vmsumuhs, O_UID(193) },
+ { "vec_vmulesb", 1, 2, O_vec_vmulesb, O_UID(194) },
+ { "vec_vmulesh", 1, 2, O_vec_vmulesh, O_UID(195) },
+ { "vec_vmuleub", 1, 2, O_vec_vmuleub, O_UID(196) },
+ { "vec_vmuleuh", 1, 2, O_vec_vmuleuh, O_UID(197) },
+ { "vec_vmulosb", 1, 2, O_vec_vmulosb, O_UID(198) },
+ { "vec_vmulosh", 1, 2, O_vec_vmulosh, O_UID(199) },
+ { "vec_vmuloub", 1, 2, O_vec_vmuloub, O_UID(200) },
+ { "vec_vmulouh", 1, 2, O_vec_vmulouh, O_UID(201) },
+ { "vec_vnmsubfp", 1, 3, O_vec_vnmsubfp, O_UID(202) },
+ { "vec_vnor", 10, 2, O_vec_vnor, O_UID(203) },
+ { "vec_vor", 24, 2, O_vec_vor, O_UID(204) },
+ { "vec_vperm", 11, 3, O_vec_vperm, O_UID(205) },
+ { "vec_vpkpx", 1, 2, O_vec_vpkpx, O_UID(206) },
+ { "vec_vpkshss", 1, 2, O_vec_vpkshss, O_UID(207) },
+ { "vec_vpkshus", 1, 2, O_vec_vpkshus, O_UID(208) },
+ { "vec_vpkswss", 1, 2, O_vec_vpkswss, O_UID(209) },
+ { "vec_vpkswus", 1, 2, O_vec_vpkswus, O_UID(210) },
+ { "vec_vpkuhum", 3, 2, O_vec_vpkuhum, O_UID(211) },
+ { "vec_vpkuhus", 1, 2, O_vec_vpkuhus, O_UID(212) },
+ { "vec_vpkuwum", 3, 2, O_vec_vpkuwum, O_UID(213) },
+ { "vec_vpkuwus", 1, 2, O_vec_vpkuwus, O_UID(214) },
+ { "vec_vrefp", 1, 1, O_vec_vrefp, O_UID(215) },
+ { "vec_vrfim", 1, 1, O_vec_vrfim, O_UID(216) },
+ { "vec_vrfin", 1, 1, O_vec_vrfin, O_UID(217) },
+ { "vec_vrfip", 1, 1, O_vec_vrfip, O_UID(218) },
+ { "vec_vrfiz", 1, 1, O_vec_vrfiz, O_UID(219) },
+ { "vec_vrlb", 2, 2, O_vec_vrlb, O_UID(220) },
+ { "vec_vrlh", 2, 2, O_vec_vrlh, O_UID(221) },
+ { "vec_vrlw", 2, 2, O_vec_vrlw, O_UID(222) },
+ { "vec_vrsqrtefp", 1, 1, O_vec_vrsqrtefp, O_UID(223) },
+ { "vec_vsel", 20, 3, O_vec_vsel, O_UID(224) },
+ { "vec_vsl", 30, 2, O_vec_vsl, O_UID(225) },
+ { "vec_vslb", 2, 2, O_vec_vslb, O_UID(226) },
+ { "vec_vsldoi", 11, 3, O_vec_vsldoi, O_UID(227) },
+ { "vec_vslh", 2, 2, O_vec_vslh, O_UID(228) },
+ { "vec_vslo", 16, 2, O_vec_vslo, O_UID(229) },
+ { "vec_vslw", 2, 2, O_vec_vslw, O_UID(230) },
+ { "vec_vspltb", 3, 2, O_vec_vspltb, O_UID(231) },
+ { "vec_vsplth", 4, 2, O_vec_vsplth, O_UID(232) },
+ { "vec_vspltisb", 1, 1, O_vec_vspltisb, O_UID(233) },
+ { "vec_vspltish", 1, 1, O_vec_vspltish, O_UID(234) },
+ { "vec_vspltisw", 1, 1, O_vec_vspltisw, O_UID(235) },
+ { "vec_vspltw", 4, 2, O_vec_vspltw, O_UID(236) },
+ { "vec_vsr", 30, 2, O_vec_vsr, O_UID(237) },
+ { "vec_vsrab", 2, 2, O_vec_vsrab, O_UID(238) },
+ { "vec_vsrah", 2, 2, O_vec_vsrah, O_UID(239) },
+ { "vec_vsraw", 2, 2, O_vec_vsraw, O_UID(240) },
+ { "vec_vsrb", 2, 2, O_vec_vsrb, O_UID(241) },
+ { "vec_vsrh", 2, 2, O_vec_vsrh, O_UID(242) },
+ { "vec_vsro", 16, 2, O_vec_vsro, O_UID(243) },
+ { "vec_vsrw", 2, 2, O_vec_vsrw, O_UID(244) },
+ { "vec_vsubcuw", 1, 2, O_vec_vsubcuw, O_UID(245) },
+ { "vec_vsubfp", 1, 2, O_vec_vsubfp, O_UID(246) },
+ { "vec_vsubsbs", 3, 2, O_vec_vsubsbs, O_UID(247) },
+ { "vec_vsubshs", 3, 2, O_vec_vsubshs, O_UID(248) },
+ { "vec_vsubsws", 3, 2, O_vec_vsubsws, O_UID(249) },
+ { "vec_vsububm", 6, 2, O_vec_vsububm, O_UID(250) },
+ { "vec_vsububs", 3, 2, O_vec_vsububs, O_UID(251) },
+ { "vec_vsubuhm", 6, 2, O_vec_vsubuhm, O_UID(252) },
+ { "vec_vsubuhs", 3, 2, O_vec_vsubuhs, O_UID(253) },
+ { "vec_vsubuwm", 6, 2, O_vec_vsubuwm, O_UID(254) },
+ { "vec_vsubuws", 3, 2, O_vec_vsubuws, O_UID(255) },
+ { "vec_vsum2sws", 1, 2, O_vec_vsum2sws, O_UID(256) },
+ { "vec_vsum4sbs", 1, 2, O_vec_vsum4sbs, O_UID(257) },
+ { "vec_vsum4shs", 1, 2, O_vec_vsum4shs, O_UID(258) },
+ { "vec_vsum4ubs", 1, 2, O_vec_vsum4ubs, O_UID(259) },
+ { "vec_vsumsws", 1, 2, O_vec_vsumsws, O_UID(260) },
+ { "vec_vupkhpx", 1, 1, O_vec_vupkhpx, O_UID(261) },
+ { "vec_vupkhsb", 2, 1, O_vec_vupkhsb, O_UID(262) },
+ { "vec_vupkhsh", 2, 1, O_vec_vupkhsh, O_UID(263) },
+ { "vec_vupklpx", 1, 1, O_vec_vupklpx, O_UID(264) },
+ { "vec_vupklsb", 2, 1, O_vec_vupklsb, O_UID(265) },
+ { "vec_vupklsh", 2, 1, O_vec_vupklsh, O_UID(266) },
+ { "vec_vxor", 24, 2, O_vec_vxor, O_UID(267) },
+ { "vec_xor", 24, 2, O_vec_xor, O_UID(268) },
+ { NULL, 0, 0, NULL, 0 }
+};
+#define LAST_O_UID O_UID(269)
diff --git a/gcc/config/rs6000/vec.ops b/gcc/config/rs6000/vec.ops
new file mode 100644
index 00000000000..5ef80a2d6b8
--- /dev/null
+++ b/gcc/config/rs6000/vec.ops
@@ -0,0 +1,1025 @@
+# APPLE LOCAL file AltiVec
+# ops-to-gp -gcc vec.ops builtin.ops
+vec_abs vec_s8 = vec_s8 vec_abs BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE 1 FALSE FALSE transform_vec_abs
+vec_abs vec_s16 = vec_s16 vec_abs BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE 2 FALSE FALSE transform_vec_abs
+vec_abs vec_s32 = vec_s32 vec_abs BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE 3 FALSE FALSE transform_vec_abs
+vec_abs vec_f32 = vec_f32 vec_abs BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE 4 FALSE FALSE transform_vec_abs
+vec_abss vec_s8 = vec_s8 vec_abss BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE 5 FALSE FALSE transform_vec_abs
+vec_abss vec_s16 = vec_s16 vec_abss BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE 6 FALSE FALSE transform_vec_abs
+vec_abss vec_s32 = vec_s32 vec_abss BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE 7 FALSE FALSE transform_vec_abs
+vec_cmplt vec_u8 vec_u8 = vec_b8 vec_cmplt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtub FALSE FALSE transform_vec_cmp_reverse
+vec_cmplt vec_u16 vec_u16 = vec_b16 vec_cmplt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuh FALSE FALSE transform_vec_cmp_reverse
+vec_cmplt vec_u32 vec_u32 = vec_b32 vec_cmplt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuw FALSE FALSE transform_vec_cmp_reverse
+vec_cmplt vec_s8 vec_s8 = vec_b8 vec_cmplt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsb FALSE FALSE transform_vec_cmp_reverse
+vec_cmplt vec_s16 vec_s16 = vec_b16 vec_cmplt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsh FALSE FALSE transform_vec_cmp_reverse
+vec_cmplt vec_s32 vec_s32 = vec_b32 vec_cmplt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsw FALSE FALSE transform_vec_cmp_reverse
+vec_cmplt vec_f32 vec_f32 = vec_b32 vec_cmplt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfp FALSE FALSE transform_vec_cmp_reverse
+vec_cmple vec_f32 vec_f32 = vec_b32 vec_cmple BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefp FALSE FALSE transform_vec_cmp_reverse
+vec_add vec_s8 vec_s8 = vec_s8 vec_vaddubm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_s8 vec_b8 = vec_s8 vec_vaddubm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_b8 vec_s8 = vec_s8 vec_vaddubm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_s16 vec_s16 = vec_s16 vec_vadduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_s16 vec_b16 = vec_s16 vec_vadduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_b16 vec_s16 = vec_s16 vec_vadduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_s32 vec_s32 = vec_s32 vec_vadduwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_s32 vec_b32 = vec_s32 vec_vadduwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_b32 vec_s32 = vec_s32 vec_vadduwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_u8 vec_u8 = vec_u8 vec_vaddubm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_u8 vec_b8 = vec_u8 vec_vaddubm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_b8 vec_u8 = vec_u8 vec_vaddubm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_u16 vec_u16 = vec_u16 vec_vadduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_u16 vec_b16 = vec_u16 vec_vadduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_b16 vec_u16 = vec_u16 vec_vadduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_u32 vec_u32 = vec_u32 vec_vadduwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_u32 vec_b32 = vec_u32 vec_vadduwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_b32 vec_u32 = vec_u32 vec_vadduwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_s8 vec_s8 = vec_s8 vec_vaddsbs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_s8 vec_b8 = vec_s8 vec_vaddsbs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_b8 vec_s8 = vec_s8 vec_vaddsbs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_s16 vec_s16 = vec_s16 vec_vaddshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_s16 vec_b16 = vec_s16 vec_vaddshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_b16 vec_s16 = vec_s16 vec_vaddshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_s32 vec_s32 = vec_s32 vec_vaddsws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_s32 vec_b32 = vec_s32 vec_vaddsws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_b32 vec_s32 = vec_s32 vec_vaddsws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_u8 vec_u8 = vec_u8 vec_vaddubs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_u8 vec_b8 = vec_u8 vec_vaddubs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_b8 vec_u8 = vec_u8 vec_vaddubs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_u16 vec_u16 = vec_u16 vec_vadduhs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_u16 vec_b16 = vec_u16 vec_vadduhs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_b16 vec_u16 = vec_u16 vec_vadduhs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_u32 vec_u32 = vec_u32 vec_vadduws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_u32 vec_b32 = vec_u32 vec_vadduws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_adds vec_b32 vec_u32 = vec_u32 vec_vadduws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_s8 vec_s8 = vec_s8 vec_vsububm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_s8 vec_b8 = vec_s8 vec_vsububm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_b8 vec_s8 = vec_s8 vec_vsububm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_s16 vec_s16 = vec_s16 vec_vsubuhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_s16 vec_b16 = vec_s16 vec_vsubuhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_b16 vec_s16 = vec_s16 vec_vsubuhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_s32 vec_s32 = vec_s32 vec_vsubuwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_s32 vec_b32 = vec_s32 vec_vsubuwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_b32 vec_s32 = vec_s32 vec_vsubuwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_u8 vec_u8 = vec_u8 vec_vsububm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_u8 vec_b8 = vec_u8 vec_vsububm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_b8 vec_u8 = vec_u8 vec_vsububm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_u16 vec_u16 = vec_u16 vec_vsubuhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_u16 vec_b16 = vec_u16 vec_vsubuhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_b16 vec_u16 = vec_u16 vec_vsubuhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_u32 vec_u32 = vec_u32 vec_vsubuwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_u32 vec_b32 = vec_u32 vec_vsubuwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_b32 vec_u32 = vec_u32 vec_vsubuwm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_s8 vec_s8 = vec_s8 vec_vsubsbs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_s8 vec_b8 = vec_s8 vec_vsubsbs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_b8 vec_s8 = vec_s8 vec_vsubsbs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_s16 vec_s16 = vec_s16 vec_vsubshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_s16 vec_b16 = vec_s16 vec_vsubshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_b16 vec_s16 = vec_s16 vec_vsubshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_s32 vec_s32 = vec_s32 vec_vsubsws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_s32 vec_b32 = vec_s32 vec_vsubsws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_b32 vec_s32 = vec_s32 vec_vsubsws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_u8 vec_u8 = vec_u8 vec_vsububs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_u8 vec_b8 = vec_u8 vec_vsububs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_b8 vec_u8 = vec_u8 vec_vsububs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_u16 vec_u16 = vec_u16 vec_vsubuhs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_u16 vec_b16 = vec_u16 vec_vsubuhs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_b16 vec_u16 = vec_u16 vec_vsubuhs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_u32 vec_u32 = vec_u32 vec_vsubuws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_u32 vec_b32 = vec_u32 vec_vsubuws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subs vec_b32 vec_u32 = vec_u32 vec_vsubuws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_addc vec_u32 vec_u32 = vec_u32 vec_vaddcuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_subc vec_u32 vec_u32 = vec_u32 vec_vsubcuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mulo vec_u8 vec_u8 = vec_u16 vec_vmuloub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mulo vec_u16 vec_u16 = vec_u32 vec_vmulouh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mulo vec_s8 vec_s8 = vec_s16 vec_vmulosb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mulo vec_s16 vec_s16 = vec_s32 vec_vmulosh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mule vec_u8 vec_u8 = vec_u16 vec_vmuleub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mule vec_u16 vec_u16 = vec_u32 vec_vmuleuh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mule vec_s8 vec_s8 = vec_s16 vec_vmulesb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mule vec_s16 vec_s16 = vec_s32 vec_vmulesh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mladd vec_s16 vec_s16 vec_s16 = vec_s16 vec_vmladduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mladd vec_u16 vec_u16 vec_u16 = vec_u16 vec_vmladduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mladd vec_s16 vec_u16 vec_u16 = vec_s16 vec_vmladduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mladd vec_u16 vec_s16 vec_s16 = vec_s16 vec_vmladduhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_madds vec_s16 vec_s16 vec_s16 = vec_s16 vec_vmhaddshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mradds vec_s16 vec_s16 vec_s16 = vec_s16 vec_vmhraddshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_msum vec_s8 vec_u8 vec_s32 = vec_s32 vec_vmsummbm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_msum vec_u8 vec_u8 vec_u32 = vec_u32 vec_vmsumubm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_msum vec_s16 vec_s16 vec_s32 = vec_s32 vec_vmsumshm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_msum vec_u16 vec_u16 vec_u32 = vec_u32 vec_vmsumuhm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_msums vec_s16 vec_s16 vec_s32 = vec_s32 vec_vmsumshs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_msums vec_u16 vec_u16 vec_u32 = vec_u32 vec_vmsumuhs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sums vec_s32 vec_s32 = vec_s32 vec_vsumsws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sum2s vec_s32 vec_s32 = vec_s32 vec_vsum2sws BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sum4s vec_s8 vec_s32 = vec_s32 vec_vsum4sbs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sum4s vec_u8 vec_u32 = vec_u32 vec_vsum4ubs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sum4s vec_s16 vec_s32 = vec_s32 vec_vsum4shs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_avg vec_s8 vec_s8 = vec_s8 vec_vavgsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_avg vec_s16 vec_s16 = vec_s16 vec_vavgsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_avg vec_u8 vec_u8 = vec_u8 vec_vavgub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_avg vec_u16 vec_u16 = vec_u16 vec_vavguh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_avg vec_s32 vec_s32 = vec_s32 vec_vavgsw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_avg vec_u32 vec_u32 = vec_u32 vec_vavguw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_s8 vec_s8 = vec_s8 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_s8 vec_b8 = vec_s8 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b8 vec_s8 = vec_s8 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_u8 vec_u8 = vec_u8 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b8 vec_u8 = vec_u8 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_u8 vec_b8 = vec_u8 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b8 vec_b8 = vec_b8 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_s16 vec_s16 = vec_s16 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_s16 vec_b16 = vec_s16 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b16 vec_s16 = vec_s16 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_u16 vec_u16 = vec_u16 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b16 vec_u16 = vec_u16 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_u16 vec_b16 = vec_u16 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b16 vec_b16 = vec_b16 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_s32 vec_s32 = vec_s32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_s32 vec_b32 = vec_s32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b32 vec_s32 = vec_s32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_u32 vec_u32 = vec_u32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b32 vec_u32 = vec_u32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_u32 vec_b32 = vec_u32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b32 vec_b32 = vec_b32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_f32 vec_f32 = vec_f32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_f32 vec_b32 = vec_f32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_and vec_b32 vec_f32 = vec_f32 vec_vand BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_s8 vec_s8 = vec_s8 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_s8 vec_b8 = vec_s8 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b8 vec_s8 = vec_s8 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_u8 vec_u8 = vec_u8 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b8 vec_u8 = vec_u8 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_u8 vec_b8 = vec_u8 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b8 vec_b8 = vec_b8 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_s16 vec_s16 = vec_s16 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_s16 vec_b16 = vec_s16 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b16 vec_s16 = vec_s16 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_u16 vec_u16 = vec_u16 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b16 vec_u16 = vec_u16 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_u16 vec_b16 = vec_u16 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b16 vec_b16 = vec_b16 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_s32 vec_s32 = vec_s32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_s32 vec_b32 = vec_s32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b32 vec_s32 = vec_s32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_u32 vec_u32 = vec_u32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b32 vec_u32 = vec_u32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_u32 vec_b32 = vec_u32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b32 vec_b32 = vec_b32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_f32 vec_f32 = vec_f32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_f32 vec_b32 = vec_f32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_or vec_b32 vec_f32 = vec_f32 vec_vor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_s8 vec_s8 = vec_s8 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_s8 vec_b8 = vec_s8 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b8 vec_s8 = vec_s8 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_u8 vec_u8 = vec_u8 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b8 vec_u8 = vec_u8 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_u8 vec_b8 = vec_u8 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b8 vec_b8 = vec_b8 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_s16 vec_s16 = vec_s16 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_s16 vec_b16 = vec_s16 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b16 vec_s16 = vec_s16 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_u16 vec_u16 = vec_u16 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b16 vec_u16 = vec_u16 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_u16 vec_b16 = vec_u16 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b16 vec_b16 = vec_b16 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_s32 vec_s32 = vec_s32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_s32 vec_b32 = vec_s32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b32 vec_s32 = vec_s32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_u32 vec_u32 = vec_u32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b32 vec_u32 = vec_u32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_u32 vec_b32 = vec_u32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b32 vec_b32 = vec_b32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_f32 vec_f32 = vec_f32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_f32 vec_b32 = vec_f32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_xor vec_b32 vec_f32 = vec_f32 vec_vxor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_s8 vec_s8 = vec_s8 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_s8 vec_b8 = vec_s8 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b8 vec_s8 = vec_s8 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_u8 vec_u8 = vec_u8 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b8 vec_u8 = vec_u8 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_u8 vec_b8 = vec_u8 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b8 vec_b8 = vec_b8 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_s16 vec_s16 = vec_s16 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_s16 vec_b16 = vec_s16 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b16 vec_s16 = vec_s16 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_u16 vec_u16 = vec_u16 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b16 vec_u16 = vec_u16 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_u16 vec_b16 = vec_u16 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b16 vec_b16 = vec_b16 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_s32 vec_s32 = vec_s32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_s32 vec_b32 = vec_s32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b32 vec_s32 = vec_s32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_u32 vec_u32 = vec_u32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b32 vec_u32 = vec_u32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_u32 vec_b32 = vec_u32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b32 vec_b32 = vec_b32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_f32 vec_f32 = vec_f32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_f32 vec_b32 = vec_f32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_andc vec_b32 vec_f32 = vec_f32 vec_vandc BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_u8 vec_u8 = vec_u8 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_s8 vec_s8 = vec_s8 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_b8 vec_b8 = vec_b8 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_u16 vec_u16 = vec_u16 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_s16 vec_s16 = vec_s16 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_b16 vec_b16 = vec_b16 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_u32 vec_u32 = vec_u32 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_s32 vec_s32 = vec_s32 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_b32 vec_b32 = vec_b32 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nor vec_f32 vec_f32 = vec_f32 vec_vnor BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_rl vec_u8 vec_u8 = vec_u8 vec_vrlb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_rl vec_u16 vec_u16 = vec_u16 vec_vrlh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_rl vec_u32 vec_u32 = vec_u32 vec_vrlw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_rl vec_s8 vec_u8 = vec_s8 vec_vrlb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_rl vec_s16 vec_u16 = vec_s16 vec_vrlh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_rl vec_s32 vec_u32 = vec_s32 vec_vrlw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sl vec_u8 vec_u8 = vec_u8 vec_vslb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sl vec_u16 vec_u16 = vec_u16 vec_vslh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sl vec_u32 vec_u32 = vec_u32 vec_vslw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sl vec_s8 vec_u8 = vec_s8 vec_vslb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sl vec_s16 vec_u16 = vec_s16 vec_vslh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sl vec_s32 vec_u32 = vec_s32 vec_vslw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u8 vec_u8 = vec_u8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u16 vec_u8 = vec_u16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u32 vec_u8 = vec_u32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s8 vec_u8 = vec_s8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s16 vec_u8 = vec_s16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s32 vec_u8 = vec_s32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b8 vec_u8 = vec_b8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b16 vec_u8 = vec_b16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b32 vec_u8 = vec_b32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_p16 vec_u8 = vec_p16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u8 vec_u16 = vec_u8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u16 vec_u16 = vec_u16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u32 vec_u16 = vec_u32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s8 vec_u16 = vec_s8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s16 vec_u16 = vec_s16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s32 vec_u16 = vec_s32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b8 vec_u16 = vec_b8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b16 vec_u16 = vec_b16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b32 vec_u16 = vec_b32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_p16 vec_u16 = vec_p16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u8 vec_u32 = vec_u8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u16 vec_u32 = vec_u16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_u32 vec_u32 = vec_u32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s8 vec_u32 = vec_s8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s16 vec_u32 = vec_s16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_s32 vec_u32 = vec_s32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b8 vec_u32 = vec_b8 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b16 vec_u32 = vec_b16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_b32 vec_u32 = vec_b32 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sll vec_p16 vec_u32 = vec_p16 vec_vsl BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sr vec_u8 vec_u8 = vec_u8 vec_vsrb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sr vec_u16 vec_u16 = vec_u16 vec_vsrh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sr vec_u32 vec_u32 = vec_u32 vec_vsrw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sr vec_s8 vec_u8 = vec_s8 vec_vsrb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sr vec_s16 vec_u16 = vec_s16 vec_vsrh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sr vec_s32 vec_u32 = vec_s32 vec_vsrw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sra vec_u8 vec_u8 = vec_u8 vec_vsrab BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sra vec_u16 vec_u16 = vec_u16 vec_vsrah BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sra vec_u32 vec_u32 = vec_u32 vec_vsraw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sra vec_s8 vec_u8 = vec_s8 vec_vsrab BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sra vec_s16 vec_u16 = vec_s16 vec_vsrah BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sra vec_s32 vec_u32 = vec_s32 vec_vsraw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u8 vec_u8 = vec_u8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u16 vec_u8 = vec_u16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u32 vec_u8 = vec_u32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s8 vec_u8 = vec_s8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s16 vec_u8 = vec_s16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s32 vec_u8 = vec_s32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b8 vec_u8 = vec_b8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b16 vec_u8 = vec_b16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b32 vec_u8 = vec_b32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_p16 vec_u8 = vec_p16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u8 vec_u16 = vec_u8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u16 vec_u16 = vec_u16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u32 vec_u16 = vec_u32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s8 vec_u16 = vec_s8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s16 vec_u16 = vec_s16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s32 vec_u16 = vec_s32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b8 vec_u16 = vec_b8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b16 vec_u16 = vec_b16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b32 vec_u16 = vec_b32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_p16 vec_u16 = vec_p16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u8 vec_u32 = vec_u8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u16 vec_u32 = vec_u16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_u32 vec_u32 = vec_u32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s8 vec_u32 = vec_s8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s16 vec_u32 = vec_s16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_s32 vec_u32 = vec_s32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b8 vec_u32 = vec_b8 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b16 vec_u32 = vec_b16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_b32 vec_u32 = vec_b32 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_srl vec_p16 vec_u32 = vec_p16 vec_vsr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpgt vec_u8 vec_u8 = vec_b8 vec_vcmpgtub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpgt vec_u16 vec_u16 = vec_b16 vec_vcmpgtuh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpgt vec_u32 vec_u32 = vec_b32 vec_vcmpgtuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpgt vec_s8 vec_s8 = vec_b8 vec_vcmpgtsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpgt vec_s16 vec_s16 = vec_b16 vec_vcmpgtsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpgt vec_s32 vec_s32 = vec_b32 vec_vcmpgtsw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpeq vec_u8 vec_u8 = vec_b8 vec_vcmpequb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpeq vec_u16 vec_u16 = vec_b16 vec_vcmpequh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpeq vec_u32 vec_u32 = vec_b32 vec_vcmpequw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpeq vec_s8 vec_s8 = vec_b8 vec_vcmpequb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpeq vec_s16 vec_s16 = vec_b16 vec_vcmpequh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpeq vec_s32 vec_s32 = vec_b32 vec_vcmpequw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_b8 vec_b8 vec_b8 = vec_b8 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_b8 vec_b8 vec_u8 = vec_b8 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_u8 vec_u8 vec_u8 = vec_u8 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_u8 vec_u8 vec_b8 = vec_u8 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_s8 vec_s8 vec_u8 = vec_s8 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_s8 vec_s8 vec_b8 = vec_s8 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_b16 vec_b16 vec_b16 = vec_b16 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_b16 vec_b16 vec_u16 = vec_b16 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_u16 vec_u16 vec_u16 = vec_u16 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_u16 vec_u16 vec_b16 = vec_u16 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_s16 vec_s16 vec_u16 = vec_s16 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_s16 vec_s16 vec_b16 = vec_s16 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_b32 vec_b32 vec_b32 = vec_b32 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_b32 vec_b32 vec_u32 = vec_b32 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_u32 vec_u32 vec_u32 = vec_u32 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_u32 vec_u32 vec_b32 = vec_u32 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_s32 vec_s32 vec_u32 = vec_s32 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_s32 vec_s32 vec_b32 = vec_s32 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_f32 vec_f32 vec_b32 = vec_f32 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sel vec_f32 vec_f32 vec_u32 = vec_f32 vec_vsel BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_pack vec_u16 vec_u16 = vec_u8 vec_vpkuhum BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_pack vec_u32 vec_u32 = vec_u16 vec_vpkuwum BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_pack vec_s16 vec_s16 = vec_s8 vec_vpkuhum BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_pack vec_s32 vec_s32 = vec_s16 vec_vpkuwum BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_pack vec_b16 vec_b16 = vec_b8 vec_vpkuhum BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_pack vec_b32 vec_b32 = vec_b16 vec_vpkuwum BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packs vec_u16 vec_u16 = vec_u8 vec_vpkuhus BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packs vec_u32 vec_u32 = vec_u16 vec_vpkuwus BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packsu vec_u16 vec_u16 = vec_u8 vec_vpkuhus BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packsu vec_u32 vec_u32 = vec_u16 vec_vpkuwus BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packs vec_s16 vec_s16 = vec_s8 vec_vpkshss BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packs vec_s32 vec_s32 = vec_s16 vec_vpkswss BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packsu vec_s16 vec_s16 = vec_u8 vec_vpkshus BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packsu vec_s32 vec_s32 = vec_u16 vec_vpkswus BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_packpx vec_u32 vec_u32 = vec_p16 vec_vpkpx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackh vec_s8 = vec_s16 vec_vupkhsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackh vec_s16 = vec_s32 vec_vupkhsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackh vec_b8 = vec_b16 vec_vupkhsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackh vec_b16 = vec_b32 vec_vupkhsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackh vec_p16 = vec_u32 vec_vupkhpx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackl vec_s8 = vec_s16 vec_vupklsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackl vec_s16 = vec_s32 vec_vupklsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackl vec_b8 = vec_b16 vec_vupklsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackl vec_b16 = vec_b32 vec_vupklsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpackl vec_p16 = vec_u32 vec_vupklpx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_u8 vec_u8 = vec_u8 vec_vmrghb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_u16 vec_u16 = vec_u16 vec_vmrghh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_u32 vec_u32 = vec_u32 vec_vmrghw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_s8 vec_s8 = vec_s8 vec_vmrghb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_s16 vec_s16 = vec_s16 vec_vmrghh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_s32 vec_s32 = vec_s32 vec_vmrghw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_f32 vec_f32 = vec_f32 vec_vmrghw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_p16 vec_p16 = vec_p16 vec_vmrghh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_b8 vec_b8 = vec_b8 vec_vmrghb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_b16 vec_b16 = vec_b16 vec_vmrghh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergeh vec_b32 vec_b32 = vec_b32 vec_vmrghw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpack2uh vec_u8 vec_u8 = vec_u16 vec_unpack2uh BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vmrghb
+vec_unpack2uh vec_u16 vec_u16 = vec_u32 vec_unpack2uh BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vmrghh
+vec_unpack2sh vec_u8 vec_u8 = vec_s16 vec_unpack2sh BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vmrghb
+vec_unpack2sh vec_u16 vec_u16 = vec_s32 vec_unpack2sh BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vmrghh
+vec_mergel vec_u8 vec_u8 = vec_u8 vec_vmrglb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_u16 vec_u16 = vec_u16 vec_vmrglh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_u32 vec_u32 = vec_u32 vec_vmrglw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_s8 vec_s8 = vec_s8 vec_vmrglb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_s16 vec_s16 = vec_s16 vec_vmrglh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_s32 vec_s32 = vec_s32 vec_vmrglw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_f32 vec_f32 = vec_f32 vec_vmrglw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_p16 vec_p16 = vec_p16 vec_vmrglh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_b8 vec_b8 = vec_b8 vec_vmrglb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_b16 vec_b16 = vec_b16 vec_vmrglh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mergel vec_b32 vec_b32 = vec_b32 vec_vmrglw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_unpack2ul vec_u8 vec_u8 = vec_u16 vec_unpack2ul BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vmrglb
+vec_unpack2ul vec_u16 vec_u16 = vec_u32 vec_unpack2ul BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vmrglh
+vec_unpack2sl vec_u8 vec_u8 = vec_s16 vec_unpack2sl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vmrglb
+vec_unpack2sl vec_u16 vec_u16 = vec_s32 vec_unpack2sl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vmrglh
+vec_splat vec_u8 immed_u5 = vec_u8 vec_vspltb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_u16 immed_u5 = vec_u16 vec_vsplth BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_u32 immed_u5 = vec_u32 vec_vspltw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_s8 immed_u5 = vec_s8 vec_vspltb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_s16 immed_u5 = vec_s16 vec_vsplth BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_s32 immed_u5 = vec_s32 vec_vspltw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_b8 immed_u5 = vec_b8 vec_vspltb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_b16 immed_u5 = vec_b16 vec_vsplth BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_b32 immed_u5 = vec_b32 vec_vspltw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_p16 immed_u5 = vec_p16 vec_vsplth BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat vec_f32 immed_u5 = vec_f32 vec_vspltw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat_s8 immed_s5 = vec_s8 vec_vspltisb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat_s16 immed_s5 = vec_s16 vec_vspltish BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat_s32 immed_s5 = vec_s32 vec_vspltisw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_splat_u8 immed_s5 = vec_u8 vec_splat_u8 BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vspltisb
+vec_splat_u16 immed_s5 = vec_u16 vec_splat_u16 BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vspltish
+vec_splat_u32 immed_s5 = vec_u32 vec_splat_u32 BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vspltisw
+vec_perm vec_u8 vec_u8 vec_u8 = vec_u8 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_u16 vec_u16 vec_u8 = vec_u16 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_u32 vec_u32 vec_u8 = vec_u32 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_s8 vec_s8 vec_u8 = vec_s8 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_s16 vec_s16 vec_u8 = vec_s16 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_s32 vec_s32 vec_u8 = vec_s32 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_b8 vec_b8 vec_u8 = vec_b8 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_b16 vec_b16 vec_u8 = vec_b16 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_b32 vec_b32 vec_u8 = vec_b32 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_p16 vec_p16 vec_u8 = vec_p16 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_perm vec_f32 vec_f32 vec_u8 = vec_f32 vec_vperm BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_u8 vec_u8 immed_u4 = vec_u8 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_u16 vec_u16 immed_u4 = vec_u16 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_u32 vec_u32 immed_u4 = vec_u32 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_s8 vec_s8 immed_u4 = vec_s8 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_s16 vec_s16 immed_u4 = vec_s16 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_s32 vec_s32 immed_u4 = vec_s32 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_p16 vec_p16 immed_u4 = vec_p16 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_f32 vec_f32 immed_u4 = vec_f32 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_b8 vec_b8 immed_u4 = vec_b8 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_b16 vec_b16 immed_u4 = vec_b16 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sld vec_b32 vec_b32 immed_u4 = vec_b32 vec_vsldoi BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_u8 vec_u8 = vec_u8 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_u16 vec_u8 = vec_u16 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_u32 vec_u8 = vec_u32 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_s8 vec_u8 = vec_s8 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_s16 vec_u8 = vec_s16 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_s32 vec_u8 = vec_s32 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_p16 vec_u8 = vec_p16 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_u8 vec_s8 = vec_u8 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_u16 vec_s8 = vec_u16 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_u32 vec_s8 = vec_u32 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_s8 vec_s8 = vec_s8 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_s16 vec_s8 = vec_s16 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_s32 vec_s8 = vec_s32 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_p16 vec_s8 = vec_p16 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_f32 vec_u8 = vec_f32 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_slo vec_f32 vec_s8 = vec_f32 vec_vslo BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_u8 vec_u8 = vec_u8 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_u16 vec_u8 = vec_u16 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_u32 vec_u8 = vec_u32 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_s8 vec_u8 = vec_s8 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_s16 vec_u8 = vec_s16 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_s32 vec_u8 = vec_s32 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_p16 vec_u8 = vec_p16 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_u8 vec_s8 = vec_u8 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_u16 vec_s8 = vec_u16 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_u32 vec_s8 = vec_u32 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_s8 vec_s8 = vec_s8 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_s16 vec_s8 = vec_s16 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_s32 vec_s8 = vec_s32 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_p16 vec_s8 = vec_p16 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_f32 vec_u8 = vec_f32 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sro vec_f32 vec_s8 = vec_f32 vec_vsro BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_u8 vec_u8 = vec_u8 vec_vmaxub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_u8 vec_b8 = vec_u8 vec_vmaxub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_b8 vec_u8 = vec_u8 vec_vmaxub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_s8 vec_s8 = vec_s8 vec_vmaxsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_s8 vec_b8 = vec_s8 vec_vmaxsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_b8 vec_s8 = vec_s8 vec_vmaxsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_u16 vec_u16 = vec_u16 vec_vmaxuh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_u16 vec_b16 = vec_u16 vec_vmaxuh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_b16 vec_u16 = vec_u16 vec_vmaxuh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_s16 vec_s16 = vec_s16 vec_vmaxsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_s16 vec_b16 = vec_s16 vec_vmaxsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_b16 vec_s16 = vec_s16 vec_vmaxsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_u32 vec_u32 = vec_u32 vec_vmaxuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_u32 vec_b32 = vec_u32 vec_vmaxuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_b32 vec_u32 = vec_u32 vec_vmaxuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_s32 vec_s32 = vec_s32 vec_vmaxsw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_s32 vec_b32 = vec_s32 vec_vmaxsw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_b32 vec_s32 = vec_s32 vec_vmaxsw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_u8 vec_u8 = vec_u8 vec_vminub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_u8 vec_b8 = vec_u8 vec_vminub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_b8 vec_u8 = vec_u8 vec_vminub BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_s8 vec_s8 = vec_s8 vec_vminsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_s8 vec_b8 = vec_s8 vec_vminsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_b8 vec_s8 = vec_s8 vec_vminsb BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_u16 vec_u16 = vec_u16 vec_vminuh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_u16 vec_b16 = vec_u16 vec_vminuh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_b16 vec_u16 = vec_u16 vec_vminuh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_s16 vec_s16 = vec_s16 vec_vminsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_s16 vec_b16 = vec_s16 vec_vminsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_b16 vec_s16 = vec_s16 vec_vminsh BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_u32 vec_u32 = vec_u32 vec_vminuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_u32 vec_b32 = vec_u32 vec_vminuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_b32 vec_u32 = vec_u32 vec_vminuw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_s32 vec_s32 = vec_s32 vec_vminsw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_s32 vec_b32 = vec_s32 vec_vminsw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_b32 vec_s32 = vec_s32 vec_vminsw BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_lde int const_unsigned_char_ptr = vec_u8_load_op vec_lvebx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvebx TRUE FALSE
+vec_lde int const_unsigned_short_ptr = vec_u16_load_op vec_lvehx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvehx TRUE FALSE
+vec_lde int const_unsigned_int_ptr = vec_u32_load_op vec_lvewx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvewx TRUE FALSE
+vec_lde int const_unsigned_long_ptr = vec_u32_load_op vec_lvewx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvewx TRUE FALSE
+vec_lde int const_signed_char_ptr = vec_s8_load_op vec_lvebx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvebx TRUE FALSE
+vec_lde int const_short_ptr = vec_s16_load_op vec_lvehx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvehx TRUE FALSE
+vec_lde int const_int_ptr = vec_s32_load_op vec_lvewx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvewx TRUE FALSE
+vec_lde int const_long_ptr = vec_s32_load_op vec_lvewx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvewx TRUE FALSE
+vec_lde int const_float_ptr = vec_f32_load_op vec_lvewx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvewx TRUE FALSE
+vec_ld int const_unsigned_char_ptr = vec_u8_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_unsigned_short_ptr = vec_u16_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_unsigned_int_ptr = vec_u32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_unsigned_long_ptr = vec_u32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_signed_char_ptr = vec_s8_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_short_ptr = vec_s16_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_int_ptr = vec_s32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_long_ptr = vec_s32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_float_ptr = vec_f32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ldl int const_unsigned_char_ptr = vec_u8_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_unsigned_short_ptr = vec_u16_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_unsigned_int_ptr = vec_u32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_unsigned_long_ptr = vec_u32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_signed_char_ptr = vec_s8_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_short_ptr = vec_s16_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_int_ptr = vec_s32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_long_ptr = vec_s32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_float_ptr = vec_f32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ld int const_vec_u8_ptr = vec_u8_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_u16_ptr = vec_u16_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_u32_ptr = vec_u32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_s8_ptr = vec_s8_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_s16_ptr = vec_s16_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_s32_ptr = vec_s32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_p16_ptr = vec_p16_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_b8_ptr = vec_b8_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_b16_ptr = vec_b16_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_b32_ptr = vec_b32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ld int const_vec_f32_ptr = vec_f32_load_op vec_lvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvx TRUE FALSE transform_lvx
+vec_ldl int const_vec_u8_ptr = vec_u8_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_u16_ptr = vec_u16_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_u32_ptr = vec_u32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_s8_ptr = vec_s8_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_s16_ptr = vec_s16_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_s32_ptr = vec_s32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_p16_ptr = vec_p16_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_b8_ptr = vec_b8_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_b16_ptr = vec_b16_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_b32_ptr = vec_b32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ldl int const_vec_f32_ptr = vec_f32_load_op vec_lvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvxl TRUE FALSE transform_lvx
+vec_ste vec_u8 int unsigned_char_ptr = void_store_op vec_stvebx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_u16 int unsigned_short_ptr = void_store_op vec_stvehx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_u32 int unsigned_int_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_u32 int unsigned_long_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_s8 int signed_char_ptr = void_store_op vec_stvebx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_s16 int short_ptr = void_store_op vec_stvehx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_s32 int int_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_s32 int long_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_f32 int float_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_p16 int short_ptr = void_store_op vec_stvehx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_p16 int unsigned_short_ptr = void_store_op vec_stvehx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_b8 int unsigned_char_ptr = void_store_op vec_stvebx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_b8 int signed_char_ptr = void_store_op vec_stvebx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_b16 int unsigned_short_ptr = void_store_op vec_stvebx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_b16 int short_ptr = void_store_op vec_stvebx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_b32 int unsigned_int_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_b32 int unsigned_long_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_b32 int int_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ste vec_b32 int long_ptr = void_store_op vec_stvewx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_st vec_u8 int unsigned_char_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_u16 int unsigned_short_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_u32 int unsigned_int_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_u32 int unsigned_long_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_s8 int signed_char_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_s16 int short_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_s32 int int_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_s32 int long_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_f32 int float_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_p16 int short_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_p16 int unsigned_short_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b8 int unsigned_char_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b8 int signed_char_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b16 int unsigned_short_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b16 int short_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b32 int unsigned_int_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b32 int unsigned_long_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b32 int int_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b32 int long_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_stl vec_u8 int unsigned_char_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_u16 int unsigned_short_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_u32 int unsigned_int_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_u32 int unsigned_long_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_s8 int signed_char_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_s16 int short_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_s32 int int_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_s32 int long_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_f32 int float_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_p16 int short_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_p16 int unsigned_short_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b8 int unsigned_char_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b8 int signed_char_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b16 int unsigned_short_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b16 int short_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b32 int unsigned_int_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b32 int unsigned_long_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b32 int int_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b32 int long_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_st vec_u8 int vec_u8_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_u16 int vec_u16_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_u32 int vec_u32_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_s8 int vec_s8_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_s16 int vec_s16_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_s32 int vec_s32_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b8 int vec_b8_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b16 int vec_b16_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_b32 int vec_b32_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_p16 int vec_p16_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_st vec_f32 int vec_f32_ptr = void_store_op vec_stvx BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvx FALSE FALSE transform_stvx
+vec_stl vec_u8 int vec_u8_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_u16 int vec_u16_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_u32 int vec_u32_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_s8 int vec_s8_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_s16 int vec_s16_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_s32 int vec_s32_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b8 int vec_b8_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b16 int vec_b16_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_b32 int vec_b32_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_p16 int vec_p16_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_stl vec_f32 int vec_f32_ptr = void_store_op vec_stvxl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_stvxl FALSE FALSE transform_stvx
+vec_lvsl int const_volatile_unsigned_char_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsl int const_volatile_unsigned_short_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsl int const_volatile_unsigned_int_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsl int const_volatile_unsigned_long_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsl int const_volatile_signed_char_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsl int const_volatile_short_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsl int const_volatile_int_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsl int const_volatile_long_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsl int const_volatile_float_ptr = vec_u8 vec_lvsl BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsl TRUE TRUE
+vec_lvsr int const_volatile_unsigned_char_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_lvsr int const_volatile_unsigned_short_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_lvsr int const_volatile_unsigned_int_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_lvsr int const_volatile_unsigned_long_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_lvsr int const_volatile_signed_char_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_lvsr int const_volatile_short_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_lvsr int const_volatile_int_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_lvsr int const_volatile_long_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_lvsr int const_volatile_float_ptr = vec_u8 vec_lvsr BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_lvsr TRUE TRUE
+vec_mfvscr = volatile_vec_u16 vec_mfvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_u8 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_u16 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_u32 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_s8 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_s16 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_s32 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_b8 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_b16 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_b32 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_mtvscr vec_p16 = volatile_void vec_mtvscr BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_dst const_unsigned_char_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_unsigned_short_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_unsigned_int_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_unsigned_long_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_signed_char_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_short_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_int_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_long_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_float_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dstt const_unsigned_char_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_unsigned_short_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_unsigned_int_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_unsigned_long_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_signed_char_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_short_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_int_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_long_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_float_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstst const_unsigned_char_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_unsigned_short_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_unsigned_int_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_unsigned_long_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_signed_char_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_short_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_int_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_long_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_float_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dststt const_unsigned_char_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_unsigned_short_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_unsigned_int_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_unsigned_long_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_signed_char_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_short_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_int_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_long_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_float_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dst const_vec_u8_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_u16_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_u32_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_s8_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_s16_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_s32_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_b8_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_b16_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_b32_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_p16_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dst const_vec_f32_ptr int immed_u2 = volatile_void_load_op vec_dst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dst TRUE FALSE
+vec_dstt const_vec_u8_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_u16_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_u32_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_s8_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_s16_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_s32_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_b8_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_b16_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_b32_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_p16_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstt const_vec_f32_ptr int immed_u2 = volatile_void_load_op vec_dstt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstt TRUE FALSE
+vec_dstst const_vec_u8_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_u16_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_u32_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_s8_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_s16_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_s32_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_b8_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_b16_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_b32_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_p16_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dstst const_vec_f32_ptr int immed_u2 = volatile_void_load_op vec_dstst BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dstst TRUE FALSE
+vec_dststt const_vec_u8_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_u16_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_u32_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_s8_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_s16_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_s32_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_b8_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_b16_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_b32_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_p16_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dststt const_vec_f32_ptr int immed_u2 = volatile_void_load_op vec_dststt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_dststt TRUE FALSE
+vec_dss immed_u2 = volatile_void_load_op vec_dss BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_dssall = volatile_void_load_op vec_dssall BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_add vec_f32 vec_f32 = vec_f32 vec_vaddfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_sub vec_f32 vec_f32 = vec_f32 vec_vsubfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_madd vec_f32 vec_f32 vec_f32 = vec_f32 vec_vmaddfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_nmsub vec_f32 vec_f32 vec_f32 = vec_f32 vec_vnmsubfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpgt vec_f32 vec_f32 = vec_b32 vec_vcmpgtfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpge vec_f32 vec_f32 = vec_b32 vec_vcmpgefp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpeq vec_f32 vec_f32 = vec_b32 vec_vcmpeqfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cmpb vec_f32 vec_f32 = vec_s32 vec_vcmpbfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_max vec_f32 vec_f32 = vec_f32 vec_vmaxfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_min vec_f32 vec_f32 = vec_f32 vec_vminfp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_re vec_f32 = vec_f32 vec_vrefp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_rsqrte vec_f32 = vec_f32 vec_vrsqrtefp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_loge vec_f32 = vec_f32 vec_vlogefp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_expte vec_f32 = vec_f32 vec_vexptefp BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_trunc vec_f32 = vec_f32 vec_vrfiz BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_round vec_f32 = vec_f32 vec_vrfin BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ceil vec_f32 = vec_f32 vec_vrfip BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_floor vec_f32 = vec_f32 vec_vrfim BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ctf vec_u32 immed_u5 = vec_f32 vec_vcfux BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ctf vec_s32 immed_u5 = vec_f32 vec_vcfsx BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_ctu vec_f32 immed_u5 = vec_u32 vec_vctuxs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_cts vec_f32 immed_u5 = vec_s32 vec_vctsxs BUILTIN_AFTER_TRAVERSE CFG_VEC
+vec_all_gt vec_u8 vec_u8 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_gt vec_u8 vec_b8 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_gt vec_b8 vec_u8 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_le vec_u8 vec_u8 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_le vec_u8 vec_b8 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_le vec_b8 vec_u8 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_gt vec_u8 vec_u8 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_gt vec_u8 vec_b8 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_gt vec_b8 vec_u8 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_le vec_u8 vec_u8 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_le vec_u8 vec_b8 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_le vec_b8 vec_u8 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_gt vec_s8 vec_s8 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_gt vec_s8 vec_b8 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_gt vec_b8 vec_s8 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_le vec_s8 vec_s8 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_le vec_s8 vec_b8 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_le vec_b8 vec_s8 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_gt vec_s8 vec_s8 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_gt vec_s8 vec_b8 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_gt vec_b8 vec_s8 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_le vec_s8 vec_s8 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_le vec_s8 vec_b8 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_le vec_b8 vec_s8 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_lt vec_u8 vec_u8 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_lt vec_u8 vec_b8 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_lt vec_b8 vec_u8 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_ge vec_u8 vec_u8 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_ge vec_u8 vec_b8 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_ge vec_b8 vec_u8 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_lt vec_u8 vec_u8 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_lt vec_u8 vec_b8 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_lt vec_b8 vec_u8 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_ge vec_u8 vec_u8 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_ge vec_u8 vec_b8 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_any_ge vec_b8 vec_u8 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtubD
+vec_all_lt vec_s8 vec_s8 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_lt vec_s8 vec_b8 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_lt vec_b8 vec_s8 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_ge vec_s8 vec_s8 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_ge vec_s8 vec_b8 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_ge vec_b8 vec_s8 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_lt vec_s8 vec_s8 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_lt vec_s8 vec_b8 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_lt vec_b8 vec_s8 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_ge vec_s8 vec_s8 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_ge vec_s8 vec_b8 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_any_ge vec_b8 vec_s8 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtsbD
+vec_all_gt vec_u16 vec_u16 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_gt vec_u16 vec_b16 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_gt vec_b16 vec_u16 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_le vec_u16 vec_u16 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_le vec_u16 vec_b16 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_le vec_b16 vec_u16 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_gt vec_u16 vec_u16 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_gt vec_u16 vec_b16 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_gt vec_b16 vec_u16 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_le vec_u16 vec_u16 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_le vec_u16 vec_b16 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_le vec_b16 vec_u16 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_gt vec_s16 vec_s16 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_gt vec_s16 vec_b16 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_gt vec_b16 vec_s16 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_le vec_s16 vec_s16 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_le vec_s16 vec_b16 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_le vec_b16 vec_s16 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_gt vec_s16 vec_s16 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_gt vec_s16 vec_b16 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_gt vec_b16 vec_s16 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_le vec_s16 vec_s16 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_le vec_s16 vec_b16 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_le vec_b16 vec_s16 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_lt vec_u16 vec_u16 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_lt vec_u16 vec_b16 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_lt vec_b16 vec_u16 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_ge vec_u16 vec_u16 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_ge vec_u16 vec_b16 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_ge vec_b16 vec_u16 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_lt vec_u16 vec_u16 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_lt vec_u16 vec_b16 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_lt vec_b16 vec_u16 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_ge vec_u16 vec_u16 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_ge vec_u16 vec_b16 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_any_ge vec_b16 vec_u16 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuhD
+vec_all_lt vec_s16 vec_s16 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_lt vec_s16 vec_b16 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_lt vec_b16 vec_s16 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_ge vec_s16 vec_s16 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_ge vec_s16 vec_b16 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_ge vec_b16 vec_s16 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_lt vec_s16 vec_s16 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_lt vec_s16 vec_b16 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_lt vec_b16 vec_s16 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_ge vec_s16 vec_s16 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_ge vec_s16 vec_b16 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_any_ge vec_b16 vec_s16 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtshD
+vec_all_gt vec_u32 vec_u32 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_gt vec_u32 vec_b32 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_gt vec_b32 vec_u32 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_le vec_u32 vec_u32 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_le vec_u32 vec_b32 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_le vec_b32 vec_u32 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_gt vec_u32 vec_u32 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_gt vec_u32 vec_b32 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_gt vec_b32 vec_u32 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_le vec_u32 vec_u32 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_le vec_u32 vec_b32 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_le vec_b32 vec_u32 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_gt vec_s32 vec_s32 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_gt vec_s32 vec_b32 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_gt vec_b32 vec_s32 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_le vec_s32 vec_s32 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_le vec_s32 vec_b32 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_le vec_b32 vec_s32 = cc26t vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_gt vec_s32 vec_s32 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_gt vec_s32 vec_b32 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_gt vec_b32 vec_s32 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_le vec_s32 vec_s32 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_le vec_s32 vec_b32 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_le vec_b32 vec_s32 = cc24f vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_lt vec_u32 vec_u32 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_lt vec_u32 vec_b32 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_lt vec_b32 vec_u32 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_ge vec_u32 vec_u32 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_ge vec_u32 vec_b32 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_ge vec_b32 vec_u32 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_lt vec_u32 vec_u32 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_lt vec_u32 vec_b32 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_lt vec_b32 vec_u32 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_ge vec_u32 vec_u32 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_ge vec_u32 vec_b32 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_any_ge vec_b32 vec_u32 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtuwD
+vec_all_lt vec_s32 vec_s32 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_lt vec_s32 vec_b32 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_lt vec_b32 vec_s32 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_ge vec_s32 vec_s32 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_ge vec_s32 vec_b32 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_ge vec_b32 vec_s32 = cc26tr vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_lt vec_s32 vec_s32 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_lt vec_s32 vec_b32 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_lt vec_b32 vec_s32 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_ge vec_s32 vec_s32 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_ge vec_s32 vec_b32 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_any_ge vec_b32 vec_s32 = cc24fr vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtswD
+vec_all_eq vec_u8 vec_u8 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_eq vec_u8 vec_b8 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_eq vec_b8 vec_u8 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_eq vec_b8 vec_b8 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_ne vec_u8 vec_u8 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_ne vec_u8 vec_b8 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_ne vec_b8 vec_u8 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_ne vec_b8 vec_b8 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_eq vec_u8 vec_u8 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_eq vec_u8 vec_b8 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_eq vec_b8 vec_u8 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_eq vec_b8 vec_b8 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_ne vec_u8 vec_u8 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_ne vec_u8 vec_b8 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_ne vec_b8 vec_u8 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_ne vec_b8 vec_b8 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_eq vec_s8 vec_s8 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_eq vec_s8 vec_b8 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_eq vec_b8 vec_s8 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_ne vec_s8 vec_s8 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_ne vec_s8 vec_b8 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_ne vec_b8 vec_s8 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_eq vec_s8 vec_s8 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_eq vec_s8 vec_b8 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_eq vec_b8 vec_s8 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_ne vec_s8 vec_s8 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_ne vec_s8 vec_b8 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_any_ne vec_b8 vec_s8 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequbD
+vec_all_eq vec_u16 vec_u16 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_eq vec_u16 vec_b16 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_eq vec_b16 vec_u16 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_eq vec_b16 vec_b16 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_eq vec_p16 vec_p16 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_ne vec_u16 vec_u16 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_ne vec_u16 vec_b16 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_ne vec_b16 vec_u16 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_ne vec_b16 vec_b16 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_ne vec_p16 vec_p16 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_eq vec_u16 vec_u16 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_eq vec_u16 vec_b16 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_eq vec_b16 vec_u16 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_eq vec_b16 vec_b16 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_eq vec_p16 vec_p16 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_ne vec_u16 vec_u16 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_ne vec_u16 vec_b16 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_ne vec_b16 vec_u16 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_ne vec_b16 vec_b16 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_ne vec_p16 vec_p16 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_eq vec_s16 vec_s16 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_eq vec_s16 vec_b16 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_eq vec_b16 vec_s16 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_ne vec_s16 vec_s16 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_ne vec_s16 vec_b16 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_ne vec_b16 vec_s16 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_eq vec_s16 vec_s16 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_eq vec_s16 vec_b16 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_eq vec_b16 vec_s16 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_ne vec_s16 vec_s16 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_ne vec_s16 vec_b16 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_any_ne vec_b16 vec_s16 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequhD
+vec_all_eq vec_u32 vec_u32 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_eq vec_u32 vec_b32 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_eq vec_b32 vec_u32 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_eq vec_b32 vec_b32 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_ne vec_u32 vec_u32 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_ne vec_u32 vec_b32 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_ne vec_b32 vec_u32 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_ne vec_b32 vec_b32 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_eq vec_u32 vec_u32 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_eq vec_u32 vec_b32 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_eq vec_b32 vec_u32 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_eq vec_b32 vec_b32 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_ne vec_u32 vec_u32 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_ne vec_u32 vec_b32 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_ne vec_b32 vec_u32 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_ne vec_b32 vec_b32 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_eq vec_s32 vec_s32 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_eq vec_s32 vec_b32 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_eq vec_b32 vec_s32 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_ne vec_s32 vec_s32 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_ne vec_s32 vec_b32 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_ne vec_b32 vec_s32 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_eq vec_s32 vec_s32 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_eq vec_s32 vec_b32 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_eq vec_b32 vec_s32 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_ne vec_s32 vec_s32 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_ne vec_s32 vec_b32 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_any_ne vec_b32 vec_s32 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpequwD
+vec_all_gt vec_f32 vec_f32 = cc24t vec_all_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfpD
+vec_all_ngt vec_f32 vec_f32 = cc26t vec_all_ngt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfpD
+vec_any_ngt vec_f32 vec_f32 = cc24f vec_any_ngt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfpD
+vec_any_gt vec_f32 vec_f32 = cc26f vec_any_gt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfpD
+vec_all_lt vec_f32 vec_f32 = cc24tr vec_all_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfpD
+vec_all_nlt vec_f32 vec_f32 = cc26tr vec_all_nlt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfpD
+vec_any_nlt vec_f32 vec_f32 = cc24fr vec_any_nlt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfpD
+vec_any_lt vec_f32 vec_f32 = cc26fr vec_any_lt BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgtfpD
+vec_all_ge vec_f32 vec_f32 = cc24t vec_all_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefpD
+vec_all_nge vec_f32 vec_f32 = cc26t vec_all_nge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefpD
+vec_any_nge vec_f32 vec_f32 = cc24f vec_any_nge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefpD
+vec_any_ge vec_f32 vec_f32 = cc26f vec_any_ge BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefpD
+vec_all_le vec_f32 vec_f32 = cc24tr vec_all_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefpD
+vec_all_nle vec_f32 vec_f32 = cc26tr vec_all_nle BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefpD
+vec_any_nle vec_f32 vec_f32 = cc24fr vec_any_nle BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefpD
+vec_any_le vec_f32 vec_f32 = cc26fr vec_any_le BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpgefpD
+vec_all_eq vec_f32 vec_f32 = cc24t vec_all_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpeqfpD
+vec_all_ne vec_f32 vec_f32 = cc26t vec_all_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpeqfpD
+vec_any_ne vec_f32 vec_f32 = cc24f vec_any_ne BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpeqfpD
+vec_any_eq vec_f32 vec_f32 = cc26f vec_any_eq BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpeqfpD
+vec_all_numeric vec_f32 = cc24td vec_all_numeric BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpeqfpD
+vec_all_nan vec_f32 = cc26td vec_all_nan BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpeqfpD
+vec_any_nan vec_f32 = cc24fd vec_any_nan BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpeqfpD
+vec_any_numeric vec_f32 = cc26fd vec_any_numeric BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpeqfpD
+vec_all_in vec_f32 vec_f32 = cc26t vec_all_in BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpbfpD
+vec_any_out vec_f32 vec_f32 = cc26f vec_any_out BUILTIN_AFTER_TRAVERSE CFG_VEC FALSE MOP_vcmpbfpD
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
index ab2e6ae05c1..64372207924 100644
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -3,18 +3,23 @@ darwin.o: $(srcdir)/config/darwin.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
conditions.h insn-flags.h output.h insn-attr.h flags.h $(TREE_H) expr.h \
reload.h function.h $(GGC_H) langhooks.h $(TARGET_H) $(TM_P_H) gt-darwin.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin.c
+# APPLE LOCAL constant CFStrings
+darwin.o: $(HASHTAB_H) toplev.h
+# APPLE LOCAL begin pragma fenv
darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(CPPLIB_H) tree.h c-pragma.h $(C_TREE_H) toplev.h $(TM_P_H) \
- c-incpath.h
+ c-incpath.h options.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin-c.c $(PREPROCESSOR_DEFINES)
+# APPLE LOCAL end pragma fenv
gt-darwin.h : s-gtype ; @true
# Explain how to build crt2.o
$(T)crt2$(objext): $(srcdir)/config/darwin-crt2.c $(GCC_PASSES) \
$(TCONFIG_H) stmp-int-hdrs tsystem.h
- $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) \
+ # APPLE LOCAL use -mlongcall for large text support
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -mlongcall \
-c $(srcdir)/config/darwin-crt2.c -o $(T)crt2$(objext)
# Use unwind-dw2-fde-darwin
diff --git a/gcc/configure b/gcc/configure
index a59f4520531..505c54cb77f 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -7206,6 +7206,158 @@ test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+# APPLE LOCAL Mach time
+
+for ac_header in mach/mach_time.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+ yes:no: )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+ ac_header_preproc=yes
+ ;;
+ no:yes:* )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------------ ##
+## Report this to the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=\$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
# See if cmp has --ignore-initial.
echo "$as_me:$LINENO: checking for cmp's capabilities" >&5
echo $ECHO_N "checking for cmp's capabilities... $ECHO_C" >&6
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 6c81f210474..3fddc829367 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -776,6 +776,10 @@ AC_SUBST(ranlib_flags)
gcc_AC_PROG_INSTALL
+# APPLE LOCAL begin Mach time
+AC_CHECK_HEADERS(mach/mach_time.h)
+# APPLE LOCAL end Mach time
+
# See if cmp has --ignore-initial.
gcc_AC_PROG_CMP_IGNORE_INITIAL
diff --git a/gcc/convert.c b/gcc/convert.c
index 005d3e2089b..da988d4ae19 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -30,6 +30,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tree.h"
#include "flags.h"
#include "convert.h"
+/* APPLE LOCAL begin AltiVec */
+#include "c-tree.h"
+#include "c-common.h"
+/* APPLE LOCAL end AltiVec */
#include "toplev.h"
#include "langhooks.h"
#include "real.h"
@@ -722,6 +726,31 @@ convert_to_complex (tree type, tree expr)
}
}
+/* APPLE LOCAL begin AltiVec */
+/* Build a COMPOUND_LITERAL_EXPR. TYPE is the type given in the compound
+ literal. INIT is a CONSTRUCTOR that initializes the compound literal. */
+
+static tree
+build_compound_literal_vector (tree type, tree init)
+{
+ tree decl;
+ tree complit;
+ tree stmt;
+
+ decl = build_decl (VAR_DECL, NULL_TREE, type);
+ DECL_EXTERNAL (decl) = 0;
+ TREE_PUBLIC (decl) = 0;
+ TREE_USED (decl) = 1;
+ TREE_TYPE (decl) = type;
+ TREE_READONLY (decl) = TYPE_READONLY (type);
+ store_init_value (decl, init);
+ stmt = build_stmt (DECL_EXPR, decl);
+ complit = build1 (COMPOUND_LITERAL_EXPR, TREE_TYPE (decl), stmt);
+ layout_decl (decl, 0);
+ return complit;
+}
+/* APPLE LOCAL end AltiVec */
+
/* Convert EXPR to the vector type TYPE in the usual ways. */
tree
@@ -736,6 +765,14 @@ convert_to_vector (tree type, tree expr)
error ("can't convert between vector values of different size");
return error_mark_node;
}
+ /* APPLE LOCAL begin AltiVec */
+ if (TREE_CODE (type) == VECTOR_TYPE
+ && TREE_CODE (TREE_TYPE (expr)) == VECTOR_TYPE
+ && TREE_CODE (expr) == CONSTRUCTOR && TREE_CONSTANT (expr))
+ /* converting a constant vector to new vector type with Motorola Syntax. */
+ return convert (type, build_compound_literal_vector (TREE_TYPE (expr), expr));
+ /* APPLE LOCAL end AltiVec */
+
return build1 (NOP_EXPR, type, expr);
default:
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index acb2c9ea8df..e2369441055 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -49,6 +49,8 @@ typedef union tree_node *tree;
Note that the cpp_reader typedef remains part of cpplib.h. */
struct cpp_reader;
+/* APPLE LOCAL AltiVec */
+struct cpp_token;
/* The thread-local storage model associated with a given VAR_DECL
or SYMBOL_REF. This isn't used much, but both trees and RTL refer
diff --git a/gcc/cp/ChangeLog.apple-ppc b/gcc/cp/ChangeLog.apple-ppc
new file mode 100644
index 00000000000..6186b3cedd9
--- /dev/null
+++ b/gcc/cp/ChangeLog.apple-ppc
@@ -0,0 +1,392 @@
+2005-03-07 Devang Patel <dpatel@apple.com>
+
+ * class.c (tree-iterator.h): Include.
+
+2005-03-02 Robert Bowdidge <bowdidge@apple.com
+ Radar 4025293
+ * cp/typeck.c (convert_member_func_to_ptr) Ban casts from pointer-to-
+ member-function to pointer-to-function whenever the -fapple-kext flag
+ was passed to the compiler. Behavior changed between 3.3 and 4.0 in
+ incompatible ways, and the IOKit team wants all kexts to use a macro
+ that provides the correct (3.3) behavior.
+
+2005-02-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3809189
+ * typeck2.c (digest_init): Factor out Pascal-ness of string
+ initializer; allow NUL terminator to not fit into the array
+ being initialized.
+
+2005-02-18 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4011192
+ * parser.c (cp_parser_objc_try_catch_finally_statement): When
+ parsing '@finally' blocks, make sure the compound statement
+ winds up in a special STATEMENT_LIST instead of current scope.
+ (cp_parser_objc_synchronized_statement): Likewise for
+ '@synchronized' blocks.
+
+2005-02-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3635843, 3922342
+ * tree.c (lvalue_or_else): Do not emit warning if
+ '-Wno-non-lvalue-assign' has been specified.
+ * typeck.c (build_modify_expr): Call
+ objc_generate_write_barrier() if '-fobjc-gc' has been specified.
+
+2005-02-16 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3971074
+
+ * parser.c (cp_parser_cw_asm_statement): Pass lineno to cw_asm_stmt.
+
+2005-02-16 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3970655
+
+ * cp/parser.c (cw_build_identifier_string): New function.
+ (cp_parser_cw_identifier): Build the tree for a '.'identifier.
+ (cp_parser_cw_asm_postfix_expression): Some disambiguation case.
+
+2005-02-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3993052
+ * parser.c (cp_parser_objc_interstitial_code): New routine.
+ (cp_parser_objc_method_prototype_list): Call
+ cp_parser_objc_interstitial_code() instead of doing
+ non-ObjC++ parsing locally.
+ (cp_parser_objc_method_definition_list): Likewise.
+
+2005-02-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3982256
+ * cp-objcp-common.h (cxx_get_alias_set,
+ cxx_warn_unused_global_decl, cp_expr_size, cp_tree_size,
+ cp_var_mod_type_p, cxx_initialize_diagnostics,
+ cxx_types_compatible_p): Move prototypes ...
+ * cp-tree.h: ... here.
+
+2005-02-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3987120
+ * parser.c (cp_parser_objc_encode_expression): Call
+ 'complete_type (cp_parser_type_id ())' instead of
+ 'cp_parser_objc_typename ()' to retrieve argument type.
+
+2005-02-02 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3978104
+ * parser.c (cp_parser_objc_method_prototype_list): Allow stray
+ semicolons in between method signatures.
+
+2005-01-31 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3978168
+ * tree.c (lvalue_or_else): Allow certain non-lvalues
+ as arguments to '&', and print appropriate warning.
+
+2005-01-27 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3971244
+ * typeck.c (composite_pointer_type): Check for
+ ObjC subtype relations.
+
+2005-01-26 Matt Austern <austern@apple.com>
+
+ Radar 3972840
+ * call.c (build_over_call): Set type of function node correctly.
+ Type returned by build_vfn_ref_using_vtable is *not* what we
+ want.
+ * class.c (build_vfn_ref_using_vtable): Duplicate logic in
+ build_vfn_ref for setting attributes of vtable array ref node.
+
+2005-01-26 Devang Patel <dpatel@apple.com>
+
+ Radar 3971329
+ * parser.c (cp_parser_objc_method_definition_list): Parse extern
+ linkage specification.
+
+2005-01-24 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3968938
+ * parser.c (cp_parser_simple_type_specifier): After
+ constructing a protocol-qualified ObjC type, record
+ it in the DECL_SPECS structure.
+
+2005-01-23 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3961973
+ * cp-tree.h (lvalue_or_else): Change type of first parameter
+ from 'tree' to 'tree *'.
+ * tree.c (lvalue_or_else): Change first parameter from
+ 'tree' to 'tree *'; handle conditional lvalues in addition
+ to lvalue casts; when rewriting expressions, create a new
+ tree instead of clobbering an existing one.
+ * typeck.c (build_unary_op, build_modify_expr): Adjust
+ calls to lvalue_or_else().
+
+2005-01-19 Matt Austern <austern@apple.com>
+
+ Radar 3960754
+ * typeck.c (comptypes): Handle return code from objc_comptypes
+ correctly.
+
+2005-01-18 Mike Stump <mrs@apple.com>
+
+ Radar 3956093
+ * class.c (has_apple_kext_compatibility_attr_p): Avoid problems
+ when there are no base classes.
+
+2005-01-18 Ziemowit Laski <zlaski@apple.com>
+
+ * parser.c (cp_parser_cw_identifier): Reapply change
+ just reverted.
+
+2005-01-18 Ziemowit Laski <zlaski@apple.com>
+
+ * parser.c (cp_parser_cw_identifier): Revert change
+ from 2005-01-14.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3955336
+ * parser.c (cp_parser_objc_message_receiver): Try parsing
+ receiver as an expression first; failing that, as a
+ nested type.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3951689
+ * parser.c (cp_parser_objc_try_catch_finally_statement,
+ cp_parser_objc_synchronized_statement, cp_parser_objc_throw_statement
+ cp_parser_objc_statement): New functions.
+ (cp_parser_statement): Call cp_parser_objc_statement() to
+ parse Objective-C statements.
+
+2005-01-15 Geoffrey Keating <geoffk@apple.com>
+
+ * g++spec.c: Remove APPLE LOCAL changes involving
+ macosx_version_min_required.
+
+2005-01-14 Ziemowit Laski <zlaski@apple.com>
+
+ * parser.c (cp_parser_cw_identifier): Add a default:
+ to squash compiler warnings.
+
+2005-01-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3913725
+ * tree.c (lvalue_or_else): If expression is not an lvalue,
+ check if it is a cast of an lvalue; if so, and if the cast
+ involves POD types with identical size and aligment,
+ rewrite '(type)expr' into '*(type *)&expr' and allow the
+ result as an lvalue.
+
+2005-01-07 Devang Patel <dpatel@apple.com>
+
+ Radar 3943502
+ * parser.c (cp_parser_objc_defs_expression): New.
+ (cp_parser_member_declaration): Handle @defs.
+
+2005-01-06 Robert Bowdidge <bowdidge@apple.com>
+
+ Radar 3943783
+ * class.c: change has_apple_kext_compatibility_attr_p to use
+ BINFO_BASE_BINFO for walking class hierarchy.
+
+2005-01-06 Devang Patel <dpatel@apple.com>
+
+ Radar 3941766
+ * parser.c (cp_parser_objc_class_ivars): Add '}' check.
+
+2005-01-05 Mark Mitchell <mark@codesourcery.com>
+ Matt Austern <austern@apple.com>
+
+ Radar 3934803
+ PR c++/18369
+ * init.c (build_new_1): Handle parenthesized type-ids that name an
+ array type. Tidy.
+
+2004-12-20 Matt Austern <austern@apple.com>
+
+ Radar 3845716
+ PR c++/19044
+ * decl.c (make_rtl_for_nonlocal_decl): Use set_builtin_user_assembler_name
+
+2004-12-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3640156, 3877958
+ * decl.c (builtin_function_1): Do not require subsequent declarations
+ for AltiVec PIM builtins.
+
+2004-12-07 Mike Stump <mrs@apple.com>
+
+ Radar 3603833, 3896176, 3518821.
+ * parser.c (cp_parser_binary_expression): Add support for lines
+ that start with named operators such as and.
+ (cp_parser_cw_identifier): Move reused code from here to
+ cw_get_identifier.
+
+2004-11-17 Mike Stump <mrs@apple.com>
+
+ Radar 3860322
+ g++.dg/asm-block-3.C
+ * parser.c (cp_parser_cw_identifier): Handle C++ keywords like
+ and, or, xor in CW asm blocks.
+
+2004-11-14 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3877761
+ * parser.c (cp_parser_objc_class_ivars): Allow an optional
+ trailing semicolon, per existing usage.
+
+2004-11-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3761423
+ * typeck.c (finish_class_member_access_expr): Insert call to
+ objc_is_public() to check ObjC ivar access.
+
+2004-11-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3869280
+ * tree.c (lvalue_p_1): Determine lvalue-ness of CONST_DECLs the same
+ way as for VAR_DECLs.
+
+2004-11-03 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3863563 (fix from mainline)
+ * cp-lang.c (cxx_types_compatible_p): Remove prototype and definition.
+ (LANG_HOOKS_TYPES_COMPATIBLE_P): Move to cp-objcp-common.h.
+ * cp-objcp-common.c (cxx_types_compatible_p): Moved definition here
+ from cp-lang.c.
+ * cp-objcp-common.h (cxx_types_compatible_p): Moved prototype here
+ from cp-lang.c.
+ (LANG_HOOKS_TYPES_COMPATIBLE_P): Moved here from cp-lang.c.
+
+2004-11-01 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 2810013
+ * parser.c (cp_parser_primary_expression): Perform instace variable
+ lookup in conjunction with C++ identifier expression lookup.
+ (cp_parser_postfix_expression): Moved instance variable lookup
+ to cp_parser_primary_expression().
+
+2004-10-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3540965
+ * parser.c (cp_parser_postfix_expression): Do not forget to parse
+ the rhs of a postfix expression when the lhs is an instance variable.
+
+2004-10-18 Robert Bowdidge <bowdidge@apple.com>
+
+ Radar 3843618
+ * gcc/cp/parser.c: Bring the change for PR/17829 over from mainline
+ so that Finder_FE will build again.
+
+2004-10-13 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3677258
+ * cp-tree.h (struct lang_identifier): Add 'interface_value' field.
+
+2004-09-14 Andrew Pinski <apinski@apple.com>
+
+ Rest of Radar 3753405
+ * cp-tree.h (enum cp_decl_sepcs): Add ds_cw_asm.
+ * decl.c (grokdeclarator): Rename cw_asm_specbit to cw_asm_p to mirror
+ the other specbits.
+ Access specbits for cw_asm.
+ Add "asm" to decl_specs_names.
+ Remove MERGE FIXME comment.
+ * parser.c (cp_parser_decl_specifier_seq, <case RID_ASM>): Mirror the
+ other decl spec bits.
+
+2004-08-22 Andrew Pinski <apinski@apple.com>
+
+ Revert:
+ 2004-08-22 Andrew Pinski <apinski@apple.com>
+ PR c++/14029
+ * typeck.c (build_unary_op): Use &a.b if the foldded lowered
+ expression is not constant.
+
+2004-08-22 Andrew Pinski <apinski@apple.com>
+
+ PR c++/14029
+ * typeck.c (build_unary_op): Use &a.b if the foldded lowered
+ expression is not constant.
+
+2004-08-10 Devang Patel <dpatel@apple.com>
+
+ Remove Symbol Separation.
+ Radar 3555440. Reviewed by Mike Stump.
+ * decl2.c (finish_file): Do not write context.
+
+2004-08-08 Andrew Pinski <apinski@apple.com>
+
+ * cp/lex.c (cxx_init): Remove APPLE LOCAL for setting -gused
+ by default as it is handled in CC1_SPECs now.
+
+2004-08-03 Stan Shebs <shebs@apple.com>
+
+ Support for CodeWarrior-style assembly language blocks and
+ functions. Radar 3368707.
+ * cp-tree.h (cw_asm_cp_build_component_ref): Declare.
+ * decl.c (grokdeclarator): Recognize asm keyword, set flag
+ on function decl if seen.
+ * parser.c (cp_lexer_get_preprocessor_token): Allow @-tokens
+ if doing asm.
+ (cp_parser_primary_expression): Recognize @-tokens in asm,
+ replace with @-identifier (which will become a label) later.
+ (cp_parser_unary_expression): Call asm-specific postfix
+ expression handler.
+ (cp_parser_compound_statement): Handle asm compound statements
+ specially.
+ (cp_parser_statement_seq_opt): Handle statement sequences in
+ asm blocks specially.
+ (cp_parser_simple_declaration): Leave instead of erroring out
+ if apparent asm opcode is seen.
+ (cp_parser_decl_specifier_seq,
+ cp_parser_storage_class_specifier_opt): Accept RID_ASM as a specifier.
+ (cp_parser_asm_definition): Detect asm blocks and handle.
+ (cp_parser_cw_asm_compound_statement,
+ cp_parser_cw_asm_declaration_seq_opt, cp_parser_cw_asm_line_seq_opt,
+ cp_parser_cw_asm_line, cp_parser_cw_asm_statement_seq_opt,
+ cp_parser_cw_asm_statement, cp_parser_cw_asm_operands,
+ cp_parser_cw_asm_operand, cp_parser_cw_asm_postfix_expression,
+ cw_asm_typename_or_reserved): New functions.
+ semantics.c (finish_id_expression): Handle register names
+ and labels in asm blocks specially.
+ * typeck.c (cw_asm_cp_build_component_ref): New function.
+
+2004-08-01 Devang Patel <dpatel@apple.com>
+
+ Re-implement -fwritable-strings support.
+ Radar : 3699482
+
+ * decl.c (cxx_init_decl_processing): Check flag_writable_strings.
+
+2004-08-01 Geoffrey Keating <geoffk@apple.com>
+
+ * decl.c (grokdeclarator): Don't call warn_about_long_double.
+
+2004-06-08 Fariborz Jahanian <fjahanian@apple.com>
+
+ * decl2.c (maybe_emit_vtables, get_guard):
+ Remove all APPLE LOCAL coalescing codes.
+ (import_export_decl): Remove all APPLE LOCAL coalescing codes,
+ except for one call to comdat_linkage.
+
+2004-06-08 Fariborz Jahanian <fjahanian@apple.com>
+
+ * decl2.c (maybe_emit_vtables, import_export_decl, get_guard):
+ Resore various APPLE LOCAL coalescing codes.
+
+2004-06-07 Fariborz Jahanian <fjahanian@apple.com>
+
+ * decl2.c (maybe_emit_vtables, import_export_decl, get_guard):
+ Remove various APPLE LOCAL coalescing codes.
+
+2004-04-02 Ziemowit Laski <zlaski@apple.com>
+
+ Remove APPLE LOCAL AltiVec code whenever possible; merge in
+ AltiVec/VECTOR_TYPE-handling code from mainline.
+
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 00075b30a9f..6347afc19f7 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -70,6 +70,15 @@ g++-cross$(exeext): g++$(exeext)
-rm -f g++-cross$(exeext)
cp g++$(exeext) g++-cross$(exeext)
+# APPLE LOCAL begin order files --ilr
+ifeq ($(ORDER_FILES),yes)
+CC1PLUS_ORDER_FLAGS = `if [ -f $(srcdir)/../order-files/cc1plus.order ]; then \
+ echo -sectorder __TEXT __text $(srcdir)/../order-files/cc1plus.order -e start ; fi`
+else
+CC1PLUS_ORDER_FLAGS =
+endif
+# APPLE LOCAL end order files --ilr
+
# The compiler itself.
# Shared with C front end:
CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \
@@ -91,9 +100,12 @@ CXX_OBJS = cp/cp-lang.o stub-objc.o $(CXX_AND_OBJCXX_OBJS)
# Use strict warnings for this front end.
cp-warn = $(STRICT_WARN)
+# APPLE LOCAL begin order files --ilr
cc1plus$(exeext): $(CXX_OBJS) $(BACKEND) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
- $(CXX_OBJS) $(BACKEND) $(LIBS)
+ $(CXX_OBJS) $(BACKEND) $(LIBS) \
+ $(CC1PLUS_ORDER_FLAGS)
+# APPLE LOCAL end order files --ilr
# Special build rules.
$(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf
@@ -253,16 +265,20 @@ cp/method.o: cp/method.c $(CXX_TREE_H) $(TM_H) toplev.h $(RTL_H) $(EXPR_H) \
$(TM_P_H) $(TARGET_H) gt-cp-method.h
cp/cvt.o: cp/cvt.c $(CXX_TREE_H) $(TM_H) cp/decl.h flags.h toplev.h convert.h
cp/search.o: cp/search.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H)
+# APPLE LOCAL begin Objective-C++
cp/tree.o: cp/tree.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h $(RTL_H) \
- insn-config.h integrate.h tree-inline.h real.h gt-cp-tree.h $(TARGET_H)
+ insn-config.h integrate.h tree-inline.h real.h gt-cp-tree.h $(TARGET_H) debug.h
+# APPLE LOCAL end Objective-C++
cp/ptree.o: cp/ptree.c $(CXX_TREE_H) $(TM_H)
cp/rtti.o: cp/rtti.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h convert.h
cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) except.h toplev.h \
cp/cfns.h $(EXPR_H) libfuncs.h tree-inline.h
cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \
except.h $(TM_P_H)
-cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h \
- toplev.h $(RTL_H) except.h tree-inline.h pointer-set.h gt-cp-pt.h
+# APPLE LOCAL begin Objective-C++
+cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \
+ toplev.h $(RTL_H) except.h tree-inline.h pointer-set.h gt-cp-pt.h c-common.h
+# APPLE LOCAL end Objective-C++
cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
flags.h real.h $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H)
cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h diagnostic.h \
@@ -276,8 +292,10 @@ cp/optimize.o: cp/optimize.c $(CXX_TREE_H) $(TM_H) rtl.h integrate.h insn-config
cp/mangle.o: cp/mangle.c $(CXX_TREE_H) $(TM_H) toplev.h real.h gt-cp-mangle.h \
$(TARGET_H) $(TM_P_H)
+# APPLE LOCAL begin Objective-C++
cp/parser.o: cp/parser.c $(CXX_TREE_H) $(TM_H) diagnostic.h gt-cp-parser.h \
- output.h
+ output.h c-common.h
+# APPLE LOCAL end Objective-C++
cp/cp-gimplify.o: cp/cp-gimplify.c $(CXX_TREE_H) toplev.h c-common.h \
$(TM_H) coretypes.h pointer-set.h
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 4655430a2bd..13bbf4caf52 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4079,6 +4079,36 @@ enforce_access (tree basetype_path, tree decl)
return true;
}
+/* APPLE LOCAL begin direct-binding-refs 20020224 --turly */
+
+/* Should we *really* call a constructor for the object whose reference type
+ we want? If we have a user conversion function which returns the ref
+ type directly, there's no need to call the object's constructor as we
+ can bind directly (dcl.init.ref.)
+
+ These must be exactly the same types. */
+
+static int really_call_constructor_p (tree, tree, tree);
+static int
+really_call_constructor_p (tree expr, tree convfn, tree totype)
+{
+ /* TEMPORARILY DISABLING THIS "FIX" NOW WE HAVE A SOURCE WORKAROUND. */
+ /* However, we'll leave the code here pending input from the FSF
+ on this issue. */
+
+ if (0 /* && ! NEED_TEMPORARY_P (convfn) Watch out! this macro is undefined */
+ && TREE_CODE (expr) == INDIRECT_REF
+ && TREE_CODE (TREE_TYPE (convfn)) == METHOD_TYPE
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (convfn))) == REFERENCE_TYPE
+ && TREE_CODE (TREE_TYPE (TREE_TYPE (TREE_TYPE (convfn)))) == RECORD_TYPE
+ && TREE_TYPE (TREE_TYPE (TREE_TYPE (convfn))) == totype
+ && TREE_TYPE (expr) == totype)
+ return 0;
+
+ return 1;
+}
+/* APPLE LOCAL end direct-binding-refs 20020224 --turly */
+
/* Check that a callable constructor to initialize a temporary of
TYPE from an EXPR exists. */
@@ -4246,6 +4276,8 @@ convert_like_real (conversion *convs, tree expr, tree fn, int argnum,
If the target is a class, that means call a ctor. */
if (IS_AGGR_TYPE (totype)
+ /* APPLE LOCAL direct-binding-refs 20020224 --turly */
+ && really_call_constructor_p (expr, convfn, totype)
&& (inner >= 0 || !lvalue_p (expr)))
{
expr = (build_temp
@@ -4904,7 +4936,11 @@ build_over_call (struct z_candidate *cand, int flags)
mark_used (fn);
- if (DECL_VINDEX (fn) && (flags & LOOKUP_NONVIRTUAL) == 0)
+ /* APPLE LOCAL begin KEXT indirect-virtual-calls --sts */
+ if (DECL_VINDEX (fn)
+ && (flag_apple_kext
+ || (flags & LOOKUP_NONVIRTUAL) == 0))
+ /* APPLE LOCAL end KEXT indirect-virtual-calls --sts */
{
tree t, *p = &TREE_VALUE (converted_args);
tree binfo = lookup_base (TREE_TYPE (TREE_TYPE (*p)),
@@ -4918,6 +4954,31 @@ build_over_call (struct z_candidate *cand, int flags)
t = build_pointer_type (TREE_TYPE (fn));
if (DECL_CONTEXT (fn) && TYPE_JAVA_INTERFACE (DECL_CONTEXT (fn)))
fn = build_java_interface_fn_ref (fn, *p);
+ /* APPLE LOCAL begin KEXT indirect-virtual-calls --sts */
+ /* If this is not really supposed to be a virtual call, find the
+ vtable corresponding to the correct type, and use it. */
+ else if (flags & LOOKUP_NONVIRTUAL) {
+ tree call_site_type = TREE_TYPE (cand->access_path);
+ tree fn_class_type = DECL_CLASS_CONTEXT (fn);
+
+ gcc_assert (call_site_type != NULL &&
+ fn_class_type != NULL &&
+ AGGREGATE_TYPE_P (call_site_type) &&
+ AGGREGATE_TYPE_P (fn_class_type));
+ gcc_assert (lookup_base(TYPE_MAIN_VARIANT (call_site_type),
+ TYPE_MAIN_VARIANT (fn_class_type),
+ ba_any | ba_quiet,
+ NULL) != NULL);
+
+ if (BINFO_N_BASE_BINFOS (TYPE_BINFO (call_site_type)) > 1
+ || CLASSTYPE_VBASECLASSES (call_site_type))
+ error ("indirect virtual calls are invalid for a type that uses multiple or virtual inheritance");
+
+ fn = (build_vfn_ref_using_vtable
+ (BINFO_VTABLE (TYPE_BINFO (call_site_type)),
+ DECL_VINDEX (fn)));
+ }
+ /* APPLE LOCAL end KEXT indirect-virtual-calls --sts */
else
fn = build_vfn_ref (*p, DECL_VINDEX (fn));
TREE_TYPE (fn) = t;
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index ae73f522121..1a3cee35a49 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -35,6 +35,8 @@ Boston, MA 02111-1307, USA. */
#include "toplev.h"
#include "target.h"
#include "convert.h"
+/* APPLE LOCAL KEXT */
+#include "tree-iterator.h"
/* The number of nested classes being processed. If we are not in the
scope of any class, this is zero. */
@@ -214,6 +216,10 @@ int n_compute_conversion_costs = 0;
int n_inner_fields_searched = 0;
#endif
+/* APPLE LOCAL begin Macintosh alignment 2002-5-24 --ff */
+extern int darwin_align_is_first_member_of_class;
+/* APPLE LOCAL end Macintosh alignment 2002-5-24 --ff */
+
/* Convert to or from a base subobject. EXPR is an expression of type
`A' or `A*', an expression of type `B' or `B*' is returned. To
convert A to a base B, CODE is PLUS_EXPR and BINFO is the binfo for
@@ -578,6 +584,12 @@ build_vtbl_ref_1 (tree instance, tree idx)
assemble_external (vtbl);
+ /* APPLE LOCAL begin KEXT double destructor */
+#ifdef ADJUST_VTABLE_INDEX
+ ADJUST_VTABLE_INDEX (idx, vtbl);
+#endif
+ /* APPLE LOCAL end KEXT double destructor */
+
aref = build_array_ref (vtbl, idx);
TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx);
TREE_INVARIANT (aref) = TREE_CONSTANT (aref);
@@ -615,6 +627,32 @@ build_vfn_ref (tree instance_ptr, tree idx)
return aref;
}
+/* APPLE LOCAL begin KEXT indirect-virtual-calls --sts */
+/* Given a VTBL and an IDX, return an expression for the function
+ pointer located at the indicated index. BASETYPE is the static
+ type of the object containing the vtable. */
+
+tree
+build_vfn_ref_using_vtable (tree vtbl, tree idx)
+{
+ tree aref;
+
+ vtbl = unshare_expr (vtbl);
+ assemble_external (vtbl);
+
+ /* APPLE LOCAL KEXT double destructor */
+#ifdef ADJUST_VTABLE_INDEX
+ ADJUST_VTABLE_INDEX (idx, vtbl);
+#endif
+
+ aref = build_array_ref (vtbl, idx);
+ TREE_CONSTANT (aref) |= TREE_CONSTANT (vtbl) && TREE_CONSTANT (idx);
+ TREE_INVARIANT (aref) = TREE_CONSTANT (aref);
+
+ return aref;
+}
+/* APPLE LOCAL end KEXT indirect-virtual-calls --sts */
+
/* Return the name of the virtual function table (as an IDENTIFIER_NODE)
for the given TYPE. */
@@ -1734,9 +1772,21 @@ layout_vtable_decl (tree binfo, int n)
{
tree atype;
tree vtable;
+ /* APPLE LOCAL begin KEXT terminated-vtables */
+ int n_entries;
+
+ n_entries = n;
+
+ /* Enlarge suggested vtable size by one entry; it will be filled
+ with a zero word. Darwin kernel dynamic-driver loader looks
+ for this value to find vtable ends for patching. */
+ if (flag_apple_kext)
+ n_entries += 1;
+ /* APPLE LOCAL end KEXT terminated-vtables */
atype = build_cplus_array_type (vtable_entry_type,
- build_index_type (size_int (n - 1)));
+ /* APPLE LOCAL KEXT terminated-vtables */
+ build_index_type (size_int (n_entries - 1)));
layout_type (atype);
/* We may have to grow the vtable. */
@@ -3848,9 +3898,18 @@ clone_function_decl (tree fn, int update_method_vec_p)
if (update_method_vec_p)
add_method (DECL_CONTEXT (clone), clone);
}
- clone = build_clone (fn, complete_dtor_identifier);
- if (update_method_vec_p)
- add_method (DECL_CONTEXT (clone), clone);
+
+ /* APPLE LOCAL begin KEXT double destructor */
+ /* Don't use the complete dtor. */
+ if (! flag_apple_kext
+ || ! has_apple_kext_compatibility_attr_p (DECL_CONTEXT (fn)))
+ {
+ clone = build_clone (fn, complete_dtor_identifier);
+ if (update_method_vec_p)
+ add_method (DECL_CONTEXT (clone), clone);
+ }
+ /* APPLE LOCAL end KEXT double destructor */
+
clone = build_clone (fn, base_dtor_identifier);
if (update_method_vec_p)
add_method (DECL_CONTEXT (clone), clone);
@@ -4546,6 +4605,13 @@ layout_class_type (tree t, tree *virtuals_p)
NULL, NULL);
build_base_fields (rli, empty_base_offsets, next_field);
+ /* APPLE LOCAL begin Macintosh alignment 2002-5-24 --ff */
+ /* Turn on this flag until the first real member of the class is
+ laid out. (Enums and such things declared in the class do not
+ count.) */
+ darwin_align_is_first_member_of_class = 1;
+ /* APPLE LOCAL end Macintosh alignment 2002-5-24 --ff */
+
/* Layout the non-static data members. */
for (field = non_static_data_members; field; field = TREE_CHAIN (field))
{
@@ -4664,6 +4730,12 @@ layout_class_type (tree t, tree *virtuals_p)
layout_nonempty_base_or_field (rli, field, NULL_TREE,
empty_base_offsets);
+ /* APPLE LOCAL begin Macintosh alignment 2002-5-24 --ff */
+ /* When we reach here we have laid out the first real member of
+ the class. */
+ darwin_align_is_first_member_of_class = 0;
+ /* APPLE LOCAL end Macintosh alignment 2002-5-24 --ff */
+
/* Remember the location of any empty classes in FIELD. */
if (abi_version_at_least (2))
record_subobject_offsets (TREE_TYPE (field),
@@ -4717,6 +4789,12 @@ layout_class_type (tree t, tree *virtuals_p)
last_field_was_bitfield = DECL_C_BIT_FIELD (field);
}
+ /* APPLE LOCAL begin Macintosh alignment 2002-5-24 --ff */
+ /* Make sure the flag is turned off in cases where there were no
+ real members in the class. */
+ darwin_align_is_first_member_of_class = 0;
+
+ /* APPLE LOCAL end Macintosh alignment 2002-5-24 --ff */
if (abi_version_at_least (2) && !integer_zerop (rli->bitpos))
{
/* Make sure that we are on a byte boundary so that the size of
@@ -7069,6 +7147,19 @@ dfs_accumulate_vtbl_inits (tree binfo,
index = size_binop (MULT_EXPR,
TYPE_SIZE_UNIT (vtable_entry_type),
index);
+ /* APPLE LOCAL begin KEXT double destructor */
+#ifdef VPTR_INITIALIZER_ADJUSTMENT
+ /* Subtract VPTR_INITIALIZER_ADJUSTMENT from INDEX. */
+ if (flag_apple_kext && !ctor_vtbl_p && ! BINFO_PRIMARY_P (binfo)
+ && TREE_CODE (index) == INTEGER_CST
+ && TREE_INT_CST_LOW (index) >= VPTR_INITIALIZER_ADJUSTMENT
+ && TREE_INT_CST_HIGH (index) == 0)
+ index = fold (build (MINUS_EXPR,
+ TREE_TYPE (index), index,
+ size_int (VPTR_INITIALIZER_ADJUSTMENT)));
+#endif
+ /* APPLE LOCAL end KEXT double destructor */
+
vtbl = build2 (PLUS_EXPR, TREE_TYPE (vtbl), vtbl, index);
}
@@ -7715,4 +7806,116 @@ cp_fold_obj_type_ref (tree ref, tree known_type)
return build_address (fndecl);
}
+/* APPLE LOCAL begin KEXT double destructor */
+/* Return whether CLASS or any of its primary ancestors have the
+ "apple_kext_compatibility" attribute, in which case the
+ non-deleting destructor is not emitted. Only single
+ inheritance heirarchies can have this tag. */
+int
+has_apple_kext_compatibility_attr_p (tree class)
+{
+ while (class != NULL)
+ {
+ tree base_binfo;
+
+ if (TREE_CODE (class) == ARRAY_TYPE)
+ {
+ class = TREE_TYPE (class);
+ continue;
+ }
+
+ if (BINFO_N_BASE_BINFOS (TYPE_BINFO (class)) > 1)
+ return 0;
+
+ if (lookup_attribute ("apple_kext_compatibility",
+ TYPE_ATTRIBUTES (class)))
+ return 1;
+
+ /* If there are no more base classes, we're done. */
+ if (BINFO_N_BASE_BINFOS (TYPE_BINFO (class)) < 1)
+ break;
+
+ base_binfo = BINFO_BASE_BINFO (TYPE_BINFO (class), 0);
+ if (base_binfo
+ && ! BINFO_VIRTUAL_P (base_binfo))
+ class = BINFO_TYPE (base_binfo);
+ else
+ break;
+ }
+
+ return 0;
+}
+
+/* Walk through a function body and return true if nothing in there
+ would cause us to generate code. */
+static int
+compound_body_is_empty_p (tree t)
+{
+ while (t && t != error_mark_node)
+ {
+ enum tree_code tc = TREE_CODE (t);
+ if (tc == BIND_EXPR)
+ {
+ if (BIND_EXPR_VARS (t) == 0
+ && compound_body_is_empty_p (BIND_EXPR_BODY (t)))
+ t = TREE_CHAIN (t);
+ else
+ return 0;
+ }
+ else if (tc == STATEMENT_LIST)
+ {
+ tree_stmt_iterator iter;
+
+ for (iter = tsi_start (t); !tsi_end_p (iter); tsi_next (&iter))
+ if (! compound_body_is_empty_p (tsi_stmt (iter)))
+ return 0;
+ return 1;
+ }
+ else
+ return 0;
+ }
+ /* We hit the end of the body function without seeing anything. */
+ return 1;
+}
+
+/* TRUE if we have an operator delete which is empty (i.e., NO CODE!) */
+int
+has_empty_operator_delete_p (tree class)
+{
+ if (! class)
+ return 0;
+
+ if (BINFO_N_BASE_BINFOS (TYPE_BINFO (class)) > 1)
+ return 0;
+
+ if (TYPE_GETS_DELETE (class))
+ {
+ tree f = lookup_fnfields (TYPE_BINFO (class),
+ ansi_opname (DELETE_EXPR), 0);
+
+ if (f == error_mark_node)
+ return 0;
+
+ if (BASELINK_P (f))
+ f = BASELINK_FUNCTIONS (f);
+
+ if (OVL_CURRENT (f))
+ {
+ f = OVL_CURRENT (f);
+
+ /* We've overridden TREE_SIDE_EFFECTS for C++ operator deletes
+ to mean that the function is empty. */
+ if (TREE_SIDE_EFFECTS (f))
+ return 1;
+
+ /* Otherwise, it could be an inline but empty function. */
+ if (DECL_SAVED_TREE (f))
+ return compound_body_is_empty_p (DECL_SAVED_TREE (f));
+ }
+ }
+
+ return 0;
+}
+/* APPLE LOCAL end KEXT double destructor */
+
#include "gt-cp-class.h"
diff --git a/gcc/cp/cp-objcp-common.c b/gcc/cp/cp-objcp-common.c
index d43c159c01f..9605aebb950 100644
--- a/gcc/cp/cp-objcp-common.c
+++ b/gcc/cp/cp-objcp-common.c
@@ -202,3 +202,18 @@ has_c_linkage (tree decl)
{
return DECL_EXTERN_C_P (decl);
}
+
+/* APPLE LOCAL begin kext identify vtables */
+/* Return true if t is a vtable. In kexts (only) these may
+ be overridden by other modules, so we can't do the
+ normal optimizations we do on initialized const objects. */
+int
+cp_vtable_p (tree t)
+{
+ if (TREE_CODE (t) == VAR_DECL
+ && TREE_CODE (TREE_TYPE (t)) == ARRAY_TYPE
+ && TREE_TYPE (TREE_TYPE (t)) == vtable_entry_type)
+ return 1;
+ return 0;
+}
+/* APPLE LOCAL end kext identify vtables */
diff --git a/gcc/cp/cp-objcp-common.h b/gcc/cp/cp-objcp-common.h
index 7a2a2343b7c..9623a3abf5e 100644
--- a/gcc/cp/cp-objcp-common.h
+++ b/gcc/cp/cp-objcp-common.h
@@ -22,15 +22,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef GCC_CP_OBJCP_COMMON
#define GCC_CP_OBJCP_COMMON
-/* In cp/cp-objcp-common.c. */
-
-extern HOST_WIDE_INT cxx_get_alias_set (tree);
-extern bool cxx_warn_unused_global_decl (tree);
-extern tree cp_expr_size (tree);
-extern size_t cp_tree_size (enum tree_code);
-extern bool cp_var_mod_type_p (tree, tree);
-extern void cxx_initialize_diagnostics (struct diagnostic_context *);
-extern int cxx_types_compatible_p (tree, tree);
+/* APPLE LOCAL Objective-C++ */
+/* Function prototypes for cp/cp-objcp-common.c moved to cp/cp-tree.h. */
/* In cp/cp-lang.c and objcp/objcp-lang.c. */
@@ -162,4 +155,9 @@ extern tree objcp_tsubst_copy_and_build (tree, tree, tsubst_flags_t,
#undef LANG_HOOKS_GIMPLIFY_EXPR
#define LANG_HOOKS_GIMPLIFY_EXPR cp_gimplify_expr
+/* APPLE LOCAL begin kext identify vtables */
+#undef LANG_HOOKS_VTABLE_P
+#define LANG_HOOKS_VTABLE_P cp_vtable_p
+/* APPLE LOCAL end kext identify vtables */
+
#endif /* GCC_CP_OBJCP_COMMON */
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index bd5d0eca14d..4cf47a85fa7 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -194,6 +194,9 @@ struct lang_identifier GTY(())
cxx_binding *namespace_bindings;
cxx_binding *bindings;
tree class_template_info;
+ /* APPLE LOCAL begin objc speedup --dpatel */
+ tree interface_value; /* ObjC interface, if any */
+ /* APPLE LOCAL end objc speedup --dpatel */
tree label_value;
};
@@ -522,6 +525,12 @@ enum cp_tree_index
CPTI_KEYED_CLASSES,
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ CPTI_DELTA2_IDENTIFIER,
+ CPTI_INDEX_IDENTIFIER,
+ CPTI_PFN_OR_DELTA2_IDENTIFIER,
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
+
CPTI_MAX
};
@@ -592,6 +601,12 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
#define deleting_dtor_identifier cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER]
#define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER]
#define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER]
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+#define delta2_identifier cp_global_trees[CPTI_DELTA2_IDENTIFIER]
+#define index_identifier cp_global_trees[CPTI_INDEX_IDENTIFIER]
+#define pfn_or_delta2_identifier cp_global_trees[CPTI_PFN_OR_DELTA2_IDENTIFIER]
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
+
/* The name of the parameter that contains a pointer to the VTT to use
for this subobject constructor or destructor. */
#define vtt_parm_identifier cp_global_trees[CPTI_VTT_PARM_IDENTIFIER]
@@ -2521,8 +2536,13 @@ struct lang_decl GTY(())
/* Get the POINTER_TYPE to the METHOD_TYPE associated with this
pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
before using this macro. */
-#define TYPE_PTRMEMFUNC_FN_TYPE(NODE) \
- (TREE_TYPE (TYPE_FIELDS (NODE)))
+/* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+#define TYPE_PTRMEMFUNC_FN_TYPE(NODE) \
+ *((flag_apple_kext) ? \
+ &(TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN ( \
+ TREE_CHAIN (TYPE_FIELDS (NODE))))))) : \
+ &(TREE_TYPE (TYPE_FIELDS (NODE)))) \
+/* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
/* Returns `A' for a type like `int (A::*)(double)' */
#define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
@@ -3517,6 +3537,8 @@ typedef enum cp_decl_spec {
ds_typedef,
ds_complex,
ds_thread,
+ /* APPLE LOCAL CW asm blocks. */
+ ds_cw_asm,
ds_last
} cp_decl_spec;
@@ -3723,6 +3745,8 @@ extern void note_name_declared_in_class (tree, tree);
extern tree get_vtbl_decl_for_binfo (tree);
extern tree get_vtt_name (tree);
extern tree get_primary_binfo (tree);
+/* APPLE LOCAL KEXT indirect-virtual-calls --sts */
+extern tree build_vfn_ref_using_vtable (tree, tree);
extern void debug_class (tree);
extern void debug_thunks (tree);
extern tree cp_fold_obj_type_ref (tree, tree);
@@ -4104,6 +4128,8 @@ extern void pop_to_parent_deferring_access_checks (void);
extern void perform_deferred_access_checks (void);
extern void perform_or_defer_access_check (tree, tree);
extern void init_cp_semantics (void);
+/* APPLE LOCAL Objective-C++ */
+extern tree do_poplevel (tree);
extern void add_decl_expr (tree);
extern tree finish_expr_stmt (tree);
extern tree begin_if_stmt (void);
@@ -4370,10 +4396,34 @@ extern tree mangle_ref_init_variable (tree);
/* in dump.c */
extern bool cp_dump_tree (void *, tree);
+/* APPLE LOCAL begin Objective-C */
+/* In cp/cp-objcp-common.c. */
+
+extern HOST_WIDE_INT cxx_get_alias_set (tree);
+extern bool cxx_warn_unused_global_decl (tree);
+extern tree cp_expr_size (tree);
+extern size_t cp_tree_size (enum tree_code);
+extern bool cp_var_mod_type_p (tree, tree);
+extern void cxx_initialize_diagnostics (struct diagnostic_context *);
+extern int cxx_types_compatible_p (tree, tree);
+/* APPLE LOCAL end Objective-C */
+
+/* APPLE LOCAL begin KEXT double destructor */
+extern int has_apple_kext_compatibility_attr_p PARAMS ((tree));
+extern int has_empty_operator_delete_p PARAMS ((tree));
+/* APPLE LOCAL end KEXT double destructor */
+
+/* APPLE LOCAL kext identify vtables */
+extern int cp_vtable_p (tree);
+
/* in cp-simplify.c */
extern int cp_gimplify_expr (tree *, tree *, tree *);
extern void cp_genericize (tree);
+/* APPLE LOCAL begin CW asm blocks */
+extern tree cw_asm_cp_build_component_ref (tree, tree);
+/* APPLE LOCAL end CW asm blocks */
+
/* -- end of C++ */
/* In order for the format checking to accept the C++ frontend
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 48f8d8c55fd..9400a8b4576 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -229,10 +229,17 @@ int function_depth;
with __attribute__((deprecated)). An object declared as
__attribute__((deprecated)) suppresses warnings of uses of other
deprecated items. */
+/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+/* An object declared as __attribute__((unavailable)) suppresses
+ any reports of being declared with unavailable or deprecated
+ items. */
+/* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
enum deprecated_states {
DEPRECATED_NORMAL,
DEPRECATED_SUPPRESS
+ /* APPLE LOCAL "unavailable" attribute (radar 2809697) */
+ , DEPRECATED_UNAVAILABLE_SUPPRESS
};
static enum deprecated_states deprecated_state = DEPRECATED_NORMAL;
@@ -2846,6 +2853,45 @@ initialize_predefined_identifiers (void)
if (pid->ctor_or_dtor_p)
IDENTIFIER_CTOR_OR_DTOR_P (*pid->node) = 1;
}
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ if (flag_apple_kext)
+ {
+ /* This is snarfed from the 2.95 cp-tree.h. The mechanism is
+ completely different from gcc3 (see cp-tree.h, and read the
+ comment just above 'enum ptrmemfunc_vbit_where_t'. Sigh.
+
+ A 2.95 pointer-to-function member type looks like:
+
+ struct {
+ short __delta;
+ short __index;
+ union {
+ P __pfn;
+ short __delta2;
+ } __pfn_or_delta2;
+ };
+
+ where P is a POINTER_TYPE to a METHOD_TYPE appropriate for the
+ pointer to member. The fields are used as follows:
+
+ If __INDEX is -1, then the function to call is non-virtual, and
+ is located at the address given by __PFN.
+
+ If __INDEX is zero, then this a NULL pointer-to-member.
+
+ Otherwise, the function to call is virtual. Then, __DELTA2 gives
+ the offset from an instance of the object to the virtual function
+ table, and __INDEX - 1 is the index into the vtable to use to
+ find the function.
+
+ The value to use for the THIS parameter is the address of the
+ object plus __DELTA. */
+
+ delta2_identifier = get_identifier ("__delta2");
+ index_identifier = get_identifier ("__index");
+ pfn_or_delta2_identifier = get_identifier ("__pfn_or_delta2");
+ }
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
}
/* Create the predefined scalar types of C,
@@ -2930,6 +2976,11 @@ cxx_init_decl_processing (void)
record_builtin_type (RID_MAX, NULL, string_type_node);
#endif
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ if (flag_apple_kext)
+ delta_type_node = short_integer_type_node;
+ else
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
delta_type_node = ptrdiff_type_node;
vtable_index_type = ptrdiff_type_node;
@@ -3037,6 +3088,13 @@ cxx_init_decl_processing (void)
/* Show we use EH for cleanups. */
if (flag_exceptions)
using_eh_for_cleanups ();
+
+ /* APPLE LOCAL begin fwritable strings. */
+ /* Maintain consistency. Perhaps we should just complain if they
+ say -fwritable-strings? */
+ if (flag_writable_strings)
+ flag_const_strings = 0;
+ /* APPLE LOCAL end fwritable strings. */
}
/* Generate an initializer for a function naming variable from
@@ -3150,8 +3208,18 @@ builtin_function_1 (const char* name,
/* Warn if a function in the namespace for users
is used without an occasion to consider it declared. */
- if (name[0] != '_' || name[1] != '_')
+ /* APPLE LOCAL begin AltiVec */
+ if ((name[0] != '_' || name[1] != '_')
+#ifdef TARGET_POWERPC
+ /* AltiVec PIM builtins, even though they do not begin with
+ underscores, need not be declared either. */
+ && !(class == BUILT_IN_MD
+ && code >= ALTIVEC_PIM__FIRST
+ && code <= ALTIVEC_PIM__LAST)
+#endif /* TARGET_POWERPC */
+ )
DECL_ANTICIPATED (decl) = 1;
+ /* APPLE LOCAL end AltiVec */
/* Possibly apply some default attributes to this built-in function. */
if (attrs)
@@ -3188,7 +3256,10 @@ builtin_function (const char* name,
{
/* All builtins that don't begin with an '_' should additionally
go in the 'std' namespace. */
- if (name[0] != '_')
+ /* APPLE LOCAL begin alloca not in std */
+ /* Don't use `std' namespace for alloca. */
+ if (name[0] != '_' && strcmp (name, "alloca"))
+ /* APPLE LOCAL end alloca not in std */
{
push_namespace (std_identifier);
builtin_function_1 (name, type, std_node, code, cl, libname, attrs);
@@ -3566,6 +3637,8 @@ start_decl (const cp_declarator *declarator,
tree decl;
tree type, tem;
tree context;
+ /* APPLE LOCAL "unavailable" attribute (radar 2809697) */
+ tree a;
*pushed_scope_p = NULL_TREE;
@@ -3576,10 +3649,34 @@ start_decl (const cp_declarator *declarator,
have_extern_spec = false;
}
- /* An object declared as __attribute__((deprecated)) suppresses
- warnings of uses of other deprecated items. */
+ /* APPLE LOCAL begin "unavailable" attribute (radar 2809697) */
+ /* An object declared as __attribute__((unavailable)) suppresses
+ any reports of being declared with unavailable or deprecated
+ items. An object declared as __attribute__((deprecated))
+ suppresses warnings of uses of other deprecated items. */
+#ifdef A_LESS_INEFFICENT_WAY /* which I really don't want to do! */
if (lookup_attribute ("deprecated", attributes))
deprecated_state = DEPRECATED_SUPPRESS;
+ else if (lookup_attribute ("unavailable", attributes))
+ deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS;
+#else /* a more efficient way doing what lookup_attribute would do */
+ for (a = attributes; a; a = TREE_CHAIN (a))
+ {
+ tree name = TREE_PURPOSE (a);
+ if (TREE_CODE (name) == IDENTIFIER_NODE)
+ if (is_attribute_p ("deprecated", name))
+ {
+ deprecated_state = DEPRECATED_SUPPRESS;
+ break;
+ }
+ if (is_attribute_p ("unavailable", name))
+ {
+ deprecated_state = DEPRECATED_UNAVAILABLE_SUPPRESS;
+ break;
+ }
+ }
+#endif
+ /* APPLE LOCAL end "unavailable" attribute (radar 2809697) */
attributes = chainon (attributes, prefix_attributes);
@@ -4610,7 +4707,19 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
&& DECL_IMPLICIT_INSTANTIATION (decl))
defer_p = 1;
- /* If we're not deferring, go ahead and assemble the variable. */
+
+ /* APPLE LOCAL begin static const members 20020110 --turly */
+ /* Static const members which require runtime initialisation should
+ not be placed in readonly memory. Avoid this by temporarily
+ whacking the TREE_READONLY bit. */
+ if (!defer_p && init != NULL_TREE && TREE_READONLY (decl) && toplev)
+ {
+ TREE_READONLY (decl) = 0;
+ rest_of_decl_compilation (decl, toplev, at_eof);
+ TREE_READONLY (decl) = 1;
+ }
+ else
+ /* APPLE LOCAL end static const members 20020110 --turly */
if (!defer_p)
rest_of_decl_compilation (decl, toplev, at_eof);
}
@@ -5994,6 +6103,37 @@ build_ptrmemfunc_type (tree type)
unqualified_variant
= build_ptrmemfunc_type (TYPE_MAIN_VARIANT (type));
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ if (flag_apple_kext)
+ {
+ tree u = make_aggr_type (UNION_TYPE);
+ SET_IS_AGGR_TYPE (u, 0);
+ xref_basetypes (u, NULL_TREE);
+ fields = build_decl (FIELD_DECL, delta2_identifier, delta_type_node);
+ TREE_CHAIN (fields)
+ = build_decl (FIELD_DECL, pfn_identifier, type);
+ finish_builtin_struct (u, "__ptrmemfunc_type", fields, ptr_type_node);
+ TYPE_NAME (u) = NULL_TREE;
+
+ t = make_aggr_type (RECORD_TYPE);
+ xref_basetypes (t, NULL_TREE);
+
+ /* Let the front-end know this is a pointer to member function... */
+ TYPE_PTRMEMFUNC_FLAG (t) = 1;
+ /* ... and not really an aggregate. */
+ SET_IS_AGGR_TYPE (t, 0);
+
+ fields = build_decl (FIELD_DECL, pfn_or_delta2_identifier, u);
+ TREE_CHAIN (fields) =
+ build_decl (FIELD_DECL, index_identifier, delta_type_node);
+ TREE_CHAIN (TREE_CHAIN (fields)) =
+ build_decl (FIELD_DECL, delta_identifier, delta_type_node);
+ finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node);
+ }
+ else
+ {
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
+
t = make_aggr_type (RECORD_TYPE);
xref_basetypes (t, NULL_TREE);
@@ -6010,6 +6150,8 @@ build_ptrmemfunc_type (tree type)
fields = field;
finish_builtin_struct (t, "__ptrmemfunc_type", fields, ptr_type_node);
+ /* APPLE LOCAL KEXT 2.95-ptmf-compatibility --turly */
+ }
/* Zap out the name so that the back-end will give us the debugging
information for this anonymous RECORD_TYPE. */
@@ -6491,6 +6633,8 @@ grokdeclarator (const cp_declarator *declarator,
cp_decl_spec ds;
cp_storage_class storage_class;
bool unsigned_p, signed_p, short_p, long_p, thread_p;
+ /* APPLE LOCAL CW asm blocks */
+ bool cw_asm_p;
bool type_was_error_mark_node = false;
signed_p = declspecs->specs[(int)ds_signed];
@@ -6498,6 +6642,8 @@ grokdeclarator (const cp_declarator *declarator,
short_p = declspecs->specs[(int)ds_short];
long_p = declspecs->specs[(int)ds_long];
thread_p = declspecs->specs[(int)ds_thread];
+ /* APPLE LOCAL CW asm blocks */
+ cw_asm_p = declspecs->specs[(int)ds_cw_asm];
if (decl_context == FUNCDEF)
funcdef_flag = 1, decl_context = NORMAL;
@@ -6696,6 +6842,19 @@ grokdeclarator (const cp_declarator *declarator,
type = NULL_TREE;
type_was_error_mark_node = true;
}
+
+ /* APPLE LOCAL begin unavailable attribute (radar 2809697) --bowdidge */
+ /* If the entire declaration is itself tagged as unavailable then
+ suppress reports of unavailable/deprecated items. If the
+ entire declaration is tagged as only deprecated we still
+ report unavailable uses. */
+ if (type && TREE_DEPRECATED (type) && TREE_UNAVAILABLE (type))
+ {
+ if (deprecated_state != DEPRECATED_UNAVAILABLE_SUPPRESS)
+ warn_deprecated_use (type);
+ }
+ else
+ /* APPLE LOCAL end unavailable attribute (radar 2809697) --bowdidge */
/* If the entire declaration is itself tagged as deprecated then
suppress reports of deprecated items. */
if (type && TREE_DEPRECATED (type)
@@ -6752,6 +6911,8 @@ grokdeclarator (const cp_declarator *declarator,
"typedef",
"__complex",
"__thread"
+ /* APPLE LOCAL CW asm blocks. */
+ , "asm"
};
error ("duplicate %qs", decl_spec_names[(int)ds]);
}
@@ -8199,6 +8360,21 @@ grokdeclarator (const cp_declarator *declarator,
else if (storage_class == sc_static)
DECL_THIS_STATIC (decl) = 1;
+ /* APPLE LOCAL begin CW asm blocks */
+ if (cw_asm_p)
+ {
+ /* Record that this is a decl of a CW-style asm function. */
+ if (flag_cw_asm_blocks)
+ {
+ DECL_CW_ASM_FUNCTION (decl) = 1;
+ DECL_CW_ASM_NORETURN (decl) = 0;
+ DECL_CW_ASM_FRAME_SIZE (decl) = -2;
+ }
+ else
+ error ("asm functions not enabled, use `-fasm-blocks'");
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
/* Record constancy and volatility. There's no need to do this
when processing a template; we'll do this for the instantiated
declaration based on the type of DECL. */
@@ -10173,6 +10349,17 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
DECL_CONTEXT (cdtor_label) = current_function_decl;
}
+ /* APPLE LOCAL begin CW asm blocks */
+ /* If this was a function declared as an assembly function, change
+ the state to expect to see C++ decls, possibly followed by assembly
+ code. */
+ if (DECL_CW_ASM_FUNCTION (current_function_decl))
+ {
+ cw_asm_state = cw_asm_decls;
+ cw_asm_in_decl = 0;
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
start_fname_decls ();
store_parm_decls (current_function_parms);
@@ -10938,6 +11125,25 @@ cxx_maybe_build_cleanup (tree decl)
tree rval;
bool has_vbases = (TREE_CODE (type) == RECORD_TYPE
&& CLASSTYPE_VBASECLASSES (type));
+ /* APPLE LOCAL begin KEXT double destructor */
+ special_function_kind dtor = sfk_complete_destructor;
+ if (flag_apple_kext
+ && has_apple_kext_compatibility_attr_p (type))
+ {
+ /* If we have a trivial operator delete (), we can go ahead and
+ just use the deleting destructor, sfk_deleting_destructor. */
+
+ if (! has_empty_operator_delete_p (type) || pedantic)
+ {
+ cp_warning_at ("'%D' is an instance of a class which does "
+ "not allow global or stack-based objects; it "
+ "does not have an empty `operator delete', and "
+ "so it will ** NOT ** be destructed.", decl);
+ return NULL_TREE;
+ }
+ dtor = sfk_deleting_destructor;
+ }
+ /* APPLE LOCAL end KEXT double destructor */
if (TREE_CODE (type) == ARRAY_TYPE)
rval = decl;
@@ -10952,7 +11158,8 @@ cxx_maybe_build_cleanup (tree decl)
flags |= LOOKUP_NONVIRTUAL;
rval = build_delete (TREE_TYPE (rval), rval,
- sfk_complete_destructor, flags, 0);
+ /* APPLE LOCAL KEXT double destructor */
+ dtor, flags, 0);
return rval;
}
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index c7b04150e8f..0330c912659 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -2069,6 +2069,14 @@ start_objects (int method_type, int initp)
DECL_GLOBAL_DTOR_P (current_function_decl) = 1;
DECL_LANG_SPECIFIC (current_function_decl)->decl_flags.u2sel = 1;
+ /* APPLE LOCAL begin static structors in __StaticInit section */
+#ifdef STATIC_INIT_SECTION
+ if ( ! flag_apple_kext)
+ DECL_SECTION_NAME (current_function_decl) =
+ build_string (strlen (STATIC_INIT_SECTION), STATIC_INIT_SECTION);
+#endif
+ /* APPLE LOCAL end static structors in __StaticInit section */
+
body = begin_compound_stmt (BCS_FN_BODY);
/* We cannot allow these functions to be elided, even if they do not
@@ -2175,6 +2183,14 @@ start_static_storage_duration_function (unsigned count)
TREE_PUBLIC (ssdf_decl) = 0;
DECL_ARTIFICIAL (ssdf_decl) = 1;
+ /* APPLE LOCAL begin static structors in __StaticInit section */
+#ifdef STATIC_INIT_SECTION
+ if ( ! flag_apple_kext)
+ DECL_SECTION_NAME (ssdf_decl) = build_string (strlen (STATIC_INIT_SECTION),
+ STATIC_INIT_SECTION);
+#endif
+ /* APPLE LOCAL end static structors in __StaticInit section */
+
/* Put this function in the list of functions to be called from the
static constructors and destructors. */
if (!ssdf_decls)
@@ -2569,6 +2585,17 @@ generate_ctor_or_dtor_function (bool constructor_p, int priority,
global constructors and destructors. */
body = NULL_TREE;
+ /* APPLE LOCAL begin Objective-C++ */
+ /* For Objective-C++, we may need to initialize metadata found in this module.
+ This must be done _before_ any other static initializations. */
+ if (c_dialect_objc () && (priority == DEFAULT_INIT_PRIORITY)
+ && constructor_p && objc_static_init_needed_p ())
+ {
+ body = start_objects (function_key, priority);
+ static_ctors = objc_generate_static_init_call (static_ctors);
+ }
+ /* APPLE LOCAL end Objective-C++ */
+
/* Call the static storage duration function with appropriate
arguments. */
if (ssdf_decls)
@@ -2943,6 +2970,22 @@ cp_finish_file (void)
back end. */
if (DECL_NOT_REALLY_EXTERN (decl) && decl_needed_p (decl))
DECL_EXTERNAL (decl) = 0;
+ /* APPLE LOCAL begin write used class statics 20020226 --turly */
+#ifdef MACHOPIC_VAR_REFERRED_TO_P
+ else
+ if (TREE_USED (decl) && DECL_INITIAL (decl) != 0
+ && DECL_INITIAL (decl) != error_mark_node
+ && TREE_CODE (DECL_INITIAL (decl)) != CONSTRUCTOR
+ && DECL_EXTERNAL (decl)
+ && MACHOPIC_VAR_REFERRED_TO_P (IDENTIFIER_POINTER (
+ DECL_ASSEMBLER_NAME (decl))))
+ {
+ /* Force a local copy of this decl to be written. */
+ DECL_EXTERNAL (decl) = 0;
+ TREE_PUBLIC (decl) = 0;
+ }
+#endif
+ /* APPLE LOCAL end write used class statics 20020226 --turly */
}
if (pending_statics
&& wrapup_global_declarations (&VARRAY_TREE (pending_statics, 0),
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 4ad5e62c4ac..ebac6d77df4 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -2837,6 +2837,16 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
build_op_delete_call (DELETE_EXPR, addr, cxx_sizeof_nowarn (type),
/*global_p=*/false, NULL_TREE);
}
+ /* APPLE LOCAL begin KEXT double destructor --matt 20020501 */
+ /* If we're compiling a class in kext compatibility mode we
+ don't have a non-deleting destructor, so we unconditionally
+ generate a reference to the deleting variety. */
+ if (flag_apple_kext && has_apple_kext_compatibility_attr_p (type))
+ {
+ gcc_assert (auto_delete != sfk_base_destructor);
+ auto_delete = sfk_deleting_destructor;
+ }
+ /* APPLE LOCAL end KEXT double destructor --matt 20020501 */
expr = build_dtor_call (build_indirect_ref (addr, NULL),
auto_delete, flags);
diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
index 9adda3d5edd..74f6e7d8171 100644
--- a/gcc/cp/lang-specs.h
+++ b/gcc/cp/lang-specs.h
@@ -47,6 +47,8 @@ Boston, MA 02111-1307, USA. */
CPLUSPLUS_CPP_SPEC, 0, 0},
{"@c++",
"%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}\
+ "/* APPLE LOCAL prohibit -arch with -E and -S */"\
+ %{E|S:%{@:%e-E and -S are not allowed with multiple -arch flags}}\
%{!E:%{!M:%{!MM:\
%{save-temps|no-integrated-cpp:cc1plus -E\
%(cpp_options) %2 -o %{save-temps:%b.ii} %{!save-temps:%g.ii} \n}\
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 6074fef9ea1..97dcb87afed 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -175,6 +175,8 @@ struct resword
_true_. */
#define D_EXT 0x01 /* GCC extension */
#define D_ASM 0x02 /* in C99, but has a switch to turn it off */
+/* APPLE LOCAL Objective-C++ */
+#define D_OBJC 0x08 /* Objective C++ only */
CONSTRAINT(ridbits_fit, RID_LAST_MODIFIER < sizeof(unsigned long) * CHAR_BIT);
@@ -203,6 +205,8 @@ static const struct resword reswords[] =
{ "__inline__", RID_INLINE, 0 },
{ "__label__", RID_LABEL, 0 },
{ "__null", RID_NULL, 0 },
+ /* APPLE LOCAL private extern */
+ { "__private_extern__", RID_PRIVATE_EXTERN, 0 },
{ "__real", RID_REALPART, 0 },
{ "__real__", RID_REALPART, 0 },
{ "__restrict", RID_RESTRICT, 0 },
@@ -279,6 +283,33 @@ static const struct resword reswords[] =
{ "wchar_t", RID_WCHAR, 0 },
{ "while", RID_WHILE, 0 },
+ /* APPLE LOCAL begin Objective-C++ */
+ /* The remaining keywords are specific to Objective-C++. NB:
+ All of them will remain _disabled_, since they are context-
+ sensitive. */
+
+ /* These ObjC keywords are recognized only immediately after
+ an '@'. NB: The following C++ keywords double as
+ ObjC keywords in this context: RID_CLASS, RID_PRIVATE,
+ RID_PROTECTED, RID_PUBLIC, RID_THROW, RID_TRY and RID_CATCH. */
+ { "compatibility_alias", RID_AT_ALIAS, D_OBJC },
+ { "defs", RID_AT_DEFS, D_OBJC },
+ { "encode", RID_AT_ENCODE, D_OBJC },
+ { "end", RID_AT_END, D_OBJC },
+ { "implementation", RID_AT_IMPLEMENTATION, D_OBJC },
+ { "interface", RID_AT_INTERFACE, D_OBJC },
+ { "protocol", RID_AT_PROTOCOL, D_OBJC },
+ { "selector", RID_AT_SELECTOR, D_OBJC },
+ { "finally", RID_AT_FINALLY, D_OBJC },
+ { "synchronized", RID_AT_SYNCHRONIZED, D_OBJC },
+ /* These are recognized only in protocol-qualifier context. */
+ { "bycopy", RID_BYCOPY, D_OBJC },
+ { "byref", RID_BYREF, D_OBJC },
+ { "in", RID_IN, D_OBJC },
+ { "inout", RID_INOUT, D_OBJC },
+ { "oneway", RID_ONEWAY, D_OBJC },
+ { "out", RID_OUT, D_OBJC },
+ /* APPLE LOCAL end Objective-C++ */
};
void
@@ -287,6 +318,8 @@ init_reswords (void)
unsigned int i;
tree id;
int mask = ((flag_no_asm ? D_ASM : 0)
+ /* APPLE LOCAL Objective-C++ */
+ | D_OBJC
| (flag_no_gnu_keywords ? D_EXT : 0));
ridpointers = ggc_calloc ((int) RID_MAX, sizeof (tree));
@@ -298,6 +331,25 @@ init_reswords (void)
if (! (reswords[i].disable & mask))
C_IS_RESERVED_WORD (id) = 1;
}
+
+ /* APPLE LOCAL begin private extern Radar 2872481 --ilr */
+ /* For C++ there is always a -D__private_extern__=extern on the
+ command line. However, if -fpreprocessed was specified then
+ macros are not expanded so the -D is meaningless. But this
+ replacement is required for C++. There for we have to "pretend"
+ that '__private_extern__' is 'extern' and we can do this simply by
+ making the rid code for '__private_extern__' be the same as for
+ extern. Note, we probably could always do this here since
+ '__private_extern__' is always to be treated like 'extern' for
+ c++. But we'll be conservative and only do it when -fpreprocessed
+ is specified and depend on the macro substitution in all other
+ cases. */
+ if (flag_preprocessed)
+ {
+ id = get_identifier ("__private_extern__");
+ C_RID_CODE (id) = RID_EXTERN;
+ }
+ /* APPLE LOCAL end private extern Radar 2872481 --ilr */
}
static void
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index eb9f8f075a2..14dced860aa 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1367,15 +1367,19 @@ write_identifier (const char *identifier)
Currently, allocating constructors are never used.
- We also need to provide mangled names for the maybe-in-charge
- constructor, so we treat it here too. mangle_decl_string will
- append *INTERNAL* to that, to make sure we never emit it. */
+ APPLE LOCAL decloning
+ Deleted comment. */
static void
write_special_name_constructor (const tree ctor)
{
if (DECL_BASE_CONSTRUCTOR_P (ctor))
write_string ("C2");
+ /* APPLE LOCAL begin decloning */
+ /* This is the old-style "[unified]" constructor. */
+ else if (DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (ctor))
+ write_string ("C4");
+ /* APPLE LOCAL end decloning */
else
{
gcc_assert (DECL_COMPLETE_CONSTRUCTOR_P (ctor)
@@ -1406,6 +1410,11 @@ write_special_name_destructor (const tree dtor)
write_string ("D0");
else if (DECL_BASE_DESTRUCTOR_P (dtor))
write_string ("D2");
+ /* APPLE LOCAL begin decloning */
+ else if (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (dtor))
+ /* This is the old-style "[unified]" destructor. */
+ write_string ("D4");
+ /* APPLE LOCAL end decloning */
else
{
gcc_assert (DECL_COMPLETE_DESTRUCTOR_P (dtor)
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 7ccfaffbf0d..26193fc39e8 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -46,6 +46,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
/* Prototypes. */
static void update_cloned_parm (tree, tree);
+/* APPLE LOCAL begin structor thunks */
+static int maybe_alias_body (tree fn, tree clone);
+static int maybe_thunk_body (tree fn);
+/* APPLE LOCAL end structor thunks */
/* CLONED_PARM is a copy of CLONE, generated for a cloned constructor
or destructor. Update it to ensure that the source-position for
@@ -70,6 +74,165 @@ update_cloned_parm (tree parm, tree cloned_parm)
DECL_SOURCE_LOCATION (cloned_parm) = DECL_SOURCE_LOCATION (parm);
}
+/* APPLE LOCAL begin structor thunks */
+/* FN is a constructor or destructor, and there are FUNCTION_DECLs cloned from it nearby.
+ If the clone and the original funciton have identical parameter lists,
+ it is a fully-degenerate (does absolutely nothing) thunk.
+ Make the clone an alias for the original function label. */
+static int
+maybe_alias_body (tree fn ATTRIBUTE_UNUSED, tree clone ATTRIBUTE_UNUSED)
+{
+ extern FILE *asm_out_file ATTRIBUTE_UNUSED;
+
+#ifdef ASM_MAYBE_ALIAS_BODY
+ ASM_MAYBE_ALIAS_BODY (asm_out_file, fn, clone);
+#endif
+ return 0;
+}
+
+/* FN is a constructor or destructor, and there are FUNCTION_DECLs
+ cloned from it nearby. Instead of cloning this body, leave it
+ alone and create tiny one-call bodies for the cloned
+ FUNCTION_DECLs. These clones are sibcall candidates, and their
+ resulting code will be very thunk-esque. */
+static int
+maybe_thunk_body (tree fn)
+{
+ tree call, clone, expr_stmt, fn_parm, fn_parm_typelist, last_arg, start;
+ int parmno, vtt_parmno;
+
+ if (flag_apple_kext || flag_clone_structors)
+ return 0;
+
+ /* If we've already seen this structor, avoid re-processing it. */
+ if (TREE_ASM_WRITTEN (fn))
+ return 1;
+
+ /* If function accepts variable arguments, give up. */
+ last_arg = tree_last (TYPE_ARG_TYPES (TREE_TYPE (fn)));
+ if ( ! VOID_TYPE_P (TREE_VALUE (last_arg)))
+ return 0;
+
+ /* If constructor expects vector (AltiVec) arguments, give up. */
+ for (fn_parm = DECL_ARGUMENTS( fn); fn_parm; fn_parm = TREE_CHAIN (fn_parm))
+ if (TREE_CODE (fn_parm) == VECTOR_TYPE)
+ return 0;
+
+ /* If we don't see a clone, nothing to do. */
+ clone = TREE_CHAIN (fn);
+ if (!clone || ! DECL_CLONED_FUNCTION_P (clone))
+ return 0;
+
+ /* This is only a win if there are two or more clones. */
+ if ( ! TREE_CHAIN (clone))
+ return 0;
+
+ /* Only thunk-ify non-trivial structors. */
+ if (DECL_ESTIMATED_INSNS (fn) < 5)
+ return 0;
+
+ /* If we got this far, we've decided to turn the clones into thunks. */
+
+ /* We're going to generate code for fn, so it is no longer "abstract." */
+ /* APPLE LOCAL begin fix -gused debug info (radar 3271957 3262497) */
+ /* Leave 'abstract' bit set for unified constructs and destructors when
+ -gused is used. */
+ if (!(flag_debug_only_used_symbols
+ && DECL_DESTRUCTOR_P (fn)
+ && DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (fn))
+ && !(flag_debug_only_used_symbols
+ && DECL_CONSTRUCTOR_P (fn)
+ && DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (fn))
+ )
+ DECL_ABSTRACT (fn) = 0;
+ /* APPLE LOCAL end */
+
+ /* Find the vtt_parm, if present. */
+ for (vtt_parmno = -1, parmno = 0, fn_parm = DECL_ARGUMENTS (fn);
+ fn_parm;
+ ++parmno, fn_parm = TREE_CHAIN (fn_parm))
+ {
+ if (DECL_ARTIFICIAL (fn_parm) && DECL_NAME (fn_parm) == vtt_parm_identifier)
+ {
+ vtt_parmno = parmno; /* Compensate for removed in_charge parameter. */
+ break;
+ }
+ }
+
+ /* We know that any clones immediately follow FN in the TYPE_METHODS
+ list. */
+ for (clone = start = TREE_CHAIN (fn);
+ clone && DECL_CLONED_FUNCTION_P (clone);
+ clone = TREE_CHAIN (clone))
+ {
+ tree clone_parm, parmlist;
+
+ /* If the clone and original parmlists are identical, turn the clone into an alias. */
+ if (maybe_alias_body (fn, clone))
+ continue;
+
+ /* If we've already generated a body for this clone, avoid duplicating it.
+ (Is it possible for a clone-list to grow after we first see it?) */
+ if (DECL_SAVED_TREE (clone) || TREE_ASM_WRITTEN (clone))
+ continue;
+
+ /* Start processing the function. */
+ push_to_top_level ();
+ start_preparsed_function (clone, NULL_TREE, SF_PRE_PARSED);
+
+ /* Walk parameter lists together, creating parameter list for call to original function. */
+ for (parmno = 0,
+ parmlist = NULL,
+ fn_parm = DECL_ARGUMENTS (fn),
+ fn_parm_typelist = TYPE_ARG_TYPES (TREE_TYPE (fn)),
+ clone_parm = DECL_ARGUMENTS (clone);
+ fn_parm;
+ ++parmno,
+ fn_parm = TREE_CHAIN (fn_parm))
+ {
+ if (parmno == vtt_parmno && ! DECL_HAS_VTT_PARM_P (clone))
+ {
+ tree typed_null_pointer_node = copy_node (null_pointer_node);
+ gcc_assert (fn_parm_typelist);
+ /* Clobber actual parameter with formal parameter type. */
+ TREE_TYPE (typed_null_pointer_node) = TREE_VALUE (fn_parm_typelist);
+ parmlist = tree_cons (NULL, typed_null_pointer_node, parmlist);
+ }
+ else if (parmno == 1 && DECL_HAS_IN_CHARGE_PARM_P (fn))
+ {
+ tree in_charge = copy_node (in_charge_arg_for_name (DECL_NAME (clone)));
+ parmlist = tree_cons (NULL, in_charge, parmlist);
+ }
+ /* Map other parameters to their equivalents in the cloned
+ function. */
+ else
+ {
+ gcc_assert (clone_parm);
+ DECL_ABSTRACT_ORIGIN (clone_parm) = NULL;
+ parmlist = tree_cons (NULL, clone_parm, parmlist);
+ clone_parm = TREE_CHAIN (clone_parm);
+ }
+ if (fn_parm_typelist)
+ fn_parm_typelist = TREE_CHAIN (fn_parm_typelist);
+ }
+
+ /* We built this list backwards; fix now. */
+ parmlist = nreverse (parmlist);
+ mark_used (fn);
+ call = build_function_call (fn, parmlist);
+ expr_stmt = build_stmt (EXPR_STMT, call);
+ add_stmt (expr_stmt);
+
+ /* Now, expand this function into RTL, if appropriate. */
+ finish_function (0);
+ DECL_ABSTRACT_ORIGIN (clone) = NULL;
+ expand_body (clone);
+ pop_from_top_level ();
+ }
+ return 1;
+}
+/* APPLE LOCAL end structor thunks */
+
/* FN is a function that has a complete body. Clone the body as
necessary. Returns nonzero if there's no longer any need to
process the main body. */
@@ -94,8 +257,8 @@ maybe_clone_body (tree fn)
{
tree parm;
tree clone_parm;
- int parmno;
- splay_tree decl_map;
+ /* APPLE LOCAL structor thunks */
+ /* Delete some local variables. */
/* Update CLONE's source position information to match FN's. */
DECL_SOURCE_LOCATION (clone) = DECL_SOURCE_LOCATION (fn);
@@ -130,6 +293,28 @@ maybe_clone_body (tree fn)
parm = TREE_CHAIN (parm), clone_parm = TREE_CHAIN (clone_parm))
/* Update this parameter. */
update_cloned_parm (parm, clone_parm);
+ /* APPLE LOCAL structor thunks */
+ }
+
+ /* APPLE LOCAL begin structor thunks */
+ /* If we decide to turn clones into thunks, they will branch to fn.
+ Must have original function available to call. */
+ if (maybe_thunk_body (fn))
+ return 0;
+ /* APPLE LOCAL end structor thunks */
+
+ /* APPLE LOCAL begin structor thunks */
+ /* We know that any clones immediately follow FN in the TYPE_METHODS
+ list. */
+ for (clone = TREE_CHAIN (fn);
+ clone && DECL_CLONED_FUNCTION_P (clone);
+ clone = TREE_CHAIN (clone))
+ {
+ tree parm;
+ tree clone_parm;
+ int parmno;
+ splay_tree decl_map;
+ /* APPLE LOCAL end structor thunks */
/* Start processing the function. */
start_preparsed_function (clone, NULL_TREE, SF_PRE_PARSED);
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f38f6fbc78f..abdec2e4c88 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -36,6 +36,10 @@
#include "toplev.h"
#include "output.h"
#include "target.h"
+/* APPLE LOCAL Objective-C++ */
+#include "c-common.h"
+/* APPLE LOCAL pascal strings */
+#include "../../libcpp/internal.h"
/* The lexer. */
@@ -405,6 +409,25 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED ,
mapped to `const'. */
token->value = ridpointers[token->keyword];
}
+ /* APPLE LOCAL begin Objective-C++ */
+ /* Handle Objective-C++ keywords. */
+ else if (token->type == CPP_AT_NAME)
+ {
+ token->type = CPP_KEYWORD;
+ switch (C_RID_CODE (token->value))
+ {
+ /* Map 'class' to '@class', 'private' to '@private', etc. */
+ case RID_CLASS: token->keyword = RID_AT_CLASS; break;
+ case RID_PRIVATE: token->keyword = RID_AT_PRIVATE; break;
+ case RID_PROTECTED: token->keyword = RID_AT_PROTECTED; break;
+ case RID_PUBLIC: token->keyword = RID_AT_PUBLIC; break;
+ case RID_THROW: token->keyword = RID_AT_THROW; break;
+ case RID_TRY: token->keyword = RID_AT_TRY; break;
+ case RID_CATCH: token->keyword = RID_AT_CATCH; break;
+ default: token->keyword = C_RID_CODE (token->value);
+ }
+ }
+ /* APPLE LOCAL end Objective-C++ */
else
token->keyword = RID_MAX;
}
@@ -1638,6 +1661,81 @@ static bool cp_parser_extension_opt
static void cp_parser_label_declaration
(cp_parser *);
+/* APPLE LOCAL begin Objective-C++ */
+/* Objective-C++ Productions */
+
+static tree cp_parser_objc_message_receiver
+ (cp_parser *);
+static tree cp_parser_objc_message_args
+ (cp_parser *);
+static tree cp_parser_objc_message_expression
+ (cp_parser *);
+static tree cp_parser_objc_encode_expression
+ (cp_parser *);
+static tree cp_parser_objc_defs_expression
+ (cp_parser *);
+static tree cp_parser_objc_protocol_expression
+ (cp_parser *);
+static tree cp_parser_objc_selector_expression
+ (cp_parser *);
+static tree cp_parser_objc_expression
+ (cp_parser *);
+static void cp_parser_objc_visibility_spec
+ (cp_parser *);
+static void cp_parser_objc_method_type
+ (cp_parser *);
+static tree cp_parser_objc_protocol_qualifiers
+ (cp_parser *);
+static tree cp_parser_objc_typename
+ (cp_parser *);
+static bool cp_parser_objc_selector_p
+ (enum cpp_ttype);
+static tree cp_parser_objc_selector
+ (cp_parser *);
+static tree cp_parser_objc_method_keyword_params
+ (cp_parser *);
+static tree cp_parser_objc_method_tail_params_opt
+ (cp_parser *);
+static void cp_parser_objc_interstitial_code
+ (cp_parser *);
+static tree cp_parser_objc_method_signature
+ (cp_parser *);
+static void cp_parser_objc_method_prototype_list
+ (cp_parser *);
+static void cp_parser_objc_method_definition_list
+ (cp_parser *);
+static void cp_parser_objc_class_ivars
+ (cp_parser *);
+static tree cp_parser_objc_identifier_list
+ (cp_parser *);
+static void cp_parser_objc_alias_declaration
+ (cp_parser *);
+static void cp_parser_objc_class_declaration
+ (cp_parser *);
+static void cp_parser_objc_protocol_declaration
+ (cp_parser *);
+static tree cp_parser_objc_protocol_refs_opt
+ (cp_parser *);
+static void cp_parser_objc_superclass_or_category
+ (cp_parser *, tree *, tree *);
+static void cp_parser_objc_class_interface
+ (cp_parser *);
+static void cp_parser_objc_class_implementation
+ (cp_parser *);
+static void cp_parser_objc_end_implementation
+ (cp_parser *);
+static void cp_parser_objc_declaration
+ (cp_parser *);
+static tree cp_parser_objc_try_catch_finally_statement
+ (cp_parser *);
+static tree cp_parser_objc_synchronized_statement
+ (cp_parser *);
+static tree cp_parser_objc_throw_statement
+ (cp_parser *);
+static tree cp_parser_objc_statement
+ (cp_parser *);
+/* APPLE LOCAL end Objective-C++ */
+
/* Utility Routines */
static tree cp_parser_lookup_name
@@ -1763,6 +1861,33 @@ static bool cp_parser_is_keyword
static tree cp_parser_make_typename_type
(cp_parser *, tree, tree);
+/* APPLE LOCAL begin CW asm blocks */
+static tree cp_parser_cw_asm_compound_statement
+ (cp_parser *);
+static void cp_parser_cw_asm_declaration_seq_opt
+ (cp_parser *);
+static void cp_parser_cw_asm_line_seq_opt
+ (cp_parser *);
+static void cp_parser_cw_asm_line
+ (cp_parser *);
+static void cp_parser_cw_asm_statement_seq_opt
+ (cp_parser *);
+static void cp_parser_cw_asm_statement
+ (cp_parser *);
+static tree cp_parser_cw_asm_operands
+ (cp_parser *);
+static tree cp_parser_cw_asm_operand
+ (cp_parser *);
+static tree cp_parser_cw_asm_postfix_expression
+ (cp_parser *, bool);
+static tree cp_parser_cw_identifier_or_number
+ (cp_parser* parser);
+static tree cw_build_identifier_string
+ (cp_parser* parser, const char* str);
+static tree cp_parser_cw_asm_relative_branch
+ (cp_parser *parser);
+/* APPLE LOCAL end CW asm blocks */
+
/* Returns nonzero if we are parsing tentatively. */
static inline bool
@@ -2474,6 +2599,8 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
{
tree value;
bool wide = false;
+ /* APPLE LOCAL pascal strings */
+ bool pascal_p = false;
size_t count;
struct obstack str_ob;
cpp_string str, istr, *strs;
@@ -2498,6 +2625,11 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
count = 1;
if (tok->type == CPP_WSTRING)
wide = true;
+ /* APPLE LOCAL begin pascal strings */
+ else if (CPP_OPTION (parse_in, pascal_strings)
+ && str.text[1] == '\\' && str.text[2] == 'p')
+ pascal_p = true;
+ /* APPLE LOCAL end pascal strings */
strs = &str;
}
@@ -2514,6 +2646,11 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
str.len = TREE_STRING_LENGTH (tok->value);
if (tok->type == CPP_WSTRING)
wide = true;
+ /* APPLE LOCAL begin pascal strings */
+ else if (count == 1 && CPP_OPTION (parse_in, pascal_strings)
+ && str.text[1] == '\\' && str.text[2] == 'p')
+ pascal_p = true;
+ /* APPLE LOCAL end pascal strings */
obstack_grow (&str_ob, &str, sizeof (cpp_string));
@@ -2530,13 +2667,23 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
wide = false;
}
+ /* APPLE LOCAL begin pascal strings */
+ if (wide)
+ pascal_p = false;
+ /* APPLE LOCAL end pascal strings */
+
if ((translate ? cpp_interpret_string : cpp_interpret_string_notranslate)
- (parse_in, strs, count, &istr, wide))
+ /* APPLE LOCAL pascal strings */
+ (parse_in, strs, count, &istr, wide, pascal_p))
{
value = build_string (istr.len, (char *)istr.text);
free ((void *)istr.text);
- TREE_TYPE (value) = wide ? wchar_array_type_node : char_array_type_node;
+ /* APPLE LOCAL begin pascal strings */
+ TREE_TYPE (value) = wide ? wchar_array_type_node
+ : pascal_p ? pascal_string_type_node
+ : char_array_type_node;
+ /* APPLE LOCAL end pascal strings */
value = fix_string_type (value);
}
else
@@ -2637,6 +2784,13 @@ cp_parser_translation_unit (cp_parser* parser)
( compound-statement )
__builtin_va_arg ( assignment-expression , type-id )
+ APPLE LOCAL begin Objective-C++
+ Objective-C++ Extension:
+
+ primary-expression:
+ objc-expression
+ APPLE LOCAL end Objective-C++
+
literal:
__null
@@ -2658,6 +2812,8 @@ cp_parser_primary_expression (cp_parser *parser,
tree *qualifying_class)
{
cp_token *token;
+ /* APPLE LOCAL CW asm blocks */
+ int atsignhack = 0;
/* Assume the primary expression is not an id-expression. */
*idk = CP_ID_KIND_NONE;
@@ -2863,11 +3019,27 @@ cp_parser_primary_expression (cp_parser *parser,
case RID_OFFSETOF:
return cp_parser_builtin_offsetof (parser);
+ /* APPLE LOCAL begin Objective-C++ */
+ /* Objective-C++ expressions. */
+ case RID_AT_ENCODE:
+ case RID_AT_PROTOCOL:
+ case RID_AT_SELECTOR:
+ return cp_parser_objc_expression (parser);
+ /* APPLE LOCAL end Objective-C++ */
+
default:
cp_parser_error (parser, "expected primary-expression");
return error_mark_node;
}
+ /* APPLE LOCAL begin CW asm blocks */
+ case CPP_ATSIGN:
+ /* Recognize @-labels and handle them specially later. */
+ cp_lexer_consume_token (parser->lexer);
+ atsignhack = 1;
+ token = cp_lexer_peek_token (parser->lexer);
+ /* APPLE LOCAL end CW asm blocks */
+
/* An id-expression can start with either an identifier, a
`::' as the beginning of a qualified-id, or the "operator"
keyword. */
@@ -2888,6 +3060,11 @@ cp_parser_primary_expression (cp_parser *parser,
/*check_dependency_p=*/true,
/*template_p=*/NULL,
/*declarator_p=*/false);
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Replace the id with an id prefixed with @. */
+ if (atsignhack)
+ id_expression = prepend_char_identifier (id_expression, '@');
+ /* APPLE LOCAL end CW asm blocks */
if (id_expression == error_mark_node)
return error_mark_node;
/* If we have a template-id, then no further lookup is
@@ -2911,6 +3088,13 @@ cp_parser_primary_expression (cp_parser *parser,
been issued. */
if (ambiguous_p)
return error_mark_node;
+
+ /* APPLE LOCAL begin Objective-C++ */
+ /* In Objective-C++, an instance variable (ivar) may be preferred
+ to whatever cp_parser_lookup_name() found. */
+ decl = objc_lookup_ivar (decl, id_expression);
+ /* APPLE LOCAL end Objective-C++ */
+
/* If name lookup gives us a SCOPE_REF, then the
qualifying scope was dependent. Just propagate the
name. */
@@ -2961,6 +3145,13 @@ cp_parser_primary_expression (cp_parser *parser,
/* Anything else is an error. */
default:
+ /* APPLE LOCAL begin Objective-C++ */
+ /* ...unless we have an Objective-C++ message or string literal, that is. */
+ if (c_dialect_objc ()
+ && (token->type == CPP_OPEN_SQUARE || token->type == CPP_OBJC_STRING))
+ return cp_parser_objc_expression (parser);
+ /* APPLE LOCAL end Objective-C++ */
+
cp_parser_error (parser, "expected primary-expression");
return error_mark_node;
}
@@ -3319,6 +3510,22 @@ cp_parser_unqualified_id (cp_parser* parser,
return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
}
+ /* APPLE LOCAL begin CW asm blocks C++ */
+ case CPP_NUMBER:
+ {
+ if (flag_cw_asm_blocks
+ && TREE_CODE (token->value) == INTEGER_CST)
+ {
+ char buf[60];
+
+ sprintf (buf, HOST_WIDE_INT_PRINT_UNSIGNED, tree_low_cst (token->value, 0));
+ cp_lexer_consume_token (parser->lexer);
+ return get_identifier (buf);
+ }
+ goto bad;
+ }
+ /* APPLE LOCAL end CW asm blocks C++ */
+
case CPP_KEYWORD:
if (token->keyword == RID_OPERATOR)
{
@@ -3347,6 +3554,8 @@ cp_parser_unqualified_id (cp_parser* parser,
/* Fall through. */
default:
+ /* APPLE LOCAL CW asm blocks C++ */
+ bad:
cp_parser_error (parser, "expected unqualified-id");
return error_mark_node;
}
@@ -3961,7 +4170,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p, bool cast_p)
{
/* Warn the user that a compound literal is not
allowed in standard C++. */
- if (pedantic)
+ /* APPLE LOCAL Altivec initializers 3068233 */
+ if (pedantic && TREE_CODE (type) != VECTOR_TYPE)
pedwarn ("ISO C++ forbids compound-literals");
/* Form the representation of the compound-literal. */
postfix_expression
@@ -4645,8 +4855,13 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p)
switch (keyword)
{
- case RID_ALIGNOF:
+ /* APPLE LOCAL begin CW asm blocks */
case RID_SIZEOF:
+ if (cw_asm_block)
+ break;
+
+ case RID_ALIGNOF:
+ /* APPLE LOCAL end CW asm blocks */
{
tree operand;
enum tree_code op;
@@ -4800,6 +5015,14 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p, bool cast_p)
return expression;
}
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Postfix expressions in CW asm are more restricted and handled
+ quite differently, so diverge from the usual expression
+ precedence sequence here. */
+ if (cw_asm_block)
+ return cp_parser_cw_asm_postfix_expression (parser, address_p);
+ /* APPLE LOCAL end CW asm blocks */
+
return cp_parser_postfix_expression (parser, address_p, cast_p);
}
@@ -5394,6 +5617,14 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p)
token = cp_lexer_peek_token (parser->lexer);
new_prec = TOKEN_PRECEDENCE (token);
+ /* APPLE LOCAL begin CW asm blocks */
+ if (flag_cw_asm_blocks && cw_asm_block)
+ {
+ if ((token->flags & BOL) != 0)
+ new_prec = PREC_NOT_OPERATOR;
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
/* Popping an entry off the stack means we completed a subexpression:
- either we found a token which is not an operator (`>' where it is not
an operator, or prec == PREC_NOT_OPERATOR), in which case popping
@@ -5424,6 +5655,15 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p)
cases such as 3 + 4 + 5 or 3 * 4 + 5. */
token = cp_lexer_peek_token (parser->lexer);
lookahead_prec = TOKEN_PRECEDENCE (token);
+
+ /* APPLE LOCAL begin CW asm blocks */
+ if (flag_cw_asm_blocks && cw_asm_block)
+ {
+ if ((token->flags & BOL) != 0)
+ lookahead_prec = PREC_NOT_OPERATOR;
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
if (lookahead_prec > new_prec)
{
/* ... and prepare to parse the RHS of the new, higher priority
@@ -5454,6 +5694,15 @@ cp_parser_binary_expression (cp_parser* parser, bool cast_p)
lhs = sp->lhs;
}
+ /* APPLE LOCAL begin CW asm blocks */
+ if (cw_asm_block && TREE_CODE (rhs) == COMPOUND_EXPR)
+ {
+ gcc_assert (TREE_CODE (TREE_OPERAND (rhs, 1)) == IDENTIFIER_NODE);
+ lhs = build_x_binary_op (tree_type, lhs, TREE_OPERAND (rhs, 0), &overloaded_p);
+ lhs = cw_asm_build_register_offset (lhs, TREE_OPERAND (rhs, 1));
+ return lhs;
+ }
+ /* APPLE LOCAL end CW asm blocks */
overloaded_p = false;
lhs = build_x_binary_op (tree_type, lhs, rhs, &overloaded_p);
@@ -5925,6 +6174,17 @@ cp_parser_statement (cp_parser* parser, tree in_statement_expr)
statement = cp_parser_jump_statement (parser);
break;
+ /* APPLE LOCAL begin Objective-C++ */
+ /* Objective-C++ exception-handling constructs. */
+ case RID_AT_TRY:
+ case RID_AT_CATCH:
+ case RID_AT_FINALLY:
+ case RID_AT_SYNCHRONIZED:
+ case RID_AT_THROW:
+ statement = cp_parser_objc_statement (parser);
+ break;
+ /* APPLE LOCAL end Objective-C++ */
+
case RID_TRY:
statement = cp_parser_try_block (parser);
break;
@@ -6122,6 +6382,23 @@ cp_parser_compound_statement (cp_parser *parser, tree in_statement_expr,
return error_mark_node;
/* Begin the compound-statement. */
compound_stmt = begin_compound_stmt (in_try ? BCS_TRY_BLOCK : 0);
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Maybe this is the body of an asm function, which has asm lines
+ following the decls. */
+ if (cw_asm_state >= cw_asm_decls)
+ {
+ cw_asm_in_decl = 1;
+ cp_parser_cw_asm_declaration_seq_opt (parser);
+ cw_asm_in_decl = 0;
+ cw_asm_state = cw_asm_asm;
+ cw_asm_block = 1;
+ clear_cw_asm_labels ();
+ cp_parser_cw_asm_line_seq_opt (parser);
+ cw_asm_state = cw_asm_none;
+ cw_asm_block = 0;
+ }
+ else
+ /* APPLE LOCAL end CW asm blocks */
/* Parse an (optional) statement-seq. */
cp_parser_statement_seq_opt (parser, in_statement_expr);
/* Finish the compound-statement. */
@@ -6132,6 +6409,16 @@ cp_parser_compound_statement (cp_parser *parser, tree in_statement_expr,
return compound_stmt;
}
+/* APPLE LOCAL begin CW asm blocks */
+static bool
+cp_lexer_cw_bol (cp_lexer* lexer)
+{
+ cp_token *token = cp_lexer_peek_token (lexer);
+
+ return (token->flags & BOL) != 0;
+}
+/* APPLE LOCAL end CW asm blocks */
+
/* Parse an (optional) statement-seq.
statement-seq:
@@ -6151,6 +6438,14 @@ cp_parser_statement_seq_opt (cp_parser* parser, tree in_statement_expr)
/* Parse the statement. */
cp_parser_statement (parser, in_statement_expr);
+
+ /* APPLE LOCAL begin CW asm blocks */
+ if (flag_cw_asm_blocks
+ && cw_asm_state >= cw_asm_decls
+ && (cp_lexer_cw_bol (parser->lexer)
+ || cp_lexer_next_token_is (parser->lexer, CPP_NAME)))
+ break;
+ /* APPLE LOCAL end CW asm blocks */
}
}
@@ -6826,6 +7121,11 @@ cp_parser_declaration (cp_parser* parser)
/* An unnamed namespace definition. */
|| token2.type == CPP_OPEN_BRACE))
cp_parser_namespace_definition (parser);
+ /* APPLE LOCAL begin Objective-C++ */
+ /* Objective-C++ declaration/definition. */
+ else if (c_dialect_objc () && OBJC_IS_AT_KEYWORD (token1.keyword))
+ cp_parser_objc_declaration (parser);
+ /* APPLE LOCAL end Objective-C++ */
/* We must have either a block declaration or a function
definition. */
else
@@ -6965,6 +7265,13 @@ cp_parser_simple_declaration (cp_parser* parser,
if (!function_definition_allowed_p
&& !decl_specifiers.any_specifiers_p)
{
+ /* APPLE LOCAL begin CW asm blocks */
+ /* We might have seen an asm opcode, and it's time to switch to
+ asm instruction handling. */
+ if (flag_cw_asm_blocks && cw_asm_state >= cw_asm_decls)
+ return;
+ /* APPLE LOCAL end CW asm blocks */
+
cp_parser_error (parser, "expected declaration");
goto done;
}
@@ -7079,6 +7386,11 @@ cp_parser_simple_declaration (cp_parser* parser,
/* Consume the `;'. */
cp_parser_require (parser, CPP_SEMICOLON, "`;'");
+ /* APPLE LOCAL begin CW asm blocks */
+ if (flag_cw_asm_blocks)
+ cw_asm_in_decl = 0;
+ /* APPLE LOCAL end CW asm blocks */
+
done:
pop_deferring_access_checks ();
}
@@ -7234,6 +7546,15 @@ cp_parser_decl_specifier_seq (cp_parser* parser,
++decl_specs->specs[(int) ds_thread];
break;
+ /* APPLE LOCAL begin CW asm blocks */
+ /* If we ever get here, we must be in CW asm mode. */
+ case RID_ASM:
+ /* Consume the token. */
+ cp_lexer_consume_token (parser->lexer);
+ ++decl_specs->specs[(int) ds_cw_asm];
+ break;
+ /* APPLE LOCAL end CW asm blocks */
+
default:
/* We did not yet find a decl-specifier yet. */
found_decl_spec = false;
@@ -7355,6 +7676,10 @@ cp_parser_storage_class_specifier_opt (cp_parser* parser)
case RID_EXTERN:
case RID_MUTABLE:
case RID_THREAD:
+ /* APPLE LOCAL begin CW asm blocks */
+ /* If we ever get here, we must be in CW asm mode. */
+ case RID_ASM:
+ /* APPLE LOCAL end CW asm blocks */
/* Consume the token. */
return cp_lexer_consume_token (parser->lexer)->value;
@@ -9562,7 +9887,28 @@ cp_parser_simple_type_specifier (cp_parser* parser,
followed by a "<". That usually indicates that the user thought
that the type was a template. */
if (type && type != error_mark_node)
- cp_parser_check_for_invalid_template_id (parser, TREE_TYPE (type));
+ /* APPLE LOCAL begin Objective-C++ */
+ {
+ /* As a last-ditch effort, see if TYPE is an Objective-C type.
+ If it is, then the '<'...'>' enclose protocol names rather than
+ template arguments, and so everything is fine. */
+ if (c_dialect_objc ()
+ && (objc_is_id (type) || objc_is_class_name (type)))
+ {
+ tree protos = cp_parser_objc_protocol_refs_opt (parser);
+ tree qual_type = objc_get_protocol_qualified_type (type, protos);
+
+ /* Clobber the "unqualified" type previously entered into
+ DECL_SPECS with the new, improved protocol-qualifed version. */
+ if (decl_specs)
+ decl_specs->type = qual_type;
+
+ return qual_type;
+ }
+
+ cp_parser_check_for_invalid_template_id (parser, TREE_TYPE (type));
+ }
+ /* APPLE LOCAL end Objective-C++ */
return type;
}
@@ -9608,6 +9954,19 @@ cp_parser_type_name (cp_parser* parser)
/* Look up the type-name. */
type_decl = cp_parser_lookup_name_simple (parser, identifier);
+
+ /* APPLE LOCAL begin Objective-C++ */
+ if (TREE_CODE (type_decl) != TYPE_DECL
+ && (objc_is_id (identifier) || objc_is_class_name (identifier)))
+ {
+ /* See if this is an Objective-C type. */
+ tree protos = cp_parser_objc_protocol_refs_opt (parser);
+ tree type = objc_get_protocol_qualified_type (identifier, protos);
+ if (type)
+ type_decl = TYPE_NAME (type);
+ }
+ /* APPLE LOCAL end Objective-C++ */
+
/* Issue an error if we did not find a type-name. */
if (TREE_CODE (type_decl) != TYPE_DECL)
{
@@ -10326,6 +10685,8 @@ cp_parser_using_directive (cp_parser* parser)
asm-definition:
asm ( string-literal ) ;
+ APPLE LOCAL CW asm blocks
+ asm { asm-line [opt] }
GNU Extension:
@@ -10349,6 +10710,27 @@ cp_parser_asm_definition (cp_parser* parser)
bool volatile_p = false;
bool extended_p = false;
+ /* APPLE LOCAL begin CW asm blocks */
+ cp_token *nextup;
+ /* Detect when a leading `asm' is actually a spec of an asm function
+ rather than an asm statement or block. */
+ if (flag_cw_asm_blocks)
+ {
+ nextup = cp_lexer_peek_nth_token (parser->lexer, 2);
+ if (!((nextup->type == CPP_OPEN_PAREN)
+ || (nextup->keyword == RID_VOLATILE
+ && cp_lexer_peek_nth_token (parser->lexer, 3)->type == CPP_OPEN_PAREN)
+ || (nextup->type == CPP_OPEN_BRACE)))
+ {
+ /* An asm function - we'll treat the `asm' as if it were a
+ storage class spec, which will eventually affect function
+ body parsing. */
+ cp_parser_simple_declaration (parser, true);
+ return;
+ }
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
/* Look for the `asm' keyword. */
cp_parser_require_keyword (parser, RID_ASM, "`asm'");
/* See if the next token is `volatile'. */
@@ -10360,6 +10742,21 @@ cp_parser_asm_definition (cp_parser* parser)
/* Consume the token. */
cp_lexer_consume_token (parser->lexer);
}
+ /* APPLE LOCAL begin CW asm blocks */
+ /* A CW-style asm block is introduced by an open brace. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
+ {
+ if (flag_cw_asm_blocks)
+ {
+ cp_parser_cw_asm_compound_statement (parser);
+ }
+ else
+ {
+ error ("asm blocks not enabled, use `-fasm-blocks'");
+ }
+ return;
+ }
+ /* APPLE LOCAL end CW asm blocks */
/* Look for the opening `('. */
if (!cp_parser_require (parser, CPP_OPEN_PAREN, "`('"))
return;
@@ -11693,7 +12090,11 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error)
/* Peek at the next token. */
if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_PAREN)
- || cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS))
+ /* APPLE LOCAL begin Objective-C++ */
+ || cp_lexer_next_token_is (parser->lexer, CPP_ELLIPSIS)
+ || cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)
+ || cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE))
+ /* APPLE LOCAL end Objective-C++ */
/* The parameter-declaration-list is complete. */
break;
else if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
@@ -13027,6 +13428,24 @@ cp_parser_member_declaration (cp_parser* parser)
return;
}
+ /* APPLE LOCAL begin Objective-C++ */
+ /* Check for @defs. */
+ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_AT_DEFS))
+ {
+ tree ivar, member;
+ tree ivar_chains = cp_parser_objc_defs_expression (parser);
+ ivar = ivar_chains;
+ while (ivar)
+ {
+ member = ivar;
+ ivar = TREE_CHAIN (member);
+ TREE_CHAIN (member) = NULL_TREE;
+ finish_member_declaration (member);
+ }
+ return;
+ }
+ /* APPLE LOCAL end Objective-C++ */
+
/* Parse the decl-specifier-seq. */
cp_parser_decl_specifier_seq (parser,
CP_PARSER_FLAGS_OPTIONAL,
@@ -15991,6 +16410,1820 @@ cp_parser_allow_gnu_extensions_p (cp_parser* parser)
return parser->allow_gnu_extensions_p;
}
+/* APPLE LOCAL begin CW asm blocks */
+
+/* This is the section of CW-asm-specific parsing functions. */
+
+static tree
+cp_parser_cw_asm_compound_statement (cp_parser *parser)
+{
+ tree compound_stmt;
+
+ cw_asm_state = cw_asm_asm;
+ cw_asm_block = 1;
+ cw_asm_at_bol = 1;
+ clear_cw_asm_labels ();
+ if (!cp_parser_require (parser, CPP_OPEN_BRACE, "`{'"))
+ return error_mark_node;
+ /* Begin the compound-statement. */
+ compound_stmt = begin_compound_stmt (/*has_no_scope=*/false);
+ /* Parse an (optional) statement-seq. */
+ cp_parser_cw_asm_line_seq_opt (parser);
+ /* Finish the compound-statement. */
+ finish_compound_stmt (compound_stmt);
+ /* Consume the `}'. */
+ cp_parser_require (parser, CPP_CLOSE_BRACE, "`}'");
+ /* We're done with the block of asm. */
+ cw_asm_block = 0;
+ cw_asm_state = cw_asm_none;
+ return compound_stmt;
+}
+
+static void
+cp_parser_cw_asm_declaration_seq_opt (cp_parser* parser)
+{
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ if (token->type == CPP_NAME
+ && !cw_asm_typename_or_reserved (token->value))
+ return;
+
+ /* Scan declarations until there aren't any more. */
+ while (true)
+ {
+ /* If we're looking at a `}', then we've run out of statements. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE)
+ || cp_lexer_next_token_is (parser->lexer, CPP_EOF))
+ break;
+
+ /* Parse a declaration. */
+ cp_parser_simple_declaration (parser, false);
+
+ /* CPP_PRAGMA is a #pragma inside a function body, which
+ constitutes a declaration all its own. */
+ if (token->type == CPP_PRAGMA)
+ cp_lexer_handle_pragma (parser->lexer);
+
+ if (cw_asm_state >= cw_asm_decls
+ && (cp_lexer_cw_bol (parser->lexer)
+ || cp_lexer_next_token_is (parser->lexer, CPP_NAME)))
+ break;
+ }
+}
+
+/* Parse an (optional) line-seq.
+
+ line-seq:
+ line
+ line-seq [opt] line */
+
+static void
+cp_parser_cw_asm_line_seq_opt (cp_parser* parser)
+{
+ /* Scan lines of asm until there aren't any more. */
+ while (true)
+ {
+ /* If we're looking at a `}', then we've run out of lines. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE)
+ || cp_lexer_next_token_is (parser->lexer, CPP_EOF))
+ break;
+
+ /* Parse the line. */
+ cp_parser_cw_asm_line (parser);
+ }
+}
+
+static void
+cp_parser_cw_asm_line (cp_parser* parser)
+{
+ cp_parser_cw_asm_statement_seq_opt (parser);
+}
+
+static void
+cp_parser_cw_asm_statement_seq_opt (cp_parser* parser)
+{
+ /* Scan statements until there aren't any more. */
+ while (true)
+ {
+ if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE)
+ || cp_lexer_next_token_is (parser->lexer, CPP_EOF))
+ break;
+
+ /* Semicolons divide up individual statements. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
+ cp_lexer_consume_token (parser->lexer);
+
+ /* Parse a single statement. */
+ cp_parser_cw_asm_statement (parser);
+
+ /* We parse at most, one line. */
+ if (cp_lexer_cw_bol (parser->lexer))
+ break;
+
+ if (!(cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE)
+ || cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)))
+ {
+ cp_parser_error (parser, "expected `;' or `}' or end-of-line");
+ }
+ }
+}
+
+/* Build an identifier comprising the string passed and the
+ next token. */
+
+static tree
+cw_build_identifier_string (cp_parser* parser, const char* str)
+{
+ char *buf;
+ int len;
+ tree id;
+
+ id = cp_parser_cw_identifier_or_number (parser);
+ len = strlen (str);
+ buf = (char *) alloca (IDENTIFIER_LENGTH (id) + len + 1);
+ memcpy (buf, str, len);
+ memcpy (buf+len, IDENTIFIER_POINTER (id), IDENTIFIER_LENGTH (id));
+ buf[IDENTIFIER_LENGTH (id) + len] = 0;
+ return get_identifier (buf);
+}
+
+/* Parse a CW asm identifier. Returns an IDENTIFIER_NODE representing
+ the identifier. The CW asm identifieriers include [.+-] as part of
+ the identifier. */
+
+static tree
+cp_parser_cw_identifier (cp_parser* parser)
+{
+ cp_token *token;
+ tree t;
+ const char *str = "";
+
+ /* We have to accept certain keywords. */
+ token = cp_lexer_peek_token (parser->lexer);
+ if (token->flags & NAMED_OP)
+ {
+ const char *s = 0;
+ switch (token->type) {
+ case CPP_AND_AND: s="and"; break;
+ case CPP_AND_EQ: s="and_eq"; break;
+ case CPP_AND: s="bitand"; break;
+ case CPP_OR: s="bitor"; break;
+ case CPP_COMPL: s="compl"; break;
+ case CPP_NOT: s="not"; break;
+ case CPP_NOT_EQ: s="not_eq"; break;
+ case CPP_OR_OR: s="or"; break;
+ case CPP_OR_EQ: s="or_eq"; break;
+ case CPP_XOR: s="xor"; break;
+ case CPP_XOR_EQ: s="xor_eq"; break;
+ default: break;
+ }
+
+ /* The above list is the entire list of named operators. We
+ can't fail to translate the name. See operator_array in
+ libcpp/init.c. */
+ gcc_assert (s != 0);
+ cp_lexer_consume_token (parser->lexer);
+ t = get_identifier (s);
+ }
+ else
+ if (token->type == CPP_DOT)
+ {
+ /* .align */
+ cp_lexer_consume_token (parser->lexer);
+ t = cw_build_identifier_string (parser, ".");
+ }
+ else
+ t = cp_parser_identifier (parser);
+
+ if (t == error_mark_node)
+ return t;
+
+ token = cp_lexer_peek_token (parser->lexer);
+
+ switch (token->type)
+ {
+ case CPP_DOT:
+ str = ".";
+ break;
+ case CPP_PLUS:
+ str = "+";
+ break;
+ case CPP_MINUS:
+ str = "-";
+ break;
+ case CPP_PLUS_PLUS:
+ str = "++";
+ break;
+ case CPP_MINUS_MINUS:
+ str = "--";
+ break;
+ default:
+ return t;
+ }
+
+ /* If there was whitespace between the identifier and the [.+-]
+ character, then that character can't be part of the
+ identifier. */
+ if (token->flags & PREV_WHITE)
+ return t;
+
+ cp_lexer_consume_token (parser->lexer);
+
+ return cw_get_identifier (t, str);
+}
+
+static tree
+cp_parser_cw_identifier_or_number (cp_parser* parser)
+{
+ cp_token *token;
+
+ token = cp_lexer_peek_token (parser->lexer);
+ if (token->type == CPP_NUMBER
+ && TREE_CODE (token->value) == INTEGER_CST)
+ {
+ char buf[60];
+
+ sprintf (buf, HOST_WIDE_INT_PRINT_UNSIGNED, tree_low_cst (token->value, 0));
+ cp_lexer_consume_token (parser->lexer);
+ return get_identifier (buf);
+ }
+
+ return cp_parser_identifier (parser);
+}
+
+static void
+cp_parser_cw_asm_statement (cp_parser* parser)
+{
+ tree aname, scspec, anothername, operands;
+
+ /* Keep sucking labels from the front of the statement until a
+ non-label is seen. */
+ while (true)
+ {
+ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)
+ || cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE)
+ || cp_lexer_next_token_is (parser->lexer, CPP_EOF))
+ break;
+
+ if (cp_lexer_next_token_is (parser->lexer, CPP_PRAGMA))
+ {
+ cp_lexer_handle_pragma (parser->lexer);
+ }
+ else if (cp_lexer_next_token_is (parser->lexer, CPP_ATSIGN))
+ {
+ cp_lexer_consume_token (parser->lexer);
+ aname = cp_parser_cw_identifier_or_number (parser);
+ /* Optional ':' after a label. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))
+ cp_lexer_consume_token (parser->lexer);
+ cw_asm_label (aname, 1);
+ }
+ else
+ {
+ aname = cp_parser_cw_identifier (parser);
+ if (cp_lexer_next_token_is (parser->lexer, CPP_COLON))
+ {
+ cp_lexer_consume_token (parser->lexer);
+ cw_asm_label (aname, 0);
+ }
+ else
+ {
+ scspec = cp_parser_storage_class_specifier_opt (parser);
+ if (scspec)
+ {
+ anothername = cp_parser_cw_asm_operand (parser);
+ cw_asm_entry (aname, scspec, anothername);
+ }
+ else
+ {
+ cw_asm_in_operands = 1;
+ operands = cp_parser_cw_asm_operands (parser);
+ cw_asm_stmt (aname, operands, input_line);
+ }
+ break;
+ }
+ }
+
+ if (cp_lexer_cw_bol (parser->lexer))
+ break;
+ }
+}
+
+tree
+cp_parser_cw_asm_operands (cp_parser *parser)
+{
+ tree operands = NULL_TREE, operand;
+
+ while (true)
+ {
+ /* If we're looking at the end of the line, then we've run out of operands. */
+ if (cp_lexer_cw_bol (parser->lexer)
+ || cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON)
+ || cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE)
+ || cp_lexer_next_token_is (parser->lexer, CPP_EOF))
+ break;
+
+ operand = cp_parser_cw_asm_operand (parser);
+
+ if (operand)
+ {
+ operands = chainon (operands, build_tree_list (NULL_TREE, operand));
+ if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
+ cp_lexer_consume_token (parser->lexer);
+ }
+ else
+ {
+ return error_mark_node;
+ }
+ }
+
+ return operands;
+}
+
+tree
+cp_parser_cw_asm_operand (cp_parser *parser)
+{
+ tree operand;
+
+ /* Jump into the usual operand precedence stack. */
+ operand = cp_parser_binary_expression (parser, false);
+
+ return operand;
+}
+
+/* Need to handle case of relative branch using: .[+|-]number
+ syntax */
+static tree
+cp_parser_cw_asm_relative_branch (cp_parser *parser)
+{
+ cp_token *token;
+ token = cp_lexer_peek_nth_token (parser->lexer, 2);
+ if (token->type == CPP_PLUS || token->type == CPP_MINUS)
+ {
+ const char *str = (token->type == CPP_PLUS) ? ".+" : ".-";
+ /* consume '.' */
+ cp_lexer_consume_token (parser->lexer);
+ /* consume '-' or '+' */
+ cp_lexer_consume_token (parser->lexer);
+ return cw_build_identifier_string (parser, str);
+ }
+ return error_mark_node;
+}
+
+/* Parse a CW asm-style postfix-expression.
+
+ postfix-expression:
+ primary-expression
+ postfix-expression [ expression ]
+ postfix-expression ( expression-list [opt] )
+ simple-type-specifier ( expression-list [opt] )
+ postfix-expression . template [opt] id-expression
+ postfix-expression -> template [opt] id-expression
+ postfix-expression . pseudo-destructor-name
+ postfix-expression -> pseudo-destructor-name
+ typeid ( expression )
+ typeid ( type-id )
+
+ GNU Extension:
+
+ postfix-expression:
+ ( type-id ) { initializer-list , [opt] }
+
+ This extension is a GNU version of the C99 compound-literal
+ construct. (The C99 grammar uses `type-name' instead of `type-id',
+ but they are essentially the same concept.)
+
+ If ADDRESS_P is true, the postfix expression is the operand of the
+ `&' operator.
+
+ Returns a representation of the expression. */
+
+static tree
+cp_parser_cw_asm_postfix_expression (cp_parser *parser, bool address_p)
+{
+ bool for_offsetof = false;
+ cp_token *token;
+ enum rid keyword;
+ cp_id_kind idk = CP_ID_KIND_NONE;
+ tree postfix_expression = NULL_TREE;
+ /* Non-NULL only if the current postfix-expression can be used to
+ form a pointer-to-member. In that case, QUALIFYING_CLASS is the
+ class used to qualify the member. */
+ tree qualifying_class = NULL_TREE;
+
+ /* Peek at the next token. */
+ token = cp_lexer_peek_token (parser->lexer);
+ /* Some of the productions are determined by keywords. */
+ keyword = token->keyword;
+ switch (keyword)
+ {
+ /* APPLE LOCAL begin CW asm blocks */
+ case RID_SIZEOF:
+ {
+ tree operand;
+ /* Consume the token. */
+ cp_lexer_consume_token (parser->lexer);
+ /* Parse the operand. */
+ operand = cp_parser_sizeof_operand (parser, keyword);
+ postfix_expression = cxx_sizeof_or_alignof_type (operand, SIZEOF_EXPR, true);
+ break;
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
+ default:
+ {
+ tree type;
+
+ /* If the next thing is a simple-type-specifier, we may be
+ looking at a functional cast. We could also be looking at
+ an id-expression. So, we try the functional cast, and if
+ that doesn't work we fall back to the primary-expression. */
+ cp_parser_parse_tentatively (parser);
+ /* Look for the simple-type-specifier. */
+ type = cp_parser_simple_type_specifier (parser,
+ CP_PARSER_FLAGS_NONE,
+ /*identifier_p=*/false);
+ /* Parse the cast itself. */
+ if (!cp_parser_error_occurred (parser))
+ postfix_expression
+ = cp_parser_functional_cast (parser, type);
+ /* If that worked, we're done. */
+ if (cp_parser_parse_definitely (parser))
+ break;
+
+ if (token->type == CPP_DOT)
+ {
+ postfix_expression = cp_parser_cw_asm_relative_branch (parser);
+ if (postfix_expression != error_mark_node)
+ break;
+ }
+
+ /* If the functional-cast didn't work out, try a
+ compound-literal. */
+ if (cp_parser_allow_gnu_extensions_p (parser)
+ && cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN))
+ {
+ tree initializer_list = NULL_TREE;
+ bool saved_in_type_id_in_expr_p;
+
+ cp_parser_parse_tentatively (parser);
+ /* Consume the `('. */
+ cp_lexer_consume_token (parser->lexer);
+ /* Parse the type. */
+ saved_in_type_id_in_expr_p = parser->in_type_id_in_expr_p;
+ parser->in_type_id_in_expr_p = true;
+ type = cp_parser_type_id (parser);
+ parser->in_type_id_in_expr_p = saved_in_type_id_in_expr_p;
+ /* Look for the `)'. */
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+ /* Look for the `{'. */
+ cp_parser_require (parser, CPP_OPEN_BRACE, "`{'");
+ /* If things aren't going well, there's no need to
+ keep going. */
+ if (!cp_parser_error_occurred (parser))
+ {
+ bool non_constant_p;
+ /* Parse the initializer-list. */
+ initializer_list
+ = cp_parser_initializer_list (parser, &non_constant_p);
+ /* Allow a trailing `,'. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_COMMA))
+ cp_lexer_consume_token (parser->lexer);
+ /* Look for the final `}'. */
+ cp_parser_require (parser, CPP_CLOSE_BRACE, "`}'");
+ }
+ /* If that worked, we're definitely looking at a
+ compound-literal expression. */
+ if (cp_parser_parse_definitely (parser))
+ {
+ /* Warn the user that a compound literal is not
+ allowed in standard C++. */
+ if (pedantic)
+ pedwarn ("ISO C++ forbids compound-literals");
+ /* Form the representation of the compound-literal. */
+ postfix_expression
+ = finish_compound_literal (type, initializer_list);
+ break;
+ }
+ }
+
+ /* It must be a primary-expression. */
+ postfix_expression = cp_parser_primary_expression (parser,
+ false,
+ &idk,
+ &qualifying_class);
+ }
+ break;
+ }
+
+ /* If we were avoiding committing to the processing of a
+ qualified-id until we knew whether or not we had a
+ pointer-to-member, we now know. */
+ if (qualifying_class)
+ {
+ bool done;
+
+ /* Peek at the next token. */
+ token = cp_lexer_peek_token (parser->lexer);
+ done = (token->type != CPP_OPEN_SQUARE
+ && token->type != CPP_OPEN_PAREN
+ && token->type != CPP_DOT
+ && token->type != CPP_DEREF
+ && token->type != CPP_PLUS_PLUS
+ && token->type != CPP_MINUS_MINUS);
+
+ postfix_expression = finish_qualified_id_expr (qualifying_class,
+ postfix_expression,
+ done,
+ address_p);
+ if (done)
+ return postfix_expression;
+ }
+
+ /* Keep looping until the postfix-expression is complete. */
+ while (true)
+ {
+ if (idk == CP_ID_KIND_UNQUALIFIED
+ && TREE_CODE (postfix_expression) == IDENTIFIER_NODE
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN))
+ /* It is not a Koenig lookup function call. */
+ postfix_expression
+ = unqualified_name_lookup_error (postfix_expression);
+
+ /* Peek at the next token. */
+ token = cp_lexer_peek_token (parser->lexer);
+
+ switch (token->type)
+ {
+ case CPP_OPEN_SQUARE:
+ /* postfix-expression [ expression ] */
+ {
+ tree index;
+
+ /* Consume the `[' token. */
+ cp_lexer_consume_token (parser->lexer);
+ /* Parse the index expression. */
+ index = cp_parser_expression (parser, false);
+ /* Look for the closing `]'. */
+ cp_parser_require (parser, CPP_CLOSE_SQUARE, "`]'");
+
+ /* Build the ARRAY_REF. */
+ postfix_expression
+ = grok_array_decl (postfix_expression, index);
+ idk = CP_ID_KIND_NONE;
+ /* Array references are not permitted in
+ constant-expressions. */
+ if (cp_parser_non_integral_constant_expression
+ (parser, "an array reference"))
+ postfix_expression = error_mark_node;
+ }
+ break;
+
+ case CPP_OPEN_PAREN:
+ /* postfix-expression ( expression ) */
+ {
+ tree expr;
+
+ cp_lexer_consume_token (parser->lexer);
+ expr = cp_parser_binary_expression (parser, false);
+
+ if (expr == error_mark_node)
+ {
+ postfix_expression = error_mark_node;
+ break;
+ }
+
+ postfix_expression =
+ cw_asm_build_register_offset (postfix_expression, expr);
+
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+
+ /* The POSTFIX_EXPRESSION is certainly no longer an id. */
+ idk = CP_ID_KIND_NONE;
+ }
+ break;
+
+ case CPP_DOT:
+ /* Disambiguation of asm's last operand followed by a '.'.
+ This happens when an asm instruction is followed by a
+ directive, such as .align. Bail out early. */
+ if (TREE_CODE (postfix_expression) == INTEGER_CST
+ || TREE_CODE (postfix_expression) == IDENTIFIER_NODE
+ || TREE_CODE (postfix_expression) == COMPOUND_EXPR)
+ return postfix_expression;
+
+ case CPP_DEREF:
+ /* postfix-expression . template [opt] id-expression
+ postfix-expression . pseudo-destructor-name
+ postfix-expression -> template [opt] id-expression
+ postfix-expression -> pseudo-destructor-name */
+ {
+ tree name;
+ bool dependent_p;
+ bool template_p;
+ tree scope = NULL_TREE;
+ enum cpp_ttype token_type = token->type;
+
+ /* If this is a `->' operator, dereference the pointer. */
+ if (token->type == CPP_DEREF)
+ postfix_expression = build_x_arrow (postfix_expression);
+ /* Check to see whether or not the expression is
+ type-dependent. */
+ dependent_p = type_dependent_expression_p (postfix_expression);
+ /* The identifier following the `->' or `.' is not
+ qualified. */
+ parser->scope = NULL_TREE;
+ parser->qualifying_scope = NULL_TREE;
+ parser->object_scope = NULL_TREE;
+ idk = CP_ID_KIND_NONE;
+ /* Enter the scope corresponding to the type of the object
+ given by the POSTFIX_EXPRESSION. */
+ if (!dependent_p
+ && TREE_TYPE (postfix_expression) != NULL_TREE)
+ {
+ scope = TREE_TYPE (postfix_expression);
+ /* According to the standard, no expression should
+ ever have reference type. Unfortunately, we do not
+ currently match the standard in this respect in
+ that our internal representation of an expression
+ may have reference type even when the standard says
+ it does not. Therefore, we have to manually obtain
+ the underlying type here. */
+ scope = non_reference (scope);
+ /* The type of the POSTFIX_EXPRESSION must be
+ complete. */
+ scope = complete_type_or_else (scope, NULL_TREE);
+ /* Let the name lookup machinery know that we are
+ processing a class member access expression. */
+ parser->context->object_type = scope;
+ /* If something went wrong, we want to be able to
+ discern that case, as opposed to the case where
+ there was no SCOPE due to the type of expression
+ being dependent. */
+ if (!scope)
+ scope = error_mark_node;
+ /* If the SCOPE was erroneous, make the various
+ semantic analysis functions exit quickly -- and
+ without issuing additional error messages. */
+ if (scope == error_mark_node)
+ postfix_expression = error_mark_node;
+ }
+
+ /* Consume the `.' or `->' operator. */
+ cp_lexer_consume_token (parser->lexer);
+ /* If the SCOPE is not a scalar type, we are looking at an
+ ordinary class member access expression, rather than a
+ pseudo-destructor-name. */
+ if (!scope || !SCALAR_TYPE_P (scope))
+ {
+ template_p = cp_parser_optional_template_keyword (parser);
+ /* Parse the id-expression. */
+ name = cp_parser_id_expression (parser,
+ template_p,
+ /*check_dependency_p=*/true,
+ /*template_p=*/NULL,
+ /*declarator_p=*/false);
+ /* In general, build a SCOPE_REF if the member name is
+ qualified. However, if the name was not dependent
+ and has already been resolved; there is no need to
+ build the SCOPE_REF. For example;
+
+ struct X { void f(); };
+ template <typename T> void f(T* t) { t->X::f(); }
+
+ Even though "t" is dependent, "X::f" is not and has
+ been resolved to a BASELINK; there is no need to
+ include scope information. */
+
+ /* But we do need to remember that there was an explicit
+ scope for virtual function calls. */
+ if (parser->scope)
+ idk = CP_ID_KIND_QUALIFIED;
+
+ if (name != error_mark_node
+ && !BASELINK_P (name)
+ && parser->scope)
+ {
+ name = build_nt (SCOPE_REF, parser->scope, name);
+ parser->scope = NULL_TREE;
+ parser->qualifying_scope = NULL_TREE;
+ parser->object_scope = NULL_TREE;
+ }
+ if (scope && name && BASELINK_P (name))
+ adjust_result_of_qualified_name_lookup
+ (name, BINFO_TYPE (BASELINK_BINFO (name)), scope);
+ postfix_expression
+ = cw_asm_cp_build_component_ref (postfix_expression, name);
+ }
+ /* Otherwise, try the pseudo-destructor-name production. */
+ else
+ {
+ tree s = NULL_TREE;
+ tree type;
+
+ /* Parse the pseudo-destructor-name. */
+ cp_parser_pseudo_destructor_name (parser, &s, &type);
+ /* Form the call. */
+ postfix_expression
+ = finish_pseudo_destructor_expr (postfix_expression,
+ s, TREE_TYPE (type));
+ }
+
+ /* We no longer need to look up names in the scope of the
+ object on the left-hand side of the `.' or `->'
+ operator. */
+ parser->context->object_type = NULL_TREE;
+
+ /* Outside of offsetof, these operators may not appear in
+ constant-expressions. */
+ if (!for_offsetof
+ && (cp_parser_non_integral_constant_expression
+ (parser, token_type == CPP_DEREF ? "'->'" : "`.'")))
+ postfix_expression = error_mark_node;
+ }
+ break;
+
+ default:
+ return postfix_expression;
+ }
+ }
+
+ /* We should never get here. */
+ abort ();
+ return error_mark_node;
+}
+
+int
+cw_asm_typename_or_reserved (tree value)
+{
+ return (C_IS_RESERVED_WORD (value));
+}
+/* APPLE LOCAL end CW asm blocks */
+
+/* APPLE LOCAL begin Objective-C++ */
+/* Objective-C++ Productions */
+
+
+/* Parse an Objective-C expression, which feeds into a primary-expression
+ above.
+
+ objc-expression:
+ objc-message-expression
+ objc-string-literal
+ objc-encode-expression
+ objc-protocol-expression
+ objc-selector-expression
+
+ Returns a tree representation of the expression. */
+
+static tree
+cp_parser_objc_expression (cp_parser* parser)
+{
+ /* Try to figure out what kind of declaration is present. */
+ cp_token *kwd = cp_lexer_peek_token (parser->lexer);
+
+ switch (kwd->type)
+ {
+ case CPP_OPEN_SQUARE:
+ return cp_parser_objc_message_expression (parser);
+
+ case CPP_OBJC_STRING:
+ kwd = cp_lexer_consume_token (parser->lexer);
+ return objc_build_string_object (kwd->value);
+
+ case CPP_KEYWORD:
+ switch (kwd->keyword)
+ {
+ case RID_AT_ENCODE:
+ return cp_parser_objc_encode_expression (parser);
+
+ case RID_AT_PROTOCOL:
+ return cp_parser_objc_protocol_expression (parser);
+
+ case RID_AT_SELECTOR:
+ return cp_parser_objc_selector_expression (parser);
+
+ default:
+ break;
+ }
+ default:
+ error ("misplaced `@%D' Objective-C++ construct", kwd->value);
+ cp_parser_skip_to_end_of_block_or_statement (parser);
+ }
+
+ return error_mark_node;
+}
+
+/* Parse an Objective-C message expression.
+
+ objc-message-expression:
+ [ objc-message-receiver objc-message-args ]
+
+ Returns a representation of an Objective-C message. */
+
+static tree
+cp_parser_objc_message_expression (cp_parser* parser)
+{
+ tree receiver, messageargs;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '['. */
+ receiver = cp_parser_objc_message_receiver (parser);
+ messageargs = cp_parser_objc_message_args (parser);
+ cp_parser_require (parser, CPP_CLOSE_SQUARE, "`]'");
+
+ return objc_build_message_expr (build_tree_list (receiver, messageargs));
+}
+
+/* Parse an objc-message-receiver.
+
+ objc-message-receiver:
+ type-name
+ expression
+
+ Returns a representation of the type or expression. */
+
+static tree
+cp_parser_objc_message_receiver (cp_parser* parser)
+{
+ tree rcv;
+ bool class_scope_p, template_p;
+
+ /* An Objective-C message receiver may be either (1) a type
+ or (2) an expression. */
+ cp_parser_parse_tentatively (parser);
+ rcv = cp_parser_expression (parser, false);
+
+ if (cp_parser_parse_definitely (parser))
+ return rcv;
+
+ /* Look for the optional `::' operator. */
+ cp_parser_global_scope_opt (parser, false);
+ /* Look for the nested-name-specifier. */
+ cp_parser_nested_name_specifier_opt (parser,
+ /*typename_keyword_p=*/true,
+ /*check_dependency_p=*/true,
+ /*type_p=*/true,
+ /*is_declaration=*/true);
+ class_scope_p = (parser->scope && TYPE_P (parser->scope));
+ template_p = class_scope_p && cp_parser_optional_template_keyword (parser);
+ /* Finally, look for the class-name. */
+ rcv = cp_parser_class_name (parser,
+ class_scope_p,
+ template_p,
+ /*type_p=*/true,
+ /*check_dependency_p=*/true,
+ /*class_head_p=*/false,
+ /*is_declaration=*/true);
+
+ return objc_get_class_reference (rcv);
+}
+
+/* Parse the arguments and selectors comprising an Objective-C message.
+
+ objc-message-args:
+ objc-selector
+ objc-selector-args
+ objc-selector-args , objc-comma-args
+
+ objc-selector-args:
+ objc-selector [opt] : assignment-expression
+ objc-selector-args objc-selector [opt] : assignment-expression
+
+ objc-comma-args:
+ assignment-expression
+ objc-comma-args , assignment-expression
+
+ Returns a TREE_LIST, with TREE_PURPOSE containing a list of
+ selector arguments and TREE_VALUE containing a list of comma
+ arguments. */
+
+static tree
+cp_parser_objc_message_args (cp_parser* parser)
+{
+ tree sel_args = NULL_TREE, addl_args = NULL_TREE;
+ bool maybe_unary_selector_p = true;
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ while (cp_parser_objc_selector_p (token->type) || token->type == CPP_COLON)
+ {
+ tree selector = NULL_TREE, arg;
+
+ if (token->type != CPP_COLON)
+ selector = cp_parser_objc_selector (parser);
+
+ /* Detect if we have a unary selector. */
+ if (maybe_unary_selector_p
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
+ return build_tree_list (selector, NULL_TREE);
+
+ maybe_unary_selector_p = false;
+ cp_parser_require (parser, CPP_COLON, "`:'");
+ arg = cp_parser_assignment_expression (parser, false);
+
+ sel_args
+ = chainon (sel_args,
+ build_tree_list (selector, arg));
+
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+
+ /* Handle non-selector arguments, if any. */
+ while (token->type == CPP_COMMA)
+ {
+ tree arg;
+
+ cp_lexer_consume_token (parser->lexer);
+ arg = cp_parser_assignment_expression (parser, false);
+
+ addl_args
+ = chainon (addl_args,
+ build_tree_list (NULL_TREE, arg));
+
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+
+ return build_tree_list (sel_args, addl_args);
+}
+
+/* Parse an Objective-C encode expression.
+
+ objc-encode-expression:
+ @encode objc-typename
+
+ Returns an encoded representation of the type argument. */
+
+static tree
+cp_parser_objc_encode_expression (cp_parser* parser)
+{
+ tree type;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@encode'. */
+ cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
+ type = complete_type (cp_parser_type_id (parser));
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+
+ if (!type)
+ {
+ error ("`@encode' must specify a type as an argument");
+ return error_mark_node;
+ }
+
+ return objc_build_encode_expr (type);
+}
+
+/* Parse an Objective-C @defs expression. */
+
+static tree
+cp_parser_objc_defs_expression (cp_parser *parser)
+{
+ tree name;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@defs'. */
+ cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
+ name = cp_parser_identifier (parser);
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+
+ return objc_get_class_ivars (name);
+}
+
+/* Parse an Objective-C protocol expression.
+
+ objc-protocol-expression:
+ @protocol ( identifier )
+
+ Returns a representation of the protocol expression. */
+
+static tree
+cp_parser_objc_protocol_expression (cp_parser* parser)
+{
+ tree proto;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@protocol'. */
+ cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
+ proto = cp_parser_identifier (parser);
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+
+ return objc_build_protocol_expr (proto);
+}
+
+/* Parse an Objective-C selector expression.
+
+ objc-selector-expression:
+ @selector ( objc-method-signature )
+
+ objc-method-signature:
+ objc-selector
+ objc-selector-seq
+
+ objc-selector-seq:
+ objc-selector :
+ objc-selector-seq objc-selector :
+
+ Returns a representation of the method selector. */
+
+static tree
+cp_parser_objc_selector_expression (cp_parser* parser)
+{
+ tree sel_seq = NULL_TREE;
+ bool maybe_unary_selector_p = true;
+ cp_token *token;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@selector'. */
+ cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
+ token = cp_lexer_peek_token (parser->lexer);
+
+ while (cp_parser_objc_selector_p (token->type) || token->type == CPP_COLON)
+ {
+ tree selector = NULL_TREE;
+
+ if (token->type != CPP_COLON)
+ selector = cp_parser_objc_selector (parser);
+
+ /* Detect if we have a unary selector. */
+ if (maybe_unary_selector_p
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
+ {
+ sel_seq = selector;
+ goto finish_selector;
+ }
+
+ maybe_unary_selector_p = false;
+ cp_parser_require (parser, CPP_COLON, "`:'");
+
+ sel_seq
+ = chainon (sel_seq,
+ build_tree_list (selector, NULL_TREE));
+
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+
+ finish_selector:
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+
+ return objc_build_selector_expr (sel_seq);
+}
+
+/* Parse a list of identifiers.
+
+ objc-identifier-list:
+ identifier
+ objc-identifier-list , identifier
+
+ Returns a TREE_LIST of identifier nodes. */
+
+static tree
+cp_parser_objc_identifier_list (cp_parser* parser)
+{
+ tree list = build_tree_list (NULL_TREE, cp_parser_identifier (parser));
+ cp_token *sep = cp_lexer_peek_token (parser->lexer);
+
+ while (sep->type == CPP_COMMA)
+ {
+ cp_lexer_consume_token (parser->lexer); /* Eat ','. */
+ list = chainon (list,
+ build_tree_list (NULL_TREE,
+ cp_parser_identifier (parser)));
+ sep = cp_lexer_peek_token (parser->lexer);
+ }
+
+ return list;
+}
+
+/* Parse an Objective-C alias declaration.
+
+ objc-alias-declaration:
+ @compatibility_alias identifier identifier ;
+
+ This function registers the alias mapping with the Objective-C front-end.
+ It returns nothing. */
+
+static void
+cp_parser_objc_alias_declaration (cp_parser* parser)
+{
+ tree alias, orig;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@compatibility_alias'. */
+ alias = cp_parser_identifier (parser);
+ orig = cp_parser_identifier (parser);
+ objc_declare_alias (alias, orig);
+ cp_parser_consume_semicolon_at_end_of_statement (parser);
+}
+
+/* Parse an Objective-C class forward-declaration.
+
+ objc-class-declaration:
+ @class objc-identifier-list ;
+
+ The function registers the forward declarations with the Objective-C
+ front-end. It returns nothing. */
+
+static void
+cp_parser_objc_class_declaration (cp_parser* parser)
+{
+ cp_lexer_consume_token (parser->lexer); /* Eat '@class'. */
+ objc_declare_class (cp_parser_objc_identifier_list (parser));
+ cp_parser_consume_semicolon_at_end_of_statement (parser);
+}
+
+/* Parse a list of Objective-C protocol references.
+
+ objc-protocol-refs-opt:
+ objc-protocol-refs [opt]
+
+ objc-protocol-refs:
+ < objc-identifier-list >
+
+ Returns a TREE_LIST of identifiers, if any. */
+
+static tree
+cp_parser_objc_protocol_refs_opt (cp_parser* parser)
+{
+ tree protorefs = NULL_TREE;
+
+ if(cp_lexer_next_token_is (parser->lexer, CPP_LESS))
+ {
+ cp_lexer_consume_token (parser->lexer); /* Eat '<'. */
+ protorefs = cp_parser_objc_identifier_list (parser);
+ cp_parser_require (parser, CPP_GREATER, "`>'");
+ }
+
+ return protorefs;
+}
+
+static void
+cp_parser_objc_visibility_spec (cp_parser* parser)
+{
+ cp_token *vis = cp_lexer_peek_token (parser->lexer);
+
+ switch (vis->keyword)
+ {
+ case RID_AT_PRIVATE:
+ objc_set_visibility (2);
+ break;
+ case RID_AT_PROTECTED:
+ objc_set_visibility (0);
+ break;
+ case RID_AT_PUBLIC:
+ objc_set_visibility (1);
+ break;
+ default:
+ return;
+ }
+
+ /* Eat '@private'/'@protected'/'@public'. */
+ cp_lexer_consume_token (parser->lexer);
+}
+
+static void
+cp_parser_objc_method_type (cp_parser* parser)
+{
+ objc_set_method_type
+ (cp_lexer_consume_token (parser->lexer)->type == CPP_PLUS
+ ? PLUS_EXPR
+ : MINUS_EXPR);
+}
+
+static tree
+cp_parser_objc_protocol_qualifiers (cp_parser* parser)
+{
+ tree quals = NULL_TREE, node;
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ node = token->value;
+
+ while (node && TREE_CODE (node) == IDENTIFIER_NODE
+ && (node == ridpointers [(int) RID_IN]
+ || node == ridpointers [(int) RID_OUT]
+ || node == ridpointers [(int) RID_INOUT]
+ || node == ridpointers [(int) RID_BYCOPY]
+ || node == ridpointers [(int) RID_BYREF]
+ || node == ridpointers [(int) RID_ONEWAY]))
+ {
+ quals = tree_cons (NULL_TREE, node, quals);
+ cp_lexer_consume_token (parser->lexer);
+ token = cp_lexer_peek_token (parser->lexer);
+ node = token->value;
+ }
+
+ return quals;
+}
+
+static tree
+cp_parser_objc_typename (cp_parser* parser)
+{
+ tree typename = NULL_TREE;
+
+ if (cp_lexer_next_token_is (parser->lexer, CPP_OPEN_PAREN))
+ {
+ tree proto_quals, cp_type = NULL_TREE;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '('. */
+ proto_quals = cp_parser_objc_protocol_qualifiers (parser);
+
+ /* An ObjC type name may consist of just protocol qualifiers, in which
+ case the type shall default to 'id'. */
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN))
+ cp_type = cp_parser_type_id (parser);
+
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+ typename = build_tree_list (proto_quals, cp_type);
+ }
+
+ return typename;
+}
+
+static bool
+cp_parser_objc_selector_p (enum cpp_ttype type)
+{
+ return (type == CPP_NAME || type == CPP_KEYWORD
+ || type == CPP_AND_AND || type == CPP_AND_EQ || type == CPP_AND
+ || type == CPP_OR || type == CPP_COMPL || type == CPP_NOT
+ || type == CPP_NOT_EQ || type == CPP_OR_OR || type == CPP_OR_EQ
+ || type == CPP_XOR || type == CPP_XOR_EQ);
+}
+
+static tree
+cp_parser_objc_selector (cp_parser* parser)
+{
+ cp_token *token = cp_lexer_consume_token (parser->lexer);
+
+ if (!cp_parser_objc_selector_p (token->type))
+ {
+ error ("invalid Objective-C++ selector name");
+ return error_mark_node;
+ }
+
+ /* C++ operator names are allowed to appear in ObjC selectors. */
+ switch (token->type)
+ {
+ case CPP_AND_AND: return get_identifier ("and");
+ case CPP_AND_EQ: return get_identifier ("and_eq");
+ case CPP_AND: return get_identifier ("bitand");
+ case CPP_OR: return get_identifier ("bitor");
+ case CPP_COMPL: return get_identifier ("compl");
+ case CPP_NOT: return get_identifier ("not");
+ case CPP_NOT_EQ: return get_identifier ("not_eq");
+ case CPP_OR_OR: return get_identifier ("or");
+ case CPP_OR_EQ: return get_identifier ("or_eq");
+ case CPP_XOR: return get_identifier ("xor");
+ case CPP_XOR_EQ: return get_identifier ("xor_eq");
+ default: return token->value;
+ }
+}
+
+static tree
+cp_parser_objc_method_keyword_params (cp_parser* parser)
+{
+ tree params = NULL_TREE;
+ bool maybe_unary_selector_p = true;
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ while (cp_parser_objc_selector_p (token->type) || token->type == CPP_COLON)
+ {
+ tree selector = NULL_TREE, typename, identifier;
+
+ if (token->type != CPP_COLON)
+ selector = cp_parser_objc_selector (parser);
+
+ /* Detect if we have a unary selector. */
+ if (maybe_unary_selector_p
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_COLON))
+ return selector;
+
+ maybe_unary_selector_p = false;
+ cp_parser_require (parser, CPP_COLON, "`:'");
+ typename = cp_parser_objc_typename (parser);
+ identifier = cp_parser_identifier (parser);
+
+ params
+ = chainon (params,
+ objc_build_keyword_decl (selector,
+ typename,
+ identifier));
+
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+
+ return params;
+}
+
+static tree
+cp_parser_objc_method_tail_params_opt (cp_parser* parser)
+{
+ tree params = make_node (TREE_LIST);
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ TREE_OVERFLOW (params) = 0; /* Initially, assume no ellipsis. */
+
+ while (token->type == CPP_COMMA)
+ {
+ cp_parameter_declarator *parmdecl;
+ tree parm;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat ','. */
+ token = cp_lexer_peek_token (parser->lexer);
+
+ if (token->type == CPP_ELLIPSIS)
+ {
+ cp_lexer_consume_token (parser->lexer); /* Eat '...'. */
+ TREE_OVERFLOW (params) = 1;
+ break;
+ }
+
+ parmdecl = cp_parser_parameter_declaration (parser, false, NULL);
+ parm = grokdeclarator (parmdecl->declarator,
+ &parmdecl->decl_specifiers,
+ PARM, /*initialized=*/0,
+ /*attrlist=*/NULL);
+
+ chainon (params, build_tree_list (NULL_TREE, parm));
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+
+ return params;
+}
+
+static void
+cp_parser_objc_interstitial_code (cp_parser* parser)
+{
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ /* If the next token is `extern' and the following token is a string
+ literal, then we have a linkage specification. */
+ if (token->keyword == RID_EXTERN
+ && cp_parser_is_string_literal (cp_lexer_peek_nth_token (parser->lexer, 2)))
+ cp_parser_linkage_specification (parser);
+ /* Handle #pragma, if any. */
+ else if (token->type == CPP_PRAGMA)
+ cp_lexer_handle_pragma (parser->lexer);
+ /* Allow stray semicolons. */
+ else if (token->type == CPP_SEMICOLON)
+ cp_lexer_consume_token (parser->lexer);
+ /* Finally, try to parse a block-declaration, or a function-definition. */
+ else
+ cp_parser_block_declaration (parser, /*statement_p=*/false);
+}
+
+static tree
+cp_parser_objc_method_signature (cp_parser* parser)
+{
+ tree rettype, kwdparms, optparms;
+
+ cp_parser_objc_method_type (parser);
+ rettype = cp_parser_objc_typename (parser);
+ kwdparms = cp_parser_objc_method_keyword_params (parser);
+ optparms = cp_parser_objc_method_tail_params_opt (parser);
+
+ return objc_build_method_signature (rettype, kwdparms, optparms);
+}
+
+static void
+cp_parser_objc_method_prototype_list (cp_parser* parser)
+{
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ while (token->keyword != RID_AT_END)
+ {
+ if (token->type == CPP_PLUS || token->type == CPP_MINUS)
+ {
+ objc_add_method_declaration
+ (cp_parser_objc_method_signature (parser));
+ cp_parser_consume_semicolon_at_end_of_statement (parser);
+ }
+ else
+ /* Allow for interspersed non-ObjC++ code. */
+ cp_parser_objc_interstitial_code (parser);
+
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@end'. */
+ objc_finish_interface ();
+}
+
+static void
+cp_parser_objc_method_definition_list (cp_parser* parser)
+{
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ while (token->keyword != RID_AT_END)
+ {
+ tree meth;
+
+ if (token->type == CPP_PLUS || token->type == CPP_MINUS)
+ {
+ push_deferring_access_checks (dk_deferred);
+ objc_start_method_definition
+ (cp_parser_objc_method_signature (parser));
+
+ /* For historical reasons, we accept an optional semicolon. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
+ cp_lexer_consume_token (parser->lexer);
+
+ perform_deferred_access_checks ();
+ stop_deferring_access_checks ();
+ meth = cp_parser_function_definition_after_declarator (parser,
+ false);
+ pop_deferring_access_checks ();
+ objc_finish_method_definition (meth);
+ }
+ else
+ /* Allow for interspersed non-ObjC++ code. */
+ cp_parser_objc_interstitial_code (parser);
+
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@end'. */
+ objc_finish_implementation ();
+}
+
+static void
+cp_parser_objc_class_ivars (cp_parser* parser)
+{
+ cp_token *token = cp_lexer_peek_token (parser->lexer);
+
+ if (token->type != CPP_OPEN_BRACE)
+ return; /* No ivars specified. */
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '{'. */
+ token = cp_lexer_peek_token (parser->lexer);
+
+ while (token->type != CPP_CLOSE_BRACE)
+ {
+ cp_decl_specifier_seq declspecs;
+ int decl_class_or_enum_p;
+ tree prefix_attributes;
+
+ cp_parser_objc_visibility_spec (parser);
+
+ if (cp_lexer_next_token_is (parser->lexer, CPP_CLOSE_BRACE))
+ break;
+
+ cp_parser_decl_specifier_seq (parser,
+ CP_PARSER_FLAGS_OPTIONAL,
+ &declspecs,
+ &decl_class_or_enum_p);
+ prefix_attributes = declspecs.attributes;
+ declspecs.attributes = NULL_TREE;
+
+ /* Keep going until we hit the `;' at the end of the
+ declaration. */
+ while (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
+ {
+ tree width = NULL_TREE, attributes, first_attribute, decl;
+ cp_declarator *declarator = NULL;
+ int ctor_dtor_or_conv_p;
+
+ /* Check for a (possibly unnamed) bitfield declaration. */
+ token = cp_lexer_peek_token (parser->lexer);
+ if (token->type == CPP_COLON)
+ goto eat_colon;
+
+ if (token->type == CPP_NAME
+ && (cp_lexer_peek_nth_token (parser->lexer, 2)->type
+ == CPP_COLON))
+ {
+ /* Get the name of the bitfield. */
+ declarator = make_id_declarator (NULL_TREE,
+ cp_parser_identifier (parser));
+
+ eat_colon:
+ cp_lexer_consume_token (parser->lexer); /* Eat ':'. */
+ /* Get the width of the bitfield. */
+ width
+ = cp_parser_constant_expression (parser,
+ /*allow_non_constant=*/false,
+ NULL);
+ }
+ else
+ {
+ /* Parse the declarator. */
+ declarator
+ = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
+ &ctor_dtor_or_conv_p,
+ /*parenthesized_p=*/NULL,
+ /*member_p=*/false);
+ }
+
+ /* Look for attributes that apply to the ivar. */
+ attributes = cp_parser_attributes_opt (parser);
+ /* Remember which attributes are prefix attributes and
+ which are not. */
+ first_attribute = attributes;
+ /* Combine the attributes. */
+ attributes = chainon (prefix_attributes, attributes);
+
+ if (width)
+ {
+ /* Create the bitfield declaration. */
+ decl = grokbitfield (declarator, &declspecs, width);
+ cplus_decl_attributes (&decl, attributes, /*flags=*/0);
+ }
+ else
+ decl = grokfield (declarator, &declspecs, NULL_TREE,
+ NULL_TREE, attributes);
+
+ /* Add the instance variable. */
+ objc_add_instance_variable (decl);
+
+ /* Reset PREFIX_ATTRIBUTES. */
+ while (attributes && TREE_CHAIN (attributes) != first_attribute)
+ attributes = TREE_CHAIN (attributes);
+ if (attributes)
+ TREE_CHAIN (attributes) = NULL_TREE;
+
+ token = cp_lexer_peek_token (parser->lexer);
+
+ if (token->type == CPP_COMMA)
+ {
+ cp_lexer_consume_token (parser->lexer); /* Eat ','. */
+ continue;
+ }
+ break;
+ }
+
+ cp_parser_consume_semicolon_at_end_of_statement (parser);
+ token = cp_lexer_peek_token (parser->lexer);
+ }
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '}'. */
+ /* For historical reasons, we accept an optional semicolon. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_SEMICOLON))
+ cp_lexer_consume_token (parser->lexer);
+}
+
+static void
+cp_parser_objc_protocol_declaration (cp_parser* parser)
+{
+ tree proto, protorefs;
+ cp_token *tok;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@protocol'. */
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_NAME))
+ {
+ error ("identifier expected after `@protocol'");
+ goto finish;
+ }
+
+ /* See if we have a foward declaration or a definition. */
+ tok = cp_lexer_peek_nth_token (parser->lexer, 2);
+
+ /* Try a forward declaration first. */
+ if (tok->type == CPP_COMMA || tok->type == CPP_SEMICOLON)
+ {
+ objc_declare_protocols (cp_parser_objc_identifier_list (parser));
+ finish:
+ cp_parser_consume_semicolon_at_end_of_statement (parser);
+ }
+
+ /* Ok, we got a full-fledged definition (or at least should). */
+ else
+ {
+ proto = cp_parser_identifier (parser);
+ protorefs = cp_parser_objc_protocol_refs_opt (parser);
+ objc_start_protocol (proto, protorefs);
+ cp_parser_objc_method_prototype_list (parser);
+ }
+}
+
+static void
+cp_parser_objc_superclass_or_category (cp_parser *parser, tree *super,
+ tree *categ)
+{
+ cp_token *next = cp_lexer_peek_token (parser->lexer);
+
+ *super = *categ = NULL_TREE;
+ if (next->type == CPP_COLON)
+ {
+ cp_lexer_consume_token (parser->lexer); /* Eat ':'. */
+ *super = cp_parser_identifier (parser);
+ }
+ else if (next->type == CPP_OPEN_PAREN)
+ {
+ cp_lexer_consume_token (parser->lexer); /* Eat '('. */
+ *categ = cp_parser_identifier (parser);
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+ }
+}
+
+static void
+cp_parser_objc_class_interface (cp_parser* parser)
+{
+ tree name, super, categ, protos;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@interface'. */
+ name = cp_parser_identifier (parser);
+ cp_parser_objc_superclass_or_category (parser, &super, &categ);
+ protos = cp_parser_objc_protocol_refs_opt (parser);
+
+ /* We have either a class or a category on our hands. */
+ if (categ)
+ objc_start_category_interface (name, categ, protos);
+ else
+ {
+ objc_start_class_interface (name, super, protos);
+ /* Handle instance variable declarations, if any. */
+ cp_parser_objc_class_ivars (parser);
+ objc_continue_interface ();
+ }
+
+ cp_parser_objc_method_prototype_list (parser);
+}
+
+static void
+cp_parser_objc_class_implementation (cp_parser* parser)
+{
+ tree name, super, categ;
+
+ cp_lexer_consume_token (parser->lexer); /* Eat '@implementation'. */
+ name = cp_parser_identifier (parser);
+ cp_parser_objc_superclass_or_category (parser, &super, &categ);
+
+ /* We have either a class or a category on our hands. */
+ if (categ)
+ objc_start_category_implementation (name, categ);
+ else
+ {
+ objc_start_class_implementation (name, super);
+ /* Handle instance variable declarations, if any. */
+ cp_parser_objc_class_ivars (parser);
+ objc_continue_implementation ();
+ }
+
+ cp_parser_objc_method_definition_list (parser);
+}
+
+static void
+cp_parser_objc_end_implementation (cp_parser* parser)
+{
+ cp_lexer_consume_token (parser->lexer); /* Eat '@end'. */
+ objc_finish_implementation ();
+}
+
+static void
+cp_parser_objc_declaration (cp_parser* parser)
+{
+ /* Try to figure out what kind of declaration is present. */
+ cp_token *kwd = cp_lexer_peek_token (parser->lexer);
+
+ switch (kwd->keyword)
+ {
+ case RID_AT_ALIAS:
+ cp_parser_objc_alias_declaration (parser);
+ break;
+ case RID_AT_CLASS:
+ cp_parser_objc_class_declaration (parser);
+ break;
+ case RID_AT_PROTOCOL:
+ cp_parser_objc_protocol_declaration (parser);
+ break;
+ case RID_AT_INTERFACE:
+ cp_parser_objc_class_interface (parser);
+ break;
+ case RID_AT_IMPLEMENTATION:
+ cp_parser_objc_class_implementation (parser);
+ break;
+ case RID_AT_END:
+ cp_parser_objc_end_implementation (parser);
+ break;
+ default:
+ error ("misplaced `@%D' Objective-C++ construct", kwd->value);
+ cp_parser_skip_to_end_of_block_or_statement (parser);
+ }
+}
+
+/* Parse an Objective-C try-catch-finally statement.
+
+ objc-try-catch-finally-stmt:
+ @try compound-statement objc-catch-clause-seq [opt]
+ objc-finally-clause [opt]
+
+ objc-catch-clause-seq:
+ objc-catch-clause objc-catch-clause-seq [opt]
+
+ objc-catch-clause:
+ @catch ( exception-declaration ) compound-statement
+
+ objc-finally-clause
+ @finally compound-statement
+
+ Returns NULL_TREE. */
+
+static tree
+cp_parser_objc_try_catch_finally_statement (cp_parser *parser) {
+ location_t location;
+ tree stmt;
+
+ cp_parser_require_keyword (parser, RID_AT_TRY, "`@try'");
+ location = cp_lexer_peek_token (parser->lexer)->location;
+ /* NB: The @try block needs to be wrapped in its own STATEMENT_LIST
+ node, lest it get absorbed into the surrounding block. */
+ stmt = push_stmt_list ();
+ cp_parser_compound_statement (parser, NULL, false);
+ objc_begin_try_stmt (location, pop_stmt_list (stmt));
+
+ while (cp_lexer_next_token_is_keyword (parser->lexer, RID_AT_CATCH))
+ {
+ cp_parameter_declarator *parmdecl;
+ tree parm;
+
+ cp_lexer_consume_token (parser->lexer);
+ cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
+ parmdecl = cp_parser_parameter_declaration (parser, false, NULL);
+ parm = grokdeclarator (parmdecl->declarator,
+ &parmdecl->decl_specifiers,
+ PARM, /*initialized=*/0,
+ /*attrlist=*/NULL);
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+ objc_begin_catch_clause (parm);
+ cp_parser_compound_statement (parser, NULL, false);
+ objc_finish_catch_clause ();
+ }
+
+ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_AT_FINALLY))
+ {
+ cp_lexer_consume_token (parser->lexer);
+ location = cp_lexer_peek_token (parser->lexer)->location;
+ /* NB: The @finally block needs to be wrapped in its own STATEMENT_LIST
+ node, lest it get absorbed into the surrounding block. */
+ stmt = push_stmt_list ();
+ cp_parser_compound_statement (parser, NULL, false);
+ objc_build_finally_clause (location, pop_stmt_list (stmt));
+ }
+
+ return objc_finish_try_stmt ();
+}
+
+/* Parse an Objective-C synchronized statement.
+
+ objc-synchronized-stmt:
+ @synchronized ( expression ) compound-statement
+
+ Returns NULL_TREE. */
+
+static tree
+cp_parser_objc_synchronized_statement (cp_parser *parser) {
+ location_t location;
+ tree lock, stmt;
+
+ cp_parser_require_keyword (parser, RID_AT_SYNCHRONIZED, "`@synchronized'");
+
+ location = cp_lexer_peek_token (parser->lexer)->location;
+ cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
+ lock = cp_parser_expression (parser, false);
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+
+ /* NB: The @synchronized block needs to be wrapped in its own STATEMENT_LIST
+ node, lest it get absorbed into the surrounding block. */
+ stmt = push_stmt_list ();
+ cp_parser_compound_statement (parser, NULL, false);
+
+ return objc_build_synchronized (location, lock, pop_stmt_list (stmt));
+}
+
+/* Parse an Objective-C throw statement.
+
+ objc-throw-stmt:
+ @throw assignment-expression [opt] ;
+
+ Returns a constructed '@throw' statement. */
+
+static tree
+cp_parser_objc_throw_statement (cp_parser *parser) {
+ tree expr = NULL_TREE;
+
+ cp_parser_require_keyword (parser, RID_AT_THROW, "`@throw'");
+
+ if (cp_lexer_next_token_is_not (parser->lexer, CPP_SEMICOLON))
+ expr = cp_parser_assignment_expression (parser, false);
+
+ cp_parser_consume_semicolon_at_end_of_statement (parser);
+
+ return objc_build_throw_stmt (expr);
+}
+
+static tree
+cp_parser_objc_statement (cp_parser * parser) {
+ /* Try to figure out what kind of declaration is present. */
+ cp_token *kwd = cp_lexer_peek_token (parser->lexer);
+
+ switch (kwd->keyword)
+ {
+ case RID_AT_TRY:
+ return cp_parser_objc_try_catch_finally_statement (parser);
+ case RID_AT_SYNCHRONIZED:
+ return cp_parser_objc_synchronized_statement (parser);
+ case RID_AT_THROW:
+ return cp_parser_objc_throw_statement (parser);
+ default:
+ error ("misplaced `@%D' Objective-C++ construct", kwd->value);
+ cp_parser_skip_to_end_of_block_or_statement (parser);
+ }
+
+ return error_mark_node;
+}
+/* APPLE LOCAL end Objective-C++ */
/* The parser. */
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 7025deff788..089a57d7d27 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -34,7 +34,11 @@ Boston, MA 02111-1307, USA. */
#include "tree.h"
#include "pointer-set.h"
#include "flags.h"
+/* APPLE LOCAL Objective-C++ */
+#include "c-common.h"
#include "cp-tree.h"
+/* APPLE LOCAL Objective-C++ */
+#include "cp-objcp-common.h"
#include "tree-inline.h"
#include "decl.h"
#include "output.h"
@@ -4012,7 +4016,26 @@ template_args_equal (tree ot, tree nt)
/* For member templates */
return TREE_CODE (ot) == TREE_VEC && comp_template_args (ot, nt);
else if (TYPE_P (nt))
- return TYPE_P (ot) && same_type_p (ot, nt);
+ /* APPLE LOCAL begin Objective-C++ */
+ {
+ int c1, c2;
+
+ if (!TYPE_P (ot))
+ return 0;
+
+ /* We must handle ObjC types specially because they may differ
+ only in protocol qualifications (e.g., 'NSObject *' vs.
+ 'NSObject <Foo> *') that must be taken into account here.
+ See also cp/typeck.c:build_c_cast(), where a similar problem
+ arises. We must call objc_comptypes() twice, since its
+ comparisons are _not_ symmetric. */
+ if ((c1 = objc_comptypes (ot, nt, 0)) >= 0
+ && (c2 = objc_comptypes (nt, ot, 0)) >= 0)
+ return (c1 && c2);
+
+ return same_type_p (ot, nt);
+ }
+ /* APPLE LOCAL end Objective-C++ */
else if (TREE_CODE (ot) == TREE_VEC || TYPE_P (ot))
return 0;
else
@@ -8839,6 +8862,18 @@ tsubst_copy_and_build (tree t,
return t;
default:
+ /* APPLE LOCAL begin Objective-C++ */
+ /* Handle Objective-C++ constructs, if appropriate. */
+ {
+ tree subst
+ = objcp_tsubst_copy_and_build (t, args, complain,
+ in_decl, /*function_p=*/false);
+
+ if (subst)
+ return subst;
+ }
+ /* APPLE LOCAL end Objective-C++ */
+
return tsubst_copy (t, args, complain, in_decl);
}
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index ebc213d7812..7f573e1f4a2 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -401,7 +401,8 @@ anon_aggr_type_p (tree node)
/* Finish a scope. */
-static tree
+/* APPLE LOCAL Objective-C++ */
+tree
do_poplevel (tree stmt_list)
{
tree block = NULL;
@@ -1166,7 +1167,8 @@ finish_asm_stmt (int volatile_p, tree string, tree output_operands,
otherwise we'll get an error. Gross, but ... */
STRIP_NOPS (operand);
- if (!lvalue_or_else (operand, lv_asm))
+ /* APPLE LOCAL non-lvalue assign */
+ if (!lvalue_or_else (&operand, lv_asm))
operand = error_mark_node;
constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t)));
@@ -2441,6 +2443,27 @@ finish_id_expression (tree id_expression,
if (decl == error_mark_node)
{
/* Name lookup failed. */
+ /* APPLE LOCAL begin CW asm blocks */
+ /* CW assembly has automagical handling of register names.
+ It's also handy to assume undeclared names as labels,
+ although it would be better to have a second pass and
+ complain about names in the block that are not
+ labels. */
+ if (cw_asm_block)
+ {
+ tree new_id;
+ if ((new_id = cw_asm_reg_name (id_expression)))
+ return new_id;
+#ifdef CW_ASM_SPECIAL_LABEL
+ if ((new_id = CW_ASM_SPECIAL_LABEL (id_expression)))
+ return new_id;
+#endif
+ /* Assume undeclared symbols are labels. */
+ new_id = get_cw_asm_label (id_expression);
+ return new_id;
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
if (scope
&& (!TYPE_P (scope)
|| (!dependent_type_p (scope)
@@ -2485,6 +2508,15 @@ finish_id_expression (tree id_expression,
*error_msg = "missing template arguments";
return error_mark_node;
}
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Accept raw type decls, which will be used in offset-getting
+ expressions like "type.field(r3)". */
+ else if (TREE_CODE (decl) == TYPE_DECL && cw_asm_block)
+ {
+ *idk = CP_ID_KIND_NONE;
+ return decl;
+ }
+ /* APPLE LOCAL end CW asm blocks */
else if (TREE_CODE (decl) == TYPE_DECL
|| TREE_CODE (decl) == NAMESPACE_DECL)
{
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 8a264d7afa9..e4fd013abd6 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -33,6 +33,8 @@ Boston, MA 02111-1307, USA. */
#include "insn-config.h"
#include "integrate.h"
#include "tree-inline.h"
+/* APPLE LOCAL Objective-C++ */
+#include "debug.h"
#include "target.h"
static tree bot_manip (tree *, int *, void *);
@@ -111,6 +113,8 @@ lvalue_p_1 (tree ref,
case STRING_CST:
return clk_ordinary;
+ /* APPLE LOCAL Objective-C++ */
+ case CONST_DECL:
case VAR_DECL:
if (TREE_READONLY (ref) && ! TREE_STATIC (ref)
&& DECL_LANG_SPECIFIC (ref)
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index e0dc1ebdb49..8b754b1682d 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -530,10 +530,16 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
class1 = TREE_TYPE (t1);
class2 = TREE_TYPE (t2);
- if (DERIVED_FROM_P (class1, class2))
+ /* APPLE LOCAL begin Objective-C++ */
+ if (DERIVED_FROM_P (class1, class2) ||
+ (c_dialect_objc () && objc_comptypes (class1, class2, 0) == 1))
+ /* APPLE LOCAL end Objective-C++ */
t2 = (build_pointer_type
(cp_build_qualified_type (class1, TYPE_QUALS (class2))));
- else if (DERIVED_FROM_P (class2, class1))
+ /* APPLE LOCAL begin Objective-C++ */
+ else if (DERIVED_FROM_P (class2, class1) ||
+ (c_dialect_objc () && objc_comptypes (class2, class1, 0) == 1))
+ /* APPLE LOCAL end Objective-C++ */
t1 = (build_pointer_type
(cp_build_qualified_type (class2, TYPE_QUALS (class1))));
else
@@ -1847,6 +1853,12 @@ finish_class_member_access_expr (tree object, tree name)
if (object == error_mark_node || name == error_mark_node)
return error_mark_node;
+ /* APPLE LOCAL begin Objective-C++ */
+ /* If OBJECT is an ObjC class instance, we must obey ObjC access rules. */
+ if (!objc_is_public (object, name))
+ return error_mark_node;
+ /* APPLE LOCAL end Objective-C++ */
+
object_type = TREE_TYPE (object);
if (processing_template_decl)
@@ -2006,6 +2018,8 @@ build_ptrmemfunc_access_expr (tree ptrmem, tree member_name)
routine directly because it expects the object to be of class
type. */
ptrmem_type = TREE_TYPE (ptrmem);
+ /* APPLE LOCAL KEXT 2.95-ptmf-compatibility --turly */
+ if (!flag_apple_kext)
gcc_assert (TYPE_PTRMEMFUNC_P (ptrmem_type));
member = lookup_member (ptrmem_type, member_name, /*protect=*/0,
/*want_type=*/false);
@@ -2289,7 +2303,10 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
if (TYPE_PTRMEMFUNC_P (TREE_TYPE (function)))
{
- tree idx, delta, e1, e2, e3, vtbl, basetype;
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ tree idx, delta, e1, e2, e3, vtbl = vtbl, basetype;
+ tree delta2 = delta2;
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
tree fntype = TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (function));
tree instance_ptr = *instance_ptrptr;
@@ -2321,6 +2338,17 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
/* Start by extracting all the information from the PMF itself. */
e3 = pfn_from_ptrmemfunc (function);
delta = build_ptrmemfunc_access_expr (function, delta_identifier);
+
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ if (flag_apple_kext)
+ {
+ idx = build_ptrmemfunc_access_expr (function, index_identifier);
+ idx = save_expr (default_conversion (idx));
+ e1 = cp_build_binary_op (GE_EXPR, idx, integer_zero_node);
+ }
+ else
+ {
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
idx = build1 (NOP_EXPR, vtable_index_type, e3);
switch (TARGET_PTRMEMFUNC_VBIT_LOCATION)
{
@@ -2338,6 +2366,19 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
gcc_unreachable ();
}
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ }
+ /* DELTA2 is the amount by which to adjust the `this' pointer
+ to find the vtbl. */
+ if (flag_apple_kext)
+ {
+ delta2 = build_ptrmemfunc_access_expr (function,
+ pfn_or_delta2_identifier);
+ delta2 = build_ptrmemfunc_access_expr (delta2,
+ delta2_identifier);
+ }
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
+
/* Convert down to the right base before using the instance. First
use the type... */
basetype = TYPE_METHOD_BASETYPE (TREE_TYPE (fntype));
@@ -2346,6 +2387,14 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
instance_ptr = build_base_path (PLUS_EXPR, instance_ptr, basetype, 1);
if (instance_ptr == error_mark_node)
return error_mark_node;
+
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ if (flag_apple_kext)
+ /* Next extract the vtable pointer from the object. */
+ vtbl = build (PLUS_EXPR,build_pointer_type (vtbl_ptr_type_node),
+ instance_ptr, cp_convert (ptrdiff_type_node, delta2));
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
+
/* ...and then the delta in the PMF. */
instance_ptr = build2 (PLUS_EXPR, TREE_TYPE (instance_ptr),
instance_ptr, delta);
@@ -2353,11 +2402,22 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
/* Hand back the adjusted 'this' argument to our caller. */
*instance_ptrptr = instance_ptr;
+ /* APPLE LOCAL KEXT 2.95-ptmf-compatibility --turly */
+ if (!flag_apple_kext)
/* Next extract the vtable pointer from the object. */
vtbl = build1 (NOP_EXPR, build_pointer_type (vtbl_ptr_type_node),
instance_ptr);
vtbl = build_indirect_ref (vtbl, NULL);
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ /* 2.95-style indices are off by one. */
+ if (flag_apple_kext)
+ {
+ idx = cp_build_binary_op (MINUS_EXPR, idx, integer_one_node);
+ idx = cp_build_binary_op (LSHIFT_EXPR, idx, integer_two_node);
+ }
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
+
/* Finally, extract the function pointer from the vtable. */
e2 = fold (build2 (PLUS_EXPR, TREE_TYPE (vtbl), vtbl, idx));
e2 = build_indirect_ref (e2, NULL);
@@ -2653,6 +2713,13 @@ build_x_binary_op (enum tree_code code, tree arg1, tree arg2,
tree orig_arg2;
tree expr;
+ /* APPLE LOCAL begin CW asm blocks */
+ if (cw_asm_block
+ && (TREE_CODE (arg1) == IDENTIFIER_NODE
+ || TREE_CODE (arg2) == IDENTIFIER_NODE))
+ return error_mark_node;
+ /* APPLE LOCAL end CW asm blocks */
+
orig_arg1 = arg1;
orig_arg2 = arg2;
@@ -3016,6 +3083,13 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
}
else if (TYPE_PTRMEMFUNC_P (type0) && null_ptr_cst_p (op1))
{
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ /* Shouldn't we use INDEX here rather than PFN? This seems to
+ work fine, though... */
+ if (flag_apple_kext)
+ op0 = build_ptrmemfunc_access_expr (op0, index_identifier);
+ else
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
op0 = build_ptrmemfunc_access_expr (op0, pfn_identifier);
op1 = cp_convert (TREE_TYPE (op0), integer_zero_node);
result_type = TREE_TYPE (op0);
@@ -3910,9 +3984,12 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
}
/* Complain about anything else that is not a true lvalue. */
- if (!lvalue_or_else (arg, ((code == PREINCREMENT_EXPR
- || code == POSTINCREMENT_EXPR)
- ? lv_increment : lv_decrement)))
+ /* APPLE LOCAL begin non-lvalue assign */
+ if (!lvalue_or_else (&arg, ((code == PREINCREMENT_EXPR
+ || code == POSTINCREMENT_EXPR)
+ ? lv_increment
+ : lv_decrement)))
+ /* APPLE LOCAL end non-lvalue assign */
return error_mark_node;
/* Forbid using -- on `bool'. */
@@ -4056,7 +4133,8 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
is an error. */
else if (TREE_CODE (argtype) != FUNCTION_TYPE
&& TREE_CODE (argtype) != METHOD_TYPE
- && !lvalue_or_else (arg, lv_addressof))
+ /* APPLE LOCAL non-lvalue assign */
+ && !lvalue_or_else (&arg, lv_addressof))
return error_mark_node;
if (argtype != error_mark_node)
@@ -4429,8 +4507,12 @@ build_x_compound_expr (tree op1, tree op2)
tree
build_compound_expr (tree lhs, tree rhs)
{
- lhs = convert_to_void (lhs, "left-hand operand of comma");
-
+ /* APPLE LOCAL begin AltiVec */
+ lhs = convert_to_void (lhs, targetm.cast_expr_as_vector_init
+ ? NULL
+ : "left-hand operand of comma");
+ /* APPLE LOCAL end AltiVec */
+
if (lhs == error_mark_node || rhs == error_mark_node)
return error_mark_node;
@@ -4739,6 +4821,13 @@ build_static_cast (tree type, tree expr)
if (type == error_mark_node || expr == error_mark_node)
return error_mark_node;
+ /* APPLE LOCAL begin AltiVec */
+ /* If we are casting to a vector type, treat the expression as a vector
+ initializer if this target supports it. */
+ if (TREE_CODE (type) == VECTOR_TYPE && targetm.cast_expr_as_vector_init)
+ return vector_constructor_from_expr (expr, type);
+ /* APPLE LOCAL end AltiVec */
+
if (processing_template_decl)
{
expr = build_min (STATIC_CAST_EXPR, type, expr);
@@ -4779,6 +4868,20 @@ convert_member_func_to_ptr (tree type, tree expr)
gcc_assert (TYPE_PTRMEMFUNC_P (intype)
|| TREE_CODE (intype) == METHOD_TYPE);
+ /* APPLE LOCAL begin kext ptmf casts --bowdidge*/
+ /* Beginning in gcc-4.0, casts from pointer-to-member-function to pointer-to-
+ function should always be done with the OSMemberFunctionCast() to guarantee
+ the 2.95 behavior. Casts the "old fashioned way" should be flagged as
+ errors so developers won't have kexts that silently use the new
+ ptmf->pmf behavior and get a different function than 3.3. */
+
+ if (flag_apple_kext)
+ {
+ error ("converting from `%T' to `%T' in a kext. Use OSMemberFunctionCast() instead.", intype, type);
+ return error_mark_node;
+ }
+ /* APPLE LOCAL end kext ptmf casts */
+
if (pedantic || warn_pmf2ptr)
pedwarn ("converting from %qT to %qT", intype, type);
@@ -4937,6 +5040,14 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
error ("invalid cast from type %qT to type %qT", intype, type);
return error_mark_node;
}
+
+ /* APPLE LOCAL begin don't sign-extend pointers cast to integers */
+ if (TREE_CODE (type) == INTEGER_TYPE
+ && TREE_CODE (intype) == POINTER_TYPE
+ && TYPE_PRECISION (type) > TYPE_PRECISION (intype)
+ && TYPE_UNSIGNED (type))
+ expr = cp_convert (c_common_type_for_size (POINTER_SIZE, 1), expr);
+ /* APPLE LOCAL end don't sign-extend pointers cast to integers */
return cp_convert (type, expr);
}
@@ -4947,6 +5058,13 @@ build_reinterpret_cast (tree type, tree expr)
if (type == error_mark_node || expr == error_mark_node)
return error_mark_node;
+ /* APPLE LOCAL begin AltiVec */
+ /* If we are casting to a vector type, treat the expression as a vector
+ initializer if this target supports it. */
+ if (TREE_CODE (type) == VECTOR_TYPE && targetm.cast_expr_as_vector_init)
+ return vector_constructor_from_expr (expr, type);
+ /* APPLE LOCAL end AltiVec */
+
if (processing_template_decl)
{
tree t = build_min (REINTERPRET_CAST_EXPR, type, expr);
@@ -5112,6 +5230,15 @@ build_c_cast (tree type, tree expr)
return convert_from_reference (t);
}
+ /* APPLE LOCAL begin AltiVec */
+ /* If we are casting to a vector type, treat the expression as a vector
+ initializer if this target supports it. */
+ if (TREE_CODE (type) == VECTOR_TYPE
+ && targetm.cast_expr_as_vector_init
+ && !IS_AGGR_TYPE (TREE_TYPE(expr)))
+ return vector_constructor_from_expr (expr, type);
+ /* APPLE LOCAL end AltiVec */
+
/* Casts to a (pointer to a) specific ObjC class (or 'id' or
'Class') should always be retained, because this information aids
in method lookup. */
@@ -5252,7 +5379,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
case MAX_EXPR:
/* MIN_EXPR and MAX_EXPR are currently only permitted as lvalues,
when neither operand has side-effects. */
- if (!lvalue_or_else (lhs, lv_assign))
+ /* APPLE LOCAL non-lvalue assign */
+ if (!lvalue_or_else (&lhs, lv_assign))
return error_mark_node;
gcc_assert (!TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0))
@@ -5280,7 +5408,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
/* Check this here to avoid odd errors when trying to convert
a throw to the type of the COND_EXPR. */
- if (!lvalue_or_else (lhs, lv_assign))
+ /* APPLE LOCAL non-lvalue assign */
+ if (!lvalue_or_else (&lhs, lv_assign))
return error_mark_node;
cond = build_conditional_expr
@@ -5374,7 +5503,8 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
}
/* The left-hand side must be an lvalue. */
- if (!lvalue_or_else (lhs, lv_assign))
+ /* APPLE LOCAL non-lvalue assign */
+ if (!lvalue_or_else (&lhs, lv_assign))
return error_mark_node;
/* Warn about modifying something that is `const'. Don't warn if
@@ -5476,6 +5606,16 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
if (newrhs == error_mark_node)
return error_mark_node;
+ /* APPLE LOCAL begin ObjC GC */
+ if (c_dialect_objc () && flag_objc_gc)
+ {
+ result = objc_generate_write_barrier (lhs, modifycode, newrhs);
+
+ if (result)
+ return result;
+ }
+ /* APPLE LOCAL end ObjC GC */
+
result = build2 (modifycode == NOP_EXPR ? MODIFY_EXPR : INIT_EXPR,
lhstype, lhs, newrhs);
@@ -5603,6 +5743,114 @@ build_ptrmemfunc1 (tree type, tree delta, tree pfn)
tree delta_field;
tree pfn_field;
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ if (flag_apple_kext)
+ {
+ /* Ooo-err, Missus. Cons up a 2.95-style ptmf struct given
+ gcc3-style inputs! Recall:
+
+ struct ptmf2 { struct ptmf3 {
+ short __delta; __P __pfn;
+ short __index; ptrdiff_t __delta;
+ union { }
+ __P __pfn;
+ short __delta2;
+ }
+ }
+
+ Won't this be fun. Much of this is snarfed from 2.95.
+ Note that the __delta2 val, if required, will always be __delta. */
+
+ tree subtype, pfn_or_delta2_field, idx, idx_field, delta2_field;
+ tree delta2 = integer_zero_node;
+ int ixval = 0;
+ int allconstant = 0, allsimple = 0, allinvariant = 0;
+
+ delta_field = TYPE_FIELDS (type);
+ idx_field = TREE_CHAIN (delta_field);
+ pfn_or_delta2_field = TREE_CHAIN (idx_field);
+ subtype = TREE_TYPE (pfn_or_delta2_field);
+ pfn_field = TYPE_FIELDS (subtype);
+ delta2_field = TREE_CHAIN (pfn_field);
+
+ if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn)
+ {
+ /* If the low bit of PFN is set, the virtual index is PFN >> 1.
+ Else it's nonvirtual. */
+ allconstant = TREE_CONSTANT (pfn);
+ allinvariant = TREE_INVARIANT (pfn);
+ allsimple = !! initializer_constant_valid_p (pfn, TREE_TYPE (pfn));
+ if (TREE_CODE (pfn) == INTEGER_CST && (TREE_INT_CST_LOW (pfn) & 1))
+ {
+ /* It's a virtual function. PFN is the vt offset + 1. */
+
+ int vt_entry_sz = 4;
+ tree vt_entry_sz_tree = TYPE_SIZE_UNIT (vtable_entry_type);
+ if (TREE_CODE (vt_entry_sz_tree) == INTEGER_CST)
+ vt_entry_sz = TREE_INT_CST_LOW (vt_entry_sz_tree);
+
+ ixval = (TREE_INT_CST_LOW (pfn) - 1);
+ ixval /= vt_entry_sz;
+
+ /* Now add 2 for that spadgey VPTR index hack, plus one because
+ 2.95 indices are offset by 1. */
+ ixval += 2 + 1;
+
+ /* __delta2 is the same as __delta. */
+ u = tree_cons (delta2_field, delta, NULL_TREE);
+ }
+ else
+ if (TREE_CODE (pfn) == INTEGER_CST && TREE_INT_CST_LOW (pfn) == 0)
+ {
+ /* NULL pfn. Just zero out everything. */
+ ixval = 0;
+ pfn = integer_zero_node;
+ delta = integer_zero_node;
+ u = tree_cons (pfn_field, pfn, NULL_TREE);
+ }
+ else
+ {
+ ixval = -1; /* -1 ==> PFN is the pointer */
+ u = tree_cons (pfn_field, pfn, NULL_TREE);
+ }
+ }
+ else /* Low bit of DELTA is set if we're virtual. */
+ {
+ /* Don't know how to do this yet. Much like the above, probably. */
+ abort ();
+ allconstant = TREE_CONSTANT (delta);
+ allinvariant = TREE_INVARIANT (delta);
+ allsimple = !! initializer_constant_valid_p (delta,
+ TREE_TYPE (delta));
+
+ u = tree_cons (delta2_field, delta2, NULL_TREE);
+ }
+
+ delta = convert_and_check (delta_type_node, delta);
+ idx = convert_and_check (delta_type_node, ssize_int (ixval));
+
+ u = build_constructor (subtype, u);
+ TREE_CONSTANT (u) = allconstant;
+ TREE_INVARIANT (u) = allinvariant;
+ TREE_STATIC (u) = allconstant && allsimple;
+
+ allconstant = allconstant && TREE_CONSTANT (delta) && TREE_CONSTANT (idx);
+ allinvariant = allinvariant && TREE_INVARIANT (delta) && TREE_INVARIANT (idx);
+ allsimple = allsimple
+ && initializer_constant_valid_p (delta, TREE_TYPE (delta))
+ && initializer_constant_valid_p (idx, TREE_TYPE (idx));
+
+ u = tree_cons (delta_field, delta,
+ tree_cons (idx_field, idx,
+ tree_cons (pfn_or_delta2_field, u, NULL_TREE)));
+ u = build_constructor (type, u);
+ TREE_CONSTANT (u) = allconstant;
+ TREE_INVARIANT (u) = allinvariant;
+ TREE_STATIC (u) = allconstant && allsimple;
+ return u;
+ }
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
+
/* Pull the FIELD_DECLs out of the type. */
pfn_field = TYPE_FIELDS (type);
delta_field = TREE_CHAIN (pfn_field);
@@ -5794,6 +6042,22 @@ expand_ptrmemfunc_cst (tree cst, tree *delta, tree *pfn)
tree
pfn_from_ptrmemfunc (tree t)
{
+ /* APPLE LOCAL begin KEXT 2.95-ptmf-compatibility --turly */
+ if (flag_apple_kext)
+ {
+ if (TREE_CODE (t) == PTRMEM_CST)
+ {
+ tree fn = PTRMEM_CST_MEMBER (t);
+ if (!DECL_VIRTUAL_P (fn))
+ return convert (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (t)),
+ build_addr_func (fn));
+ }
+
+ t = build_ptrmemfunc_access_expr (t, pfn_or_delta2_identifier);
+ return build_ptrmemfunc_access_expr (t, pfn_identifier);
+ }
+ /* APPLE LOCAL end KEXT 2.95-ptmf-compatibility --turly */
+
if (TREE_CODE (t) == PTRMEM_CST)
{
tree delta;
@@ -6500,3 +6764,16 @@ non_reference (tree t)
t = TREE_TYPE (t);
return t;
}
+
+/* APPLE LOCAL begin CW asm blocks */
+tree
+cw_asm_cp_build_component_ref (tree datum, tree component)
+{
+ tree expr = finish_class_member_access_expr (datum, component);
+ /* If this is not a real component reference, extract the field
+ decl, which includes the numeric offset we'll use later. */
+ if (TREE_CODE (datum) == TYPE_DECL)
+ expr = TREE_OPERAND (expr, 1);
+ return expr;
+}
+/* APPLE LOCAL end CW asm blocks */
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 8017af3dd25..db097f4d5a5 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -695,16 +695,26 @@ digest_init (tree type, tree init, tree* tail)
|| (element && TREE_CODE (element) == STRING_CST)))
{
tree string = element ? element : init;
+ /* APPLE LOCAL begin pascal strings */
+ bool pascal_p
+ = (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (string)))
+ == unsigned_char_type_node);
+ /* APPLE LOCAL end pascal strings */
if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (string)))
!= char_type_node)
+ /* APPLE LOCAL pascal strings */
+ && !pascal_p
&& TYPE_PRECISION (typ1) == BITS_PER_UNIT)
{
error ("char-array initialized from wide string");
return error_mark_node;
}
- if ((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (string)))
+ /* APPLE LOCAL begin pascal strings */
+ if (((TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (string)))
== char_type_node)
+ || pascal_p)
+ /* APPLE LOCAL end pascal strings */
&& TYPE_PRECISION (typ1) != BITS_PER_UNIT)
{
error ("int-array initialized from non-wide string");
@@ -721,7 +731,13 @@ digest_init (tree type, tree init, tree* tail)
because it's ok to ignore the terminating null char that is
counted in the length of the constant, but in C++ this would
be invalid. */
- if (size < TREE_STRING_LENGTH (string))
+ /* APPLE LOCAL begin pascal strings */
+ /* For Pascal strings, though, ignoring the terminating NUL
+ is still cool. */
+ if (size < (pascal_p
+ ? TREE_STRING_LENGTH (string) - 1
+ : TREE_STRING_LENGTH (string)))
+ /* APPLE LOCAL end pascal strings */
pedwarn ("initializer-string for array of chars is too long");
}
return string;
@@ -789,7 +805,15 @@ digest_init (tree type, tree init, tree* tail)
return process_init_constructor (type, 0, tail);
}
- if (code != ARRAY_TYPE)
+ /* APPLE LOCAL begin AltiVec */
+ if (code == VECTOR_TYPE
+ && TREE_CODE (init) == CONSTRUCTOR
+ && TREE_CODE (TREE_TYPE (init)) == VECTOR_TYPE
+ && vector_types_convertible_p (TREE_TYPE (init), type)
+ && TREE_CONSTANT (init))
+ return build_vector (type, CONSTRUCTOR_ELTS (init));
+ else if (code != ARRAY_TYPE)
+ /* APPLE LOCAL end AltiVec */
{
int flags = LOOKUP_NORMAL;
/* Initialization from { } is copy-initialization. */
diff --git a/gcc/cppdefault.c b/gcc/cppdefault.c
index 5f73dc56bbd..943ed77fb0a 100644
--- a/gcc/cppdefault.c
+++ b/gcc/cppdefault.c
@@ -41,6 +41,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# undef CROSS_INCLUDE_DIR
#endif
+/* APPLE LOCAL begin SDK 3886137. */
+/* Allow -isysroot to override ALL include patchs. This is done by
+ setting add_sysroot for all default inclue paths. */
const struct default_include cpp_include_defaults[]
#ifdef INCLUDE_DEFAULTS
= INCLUDE_DEFAULTS;
@@ -48,34 +51,34 @@ const struct default_include cpp_include_defaults[]
= {
#ifdef GPLUSPLUS_INCLUDE_DIR
/* Pick up GNU C++ generic include files. */
- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0 },
+ { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 1 },
#endif
#ifdef GPLUSPLUS_TOOL_INCLUDE_DIR
/* Pick up GNU C++ target-dependent include files. */
- { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 0 },
+ { GPLUSPLUS_TOOL_INCLUDE_DIR, "G++", 1, 1, 1 },
#endif
#ifdef GPLUSPLUS_BACKWARD_INCLUDE_DIR
/* Pick up GNU C++ backward and deprecated include files. */
- { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 0 },
+ { GPLUSPLUS_BACKWARD_INCLUDE_DIR, "G++", 1, 1, 1 },
#endif
#ifdef LOCAL_INCLUDE_DIR
/* /usr/local/include comes before the fixincluded header files. */
{ LOCAL_INCLUDE_DIR, 0, 0, 1, 1 },
#endif
#ifdef PREFIX_INCLUDE_DIR
- { PREFIX_INCLUDE_DIR, 0, 0, 1, 0 },
+ { PREFIX_INCLUDE_DIR, 0, 0, 1, 1 },
#endif
#ifdef GCC_INCLUDE_DIR
/* This is the dir for fixincludes and for gcc's private headers. */
- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0 },
+ { GCC_INCLUDE_DIR, "GCC", 0, 0, 1 },
#endif
#ifdef CROSS_INCLUDE_DIR
/* One place the target system's headers might be. */
- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0 },
+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 1 },
#endif
#ifdef TOOL_INCLUDE_DIR
/* Another place the target system's headers might be. */
- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 0 },
+ { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1, 1 },
#endif
#ifdef SYSTEM_INCLUDE_DIR
/* Some systems have an extra dir of include files. */
@@ -89,6 +92,8 @@ const struct default_include cpp_include_defaults[]
};
#endif /* no INCLUDE_DEFAULTS */
+/* APPLE LOCAL end SDK 3886137. */
+
#ifdef GCC_INCLUDE_DIR
const char cpp_GCC_INCLUDE_DIR[] = GCC_INCLUDE_DIR;
const size_t cpp_GCC_INCLUDE_DIR_len = sizeof GCC_INCLUDE_DIR - 8;
diff --git a/gcc/cse.c b/gcc/cse.c
index e9f6c2f4724..9d3ded97f9d 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4900,6 +4900,9 @@ cse_insn (rtx insn, rtx libcall_insn)
rtx src_eqv_here;
rtx src_const = 0;
rtx src_related = 0;
+ /* APPLE LOCAL begin cse of ZERO/SIGN EXTEND */
+ rtx zero_sign_extended_src = NULL_RTX;
+ /* APPLE LOCAL end cse of ZERO/SIGN EXTEND */
struct table_elt *src_const_elt = 0;
int src_cost = MAX_COST;
int src_eqv_cost = MAX_COST;
@@ -5033,7 +5036,35 @@ cse_insn (rtx insn, rtx libcall_insn)
REG_NOTE. */
if (!sets[i].src_volatile)
+ /* APPLE LOCAL begin cse of ZERO/SIGN EXTEND */
+ {
elt = lookup (src, sets[i].src_hash, mode);
+ if (!elt
+ && (GET_CODE(src) == ZERO_EXTEND || GET_CODE(src) == SIGN_EXTEND)
+ && GET_CODE (XEXP (src, 0)) == MEM)
+ {
+ unsigned mem_hash;
+ rtx nsrc = XEXP (src, 0);
+ enum machine_mode nmode = GET_MODE(nsrc);
+ do_not_record = 0;
+ hash_arg_in_memory = 0;
+ mem_hash = HASH (nsrc, nmode);
+ elt = lookup (nsrc, mem_hash, nmode);
+ if (elt)
+ {
+ sets[i].src = nsrc;
+ sets[i].src_hash = mem_hash;
+ sets[i].src_volatile = do_not_record;
+ sets[i].src_in_memory = hash_arg_in_memory;
+ zero_sign_extended_src = src;
+ src = nsrc;
+ mode = GET_MODE (src) == VOIDmode ? GET_MODE (dest) : GET_MODE (src);
+ sets[i].mode = mode;
+ src_folded = fold_rtx (src, insn);
+ }
+ }
+ }
+ /* APPLE LOCAL end cse of ZERO/SIGN EXTEND */
sets[i].src_elt = elt;
@@ -5062,6 +5093,26 @@ cse_insn (rtx insn, rtx libcall_insn)
for (p = elt->first_same_value; p; p = p->next_same_value)
if (p->is_const)
{
+ /* APPLE LOCAL begin cse of ZERO/SIGN EXTEND */
+ /* If we're looking at a MEM under a SIGN/ZERO_EXTEND,
+ constants match only if the high bits match. */
+ if (zero_sign_extended_src)
+ {
+ rtx truncated_const, trial;
+ truncated_const = gen_rtx_TRUNCATE (
+ GET_MODE (XEXP (zero_sign_extended_src, 0)),
+ copy_rtx (p->exp));
+ if (GET_CODE (zero_sign_extended_src) == ZERO_EXTEND)
+ trial = gen_rtx_ZERO_EXTEND (
+ GET_MODE (zero_sign_extended_src), truncated_const);
+ else
+ trial = gen_rtx_SIGN_EXTEND (
+ GET_MODE (zero_sign_extended_src), truncated_const);
+ trial = fold_rtx (trial, NULL_RTX);
+ if (!rtx_equal_p (trial, p->exp))
+ continue;
+ }
+ /* APPLE LOCAL end cse of ZERO/SIGN EXTEND */
src_const = p->exp;
src_const_elt = elt;
break;
@@ -5437,6 +5488,18 @@ cse_insn (rtx insn, rtx libcall_insn)
&& preferable (src_related_cost, src_related_regcost,
src_elt_cost, src_elt_regcost) <= 0)
trial = copy_rtx (src_related), src_related_cost = MAX_COST;
+ /* APPLE LOCAL begin cse of ZERO/SIGN EXTEND */
+ else if (zero_sign_extended_src)
+ {
+ trial = GET_CODE(zero_sign_extended_src) == ZERO_EXTEND
+ ? gen_rtx_ZERO_EXTEND (GET_MODE(zero_sign_extended_src),
+ copy_rtx (elt->exp))
+ : gen_rtx_SIGN_EXTEND (GET_MODE(zero_sign_extended_src),
+ copy_rtx (elt->exp));
+ elt = elt->next_same_value;
+ src_elt_cost = MAX_COST;
+ }
+ /* APPLE LOCAL end cse of ZERO/SIGN EXTEND */
else
{
trial = copy_rtx (elt->exp);
@@ -5527,6 +5590,11 @@ cse_insn (rtx insn, rtx libcall_insn)
}
src = SET_SRC (sets[i].rtl);
+ /* APPLE LOCAL begin cse of ZERO/SIGN EXTEND */
+ if (zero_sign_extended_src
+ && (GET_CODE (src) == GET_CODE (zero_sign_extended_src)))
+ src = XEXP (src, 0);
+ /* APPLE LOCAL end cse of ZERO/SIGN EXTEND */
/* In general, it is good to have a SET with SET_SRC == SET_DEST.
However, there is an important exception: If both are registers
@@ -5603,7 +5671,11 @@ cse_insn (rtx insn, rtx libcall_insn)
&& ! (GET_CODE (src_const) == CONST
&& GET_CODE (XEXP (src_const, 0)) == MINUS
&& GET_CODE (XEXP (XEXP (src_const, 0), 0)) == LABEL_REF
- && GET_CODE (XEXP (XEXP (src_const, 0), 1)) == LABEL_REF))
+ /* APPLE LOCAL begin cse of ZERO/SIGN EXTEND */
+ && (GET_CODE (XEXP (XEXP (src_const, 0), 1)) == LABEL_REF
+ || rtx_equal_p ((XEXP (XEXP (src_const, 0), 1)),
+ const0_rtx))))
+ /* APPLE LOCAL end */
{
/* We only want a REG_EQUAL note if src_const != src. */
if (! rtx_equal_p (src, src_const))
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index e7a7738816d..a2201b8274b 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -960,6 +960,10 @@ get_lang_number (void)
return N_SO_PASCAL;
else if (strcmp (language_string, "GNU Objective-C") == 0)
return N_SO_OBJC;
+ /* APPLE LOCAL begin Objective-C++ */
+ else if (strcmp (language_string, "GNU Objective-C++") == 0)
+ return N_SO_OBJCPLUS;
+ /* APPLE LOCAL end Objective-C++ */
else
return 0;
@@ -1045,6 +1049,13 @@ dbxout_init (const char *input_file_name)
current_file->pending_bincl_name = NULL;
#endif
+/* APPLE LOCAL begin gdb only used symbols */
+#ifndef DBX_ONLY_USED_SYMBOLS
+ dbxout_symbol (TYPE_NAME (integer_type_node), 0);
+ dbxout_symbol (TYPE_NAME (char_type_node), 0);
+#endif
+/* APPLE LOCAL end gdb only used symbols */
+
/* Get all permanent types that have typedef names, and output them
all, except for those already output. Some language front ends
put these declarations in the top-level scope; some do not;
@@ -2487,7 +2498,14 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED)
int tag_needed = 1;
int did_output = 0;
- if (DECL_NAME (decl))
+ /* APPLE LOCAL begin gdb only used symbols */
+ if (DECL_NAME (decl)
+#ifdef DBX_ONLY_USED_SYMBOLS
+ /* Do not generate a tag for incomplete records */
+ && (COMPLETE_TYPE_P (type) || TREE_CODE (type) == VOID_TYPE)
+#endif
+ )
+ /* APPLE LOCAL end gdb only used symbols */
{
/* Nonzero means we must output a tag as well as a typedef. */
tag_needed = 0;
diff --git a/gcc/df.c b/gcc/df.c
index 1fe44f20ef3..92a7f507eaa 100644
--- a/gcc/df.c
+++ b/gcc/df.c
@@ -893,9 +893,11 @@ df_def_record_1 (struct df *df, rtx x, basic_block bb, rtx insn)
loc = &SET_DEST (x);
dst = *loc;
- /* Some targets place small structures in registers for
+ /* APPLE LOCAL begin handle DImode parallel */
+ /* Some targets place small structures or 64-bit ints in registers for
return values of functions. */
- if (GET_CODE (dst) == PARALLEL && GET_MODE (dst) == BLKmode)
+ if (GET_CODE (dst) == PARALLEL)
+ /* APPLE LOCAL end handle DImode parallel */
{
int i;
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index b047167bc49..577e31e1101 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -60,6 +60,16 @@ static void real_abort (void) ATTRIBUTE_NORETURN;
/* A diagnostic_context surrogate for stderr. */
static diagnostic_context global_diagnostic_context;
diagnostic_context *global_dc = &global_diagnostic_context;
+
+/* APPLE LOCAL begin error-colon */
+static int gcc_error_colon = 0;
+/* APPLE LOCAL end error-colon */
+
+/* APPLE LOCAL begin insert assembly ".abort" directive on fatal error */
+#ifdef EXIT_FROM_FATAL_DIAGNOSTIC
+#define exit(status) EXIT_FROM_FATAL_DIAGNOSTIC (status)
+#endif
+/* APPLE LOCAL end insert assembly ".abort" directive on fatal error */
/* Return a malloc'd string containing MSG formatted a la printf. The
caller is responsible for freeing the memory. */
@@ -80,6 +90,11 @@ build_message_string (const char *msg, ...)
char *
file_name_as_prefix (const char *f)
{
+ /* APPLE LOCAL begin error-colon */
+ if (gcc_error_colon)
+ return build_message_string ("%s: error: ", f);
+ else
+ /* APPLE LOCAL end error-colon */
return build_message_string ("%s: ", f);
}
@@ -150,6 +165,23 @@ diagnostic_count_diagnostic (diagnostic_context *context,
diagnostic_info *diagnostic)
{
diagnostic_t kind = diagnostic->kind;
+
+ /* APPLE LOCAL begin error-colon */
+ /* Here so it gets executed early on. */
+ {
+ static int done = 0;
+ if (!done)
+ {
+ done = 1; /* Do this only once. */
+ /* Pretend we saw "-w" on commandline. */
+ if (getenv ("GCC_DASH_W"))
+ inhibit_warnings = 1; /* referenced by diagnostic.h:diagnostic_report_warnings() */
+ if (getenv ("GCC_ERROR_COLON"))
+ gcc_error_colon = 1;
+ }
+ }
+ /* APPLE LOCAL end error-colon */
+
switch (kind)
{
default:
diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi
index 872cffcd501..5edeebdf239 100644
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -237,6 +237,12 @@ preprocessed output.
When used with the driver options @option{-MD} or @option{-MMD},
@option{-MF} overrides the default dependency output file.
+@c APPLE LOCAL begin -dependency-file
+@item -dependency-file
+@opindex dependency-file @var{name}
+Like @option{-MF}. (APPLE ONLY)
+@c APPLE LOCAL end -dependency-file
+
@item -MG
@opindex MG
In conjunction with an option such as @option{-M} requesting
@@ -348,13 +354,17 @@ current directory.
@item -x c
@itemx -x c++
@itemx -x objective-c
+@c APPLE LOCAL Objective-C++
+@itemx -x objective-c++
@itemx -x assembler-with-cpp
@opindex x
-Specify the source language: C, C++, Objective-C, or assembly. This has
+@c APPLE LOCAL Objective-C++
+Specify the source language: C, C++, Objective-C, Objective-C++, or assembly. This has
nothing to do with standards conformance or extensions; it merely
selects which base syntax to expect. If you give none of these options,
cpp will deduce the language from the extension of the source file:
-@samp{.c}, @samp{.cc}, @samp{.m}, or @samp{.S}. Some other common
+@c APPLE LOCAL Objective-C++
+@samp{.c}, @samp{.cc}, @samp{.m}, @samp{.mm}, or @samp{.S}. Some other common
extensions for C++ and assembly are also recognized. If cpp does not
recognize the extension, it will treat the file as C; this is the most
generic mode.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 7e4d66aaa87..bfc4472f1f8 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -54,6 +54,10 @@ extensions, accepted by GCC in C89 mode and in C++.
* C++ Comments:: C++ comments are recognized.
* Dollar Signs:: Dollar sign is allowed in identifiers.
* Character Escapes:: @samp{\e} stands for the character @key{ESC}.
+@c APPLE LOCAL begin pascal strings
+* Pascal Strings:: Constructing string literals with a Pascal-style
+ length byte.
+@c APPLE LOCAL end pascal strings
* Variable Attributes:: Specifying attributes of variables.
* Type Attributes:: Specifying attributes of types.
* Alignment:: Inquiring about the alignment of a type or variable.
@@ -63,6 +67,8 @@ extensions, accepted by GCC in C89 mode and in C++.
* Constraints:: Constraints for asm operands
* Asm Labels:: Specifying the assembler name to use for a C symbol.
* Explicit Reg Vars:: Defining variables residing in specified registers.
+@c APPLE LOCAL CW asm blocks
+* Asm Blocks and Functions:: Block and functions of assembly code.
* Alternate Keywords:: @code{__const__}, @code{__asm__}, etc., for header files.
* Incomplete Enums:: @code{enum foo;}, with details to follow.
* Function Names:: Printable strings which are the name of the current
@@ -449,8 +455,10 @@ bar (int *array, int offset, int size)
@end group
@end smallexample
+@c APPLE LOCAL begin mainline 2005-03-04
A nested function always has no linkage. Declaring one with
@code{extern} or @code{static} is erroneous. If you need to declare the nested function
+@c APPLE LOCAL end mainline 2005-03-04
before its definition, use @code{auto} (which is otherwise meaningless
for function declarations).
@@ -1868,6 +1876,8 @@ the specified function is an interrupt handler. The compiler will generate
function entry and exit sequences suitable for use in an interrupt
handler when this attribute is present.
+@c APPLE LOCAL Apple customers doesn't care about ARM options.
+@ignore
@item long_call/short_call
@cindex indirect calls on ARM
This attribute specifies how a particular function is called on
@@ -1878,6 +1888,8 @@ function by first loading its address into a register and then using the
contents of that register. The @code{short_call} attribute always places
the offset to the function from the call site into the @samp{BL}
instruction directly.
+@c APPLE LOCAL Apple customers don't care about ARM options.
+@end ignore
@item longcall/shortcall
@cindex functions called via pointer on the RS/6000 and PowerPC
@@ -2640,6 +2652,62 @@ machines, typically because the target assembler does not allow them.
You can use the sequence @samp{\e} in a string or character constant to
stand for the ASCII character @key{ESC}.
+@c APPLE LOCAL begin pascal strings
+@node Pascal Strings
+@section Constructing String Literals with a Pascal-style Length Byte
+@cindex Pascal length byte
+@cindex Pascal strings
+
+Specifying the @w{@option{-fpascal-strings}} option will cause the
+compiler to recognize and construct Pascal-style string literals. This
+functionality is disabled by default; furthermore, its use in new code
+is discouraged.
+
+Pascal string literals take the form @samp{"\pstring"}. The special
+escape sequence @samp{\p} denotes the Pascal length byte for the string,
+and will be replaced at compile time with the number of characters that
+follow. The @samp{\p} may only appear at the beginning of a string
+literal, and may @emph{not} appear in wide string literals or as an
+integral constant.
+
+As is the case with C string literals, Pascal string literals are
+terminated with a NUL character; this character is @emph{not} counted
+when computing the value of the length byte. The maximum @samp{unsigned
+char} value that can be stored in the length byte is also the maximum
+permissible length for the Pascal literal itself. On most target
+platforms, this value is 255 (excluding both the length byte and the
+terminating NUL).
+
+Pascal-style literals are treated by the compiler as being of type
+@samp{const unsigned char []} in C++ and @samp{unsigned char []} (or
+@samp{const unsigned char []}, if the @w{@option{-Wwrite-strings}}
+option is given) in C. Pascal string literals may be used as static
+initializers for @samp{char} arrays (whose elements need not be
+@samp{unsigned} or @samp{const}). They may also be converted to
+@samp{const unsigned char *} and, in the C language to @samp{const char
+*} of any signedness (In C, if the @w{@option{-Wwrite-strings}} is not
+given, then @samp{const} may be omitted as well). For example:
+
+@example
+const unsigned char a[] = "\pHello";
+char b[] = "\pGoodbye";
+const unsigned char *c = "\pHello";
+const signed char *d = "\pHello"; /* error in C++ */
+char *e = "\pHi"; /* error in C++; warning in C with -Wwrite-strings */
+unsigned char *f = "\pHello"; /* error in C++ */
+@end example
+
+@noindent
+In all other respects, Pascal-style string literals behave the same as
+ordinary string literals. For example, if a program attempts to modify
+the conents of a Pascal-style string literal at run-time, the behaviour
+is undefined, unless the @w{@option{-fwritable-strings}} option is used.
+
+Pascal-style literals are useful for calling external routines that
+expect Pascal strings as arguments, as is true with some Apple MacOS
+Toolbox calls.
+@c APPLE LOCAL end pascal strings
+
@node Alignment
@section Inquiring on Alignment of Types or Variables
@cindex alignment
@@ -4195,6 +4263,85 @@ register int *p2 asm ("r1") = @dots{};
In those cases, a solution is to use a temporary variable for
each arbitrary expression. @xref{Example of asm with clobbered asm reg}.
+@c APPLE LOCAL begin CW asm blocks
+@node Asm Blocks and Functions
+@section Blocks and Functions of Assembly Language
+
+(This feature is APPLE ONLY.)
+
+In addition to writing single statements in assembly, you can also
+define blocks and entire functions to use a mixed assembly and C
+syntax. The syntax follows that used in Metrowerks' CodeWarrior.
+This extension must be explicitly enabled with the
+@option{-fasm-blocks} option.
+
+The block syntax consists of @code{asm} followed by braces, with the
+assembly instructions on separate lines. (However, @code{';'} may be
+used to put several instructions on one line.) You write labels with
+either a preceding @code{'@@'} or a trailing @code{':'} (or both, if
+you prefer); labels are always local to the asm block, and there is no
+way for a label in one block to refer to a label in another block.
+Comments and lexical rules are as for standard C/C++.
+
+@verbatim
+int foo (int arg) {
+ register int bar;
+ asm {
+ li bar, 42
+ add bar, arg, bar ; nop ; ; nop
+ }
+ return bar;
+}
+@end verbatim
+
+The function syntax uses @code{asm} as a keyword in the function
+definition. In this form, C declarations may appear at the beginning
+of the function body, in order to declare variables that you want to
+use in the body, but may not be used after the first assembly opcode
+or label (even in C99 or C++).
+
+@verbatim
+asm int baz (int arg1) {
+ register int loc1, loc2;
+ @123
+ li loc1,4 * 89
+ nand. r5,arg1,loc1
+ ble- cr0, @123
+ otherlab: nop
+ mr r3,r5
+}
+@end verbatim
+
+Note that the compiler just passes the instructions through to the
+assembler with only necessary changes, such as a substitution of
+globally unique labels. Assembly syntax errors will therefore be
+reported by the assembler.
+
+Also note that the use of literal registers (such as r3) in functions
+may not work properly with functions that are being inlined.
+
+The following instructions are assumed to affect memory: @code{l...}
+except @code{la}, @code{li} and @code{lis} (all memory loads),
+@code{st...} (all memory stores), @code{sc}, @code{td...},
+@code{trap}, @code{tw...}. All other instructions are assumed to not
+affect memory.
+
+The following instructions take a memory operand (address operand) as
+their second operand, all other instructions are assumed to not:
+
+@code{la}, @code{lbzu}, @code{ld}, @code{ldu}, @code{lfd},
+@code{lfdu}, @code{lfs}, @code{lfsu}, @code{lha}, @code{lhau},
+@code{lhz}, @code{lhzu}, @code{lmw}, @code{lwa}, @code{lwz},
+@code{lwzu}, @code{stb}, @code{stbu}, @code{std}, @code{stdu},
+@code{stfd}, @code{stfdu}, @code{stfs}, @code{stfsu}, @code{sth},
+@code{sthu}, @code{stmw}, @code{stw}, @code{stwu}.
+
+Arguments that require substitution beyond vector registers, floating
+point registers, general registers are not supported; an example
+would be trying to use the compiler to allocate condition code
+registers instead of just writting a specific condition code register.
+@c APPLE LOCAL end CW asm blocks
+
@node Alternate Keywords
@section Alternate Keywords
@cindex alternate keywords
@@ -7448,7 +7595,11 @@ vector unsigned short vec_vmuloub (vector unsigned char,
vector unsigned char);
vector float vec_nmsub (vector float, vector float, vector float);
+@c APPLE LOCAL begin fixhtml --mrs
+@end smallexample
+@smallexample
+@c APPLE LOCAL end fixhtml --mrs
vector float vec_nor (vector float, vector float);
vector signed int vec_nor (vector signed int, vector signed int);
vector unsigned int vec_nor (vector unsigned int, vector unsigned int);
diff --git a/gcc/doc/gcc.texi b/gcc/doc/gcc.texi
index 66e22ed3b48..5a4fa107292 100644
--- a/gcc/doc/gcc.texi
+++ b/gcc/doc/gcc.texi
@@ -145,6 +145,8 @@ Introduction, gccint, GNU Compiler Collection (GCC) Internals}.
* Copying:: GNU General Public License says
how you can copy and share GCC.
+@c APPLE LOCAL GPL compliance
+* Source Code:: How to get the source code for this compiler.
* GNU Free Documentation License:: How you can copy and share this manual.
* Contributors:: People who have contributed to GCC.
@@ -167,6 +169,8 @@ Introduction, gccint, GNU Compiler Collection (GCC) Internals}.
@include funding.texi
@include gnu.texi
+@c APPLE LOCAL GPL compliance
+@include sourcecode.texi
@include gpl.texi
@c ---------------------------------------------------------------------
diff --git a/gcc/doc/include/sourcecode.texi b/gcc/doc/include/sourcecode.texi
new file mode 100644
index 00000000000..5fc0342c2c9
--- /dev/null
+++ b/gcc/doc/include/sourcecode.texi
@@ -0,0 +1,36 @@
+@c APPLE LOCAL file GPL compliance
+@node Source Code
+@unnumbered Source Code
+
+The source code for Apple's versions of GCC is available using
+anonymous CVS, from
+@samp{:pserver:anonymous@@anoncvs.opensource.apple.com:/cvs/root}
+with password @samp{anonymous}, as module @samp{gcc}, branch
+@samp{apple-ppc-branch}.
+
+For example, you can fetch the latest version by entering:
+
+@smallexample
+$ cvs -d :pserver:anonymous@@anoncvs.opensource.apple.com:/cvs/root login
+Password: anonymous
+$ cvs -d :pserver:anonymous@@anoncvs.opensource.apple.com:/cvs/root -z6 \
+ co -r apple-ppc-branch gcc
+@end smallexample
+
+Each version will be tagged based on its build number, which
+you can find by executing @samp{gcc --version}; for instance, if this prints
+
+@smallexample
+gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1402)
+@end smallexample
+
+then the build number is 1402. Some older compilers may require you
+use @samp{gcc -v} to obtain the build number. Most versions are
+tagged like @samp{apple-gcc-1402}; you can find a list of suitable tags with
+a command like @samp{cvs log gcc/gcc/version.c}. Once you have the
+tag, you can use the @samp{-r} flag to CVS, for instance
+
+@smallexample
+$ cvs -d :pserver:anonymous@@anoncvs.opensource.apple.com:/cvs/root -z6 \
+ co -r apple-gcc-1402 gcc
+@end smallexample
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 88f19dc4afc..61b32c46588 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -40,6 +40,21 @@ gcc [@option{-c}|@option{-S}|@option{-E}] [@option{-std=}@var{standard}]
Only the most useful options are listed here; see below for the
remainder. @samp{g++} accepts mostly the same options as @samp{gcc}.
+
+@c APPLE LOCAL begin manual
+In Apple's version of GCC, both @samp{cc} and @samp{gcc} are actually
+symbolic links to a compiler named like @samp{gcc-3.4}; which compiler
+is linked to may be changed using the command @samp{gcc_select}.
+Similarly, @samp{c++} and @samp{g++} are links to a compiler named like
+@samp{g++-3.4}.
+
+Note that Apple's GCC includes a number of extensions to standard GCC
+(flagged below with ``APPLE ONLY''), and that not all generic GCC
+options are available or supported on Darwin / Mac OS X. In particular,
+Apple does not currently support the compilation of Fortran, Ada, or
+Java, although there are third parties who have made these work.
+@c APPLE LOCAL end manual
+
@c man end
@c man begin SEEALSO
gpl(7), gfdl(7), fsf-funding(7),
@@ -48,8 +63,10 @@ and the Info entries for @file{gcc}, @file{cpp}, @file{as},
@file{ld}, @file{binutils} and @file{gdb}.
@c man end
@c man begin BUGS
-For instructions on reporting bugs, see
-@w{@uref{http://gcc.gnu.org/bugs.html}}.
+@c APPLE LOCAL begin Apple bug-report
+To report bugs to Apple, see
+@w{@uref{http://developer.apple.com/bugreporter}}.
+@c APPLE LOCAL end Apple bug-report
@c man end
@c man begin AUTHOR
See the Info entry for @command{gcc}, or
@@ -156,17 +173,44 @@ in the following sections.
@item Overall Options
@xref{Overall Options,,Options Controlling the Kind of Output}.
@gccoptlist{-c -S -E -o @var{file} -combine -pipe -pass-exit-codes @gol
+@c APPLE LOCAL -ObjC 2001-08-03 --sts **
+-ObjC (APPLE ONLY) -ObjC++ (APPLE ONLY) @gol
+@c APPLE LOCAL fat builds
+-arch @var{arch} (APPLE ONLY) @gol
-x @var{language} -v -### --help --target-help --version}
@item C Language Options
@xref{C Dialect Options,,Options Controlling C Dialect}.
@gccoptlist{-ansi -std=@var{standard} -aux-info @var{filename} @gol
+@c APPLE LOCAL AltiVec
+-faltivec (APPLE ONLY) @gol
+@c APPLE LOCAL CW asm blocks
+-fasm-blocks (APPLE ONLY) @gol
-fno-asm -fno-builtin -fno-builtin-@var{function} @gol
-fhosted -ffreestanding -fms-extensions @gol
-trigraphs -no-integrated-cpp -traditional -traditional-cpp @gol
-fallow-single-precision -fcond-mismatch @gol
+@c APPLE LOCAL constant cfstrings --mrs
+-fconstant-cfstrings (APPLE ONLY) @gol
+@c APPLE LOCAL non lvalue assign
+-fnon-lvalue-assign (APPLE ONLY) @gol
+@c APPLE LOCAL pch distcc --mrs
+-fpch-preprocess (APPLE ONLY) @gol
-fsigned-bitfields -fsigned-char @gol
--funsigned-bitfields -funsigned-char}
+@c APPLE LOCAL pascal strings
+-fpascal-strings (APPLE ONLY) @gol
+@c APPLE LOCAL -Wno-#warnings
+-Wno-#warnings (APPLE ONLY) @gol
+@c APPLE LOCAL -Wextra-tokens 2001-08-02 --sts **
+-Wextra-tokens (APPLE ONLY) @gol
+@c APPLE LOCAL -Wpragma-once 2001-08-01 --sts **
+-Wpragma-once (APPLE ONLY) @gol
+@c APPLE LOCAL -Wnewline-eof 2001-08-23 --sts **
+-Wnewline-eof (APPLE ONLY) @gol
+@c APPLE LOCAL -Wno-altivec-long-deprecated --ilr **
+-Wno-altivec-long-deprecated (APPLE ONLY)
+@c APPLE LOCAL fwritable strings
+-funsigned-bitfields -funsigned-char -fwritable-strings}
@item C++ Language Options
@xref{C++ Dialect Options,,Options Controlling C++ Dialect}.
@@ -197,11 +241,17 @@ Objective-C and Objective-C++ Dialects}.
-fconstant-string-class=@var{class-name} @gol
-fgnu-runtime -fnext-runtime @gol
-fno-nil-receivers @gol
+@c APPLE LOCAL ObjC C++ ivars
+-fobjc-call-cxx-cdtors (APPLE ONLY) @gol
-fobjc-exceptions @gol
-freplace-objc-classes @gol
-fzero-link @gol
-gen-decls @gol
--Wno-protocol -Wselector -Wundeclared-selector}
+@c APPLE LOCAL begin Objective-C
+-Wno-protocol -Wselector @gol
+-Wstrict-selector-match @gol
+-Wundeclared-selector}
+@c APPLE LOCAL end Objective-C
@item Language Independent Options
@xref{Language Independent Options,,Options to Control Diagnostic Messages Formatting}.
@@ -226,6 +276,8 @@ Objective-C and Objective-C++ Dialects}.
-Wmain -Wmissing-braces -Wmissing-field-initializers @gol
-Wmissing-format-attribute -Wmissing-include-dirs @gol
-Wmissing-noreturn @gol
+@c APPLE LOCAL -Wmost
+-Wmost (APPLE ONLY) @gol
-Wno-multichar -Wnonnull -Wpacked -Wpadded @gol
-Wparentheses -Wpointer-arith -Wredundant-decls @gol
-Wreturn-type -Wsequence-point -Wshadow @gol
@@ -258,6 +310,11 @@ Objective-C and Objective-C++ Dialects}.
-fdump-tree-ssa@r{[}-@var{n}@r{]} -fdump-tree-pre@r{[}-@var{n}@r{]} @gol
-fdump-tree-ccp@r{[}-@var{n}@r{]} -fdump-tree-dce@r{[}-@var{n}@r{]} @gol
-fdump-tree-gimple@r{[}-raw@r{]} -fdump-tree-mudflap@r{[}-@var{n}@r{]} @gol
+@c APPLE LOCAL begin lno
+-fdump-tree-scev @r{[}-@var{n}@r{]} @gol
+-fdump-tree-ddall @r{[}-@var{n}@r{]}@gol
+-fdump-tree-elck @r{[}-@var{n}@r{]} @gol
+@c APPLE LOCAL end lno
-fdump-tree-dom@r{[}-@var{n}@r{]} @gol
-fdump-tree-dse@r{[}-@var{n}@r{]} @gol
-fdump-tree-phiopt@r{[}-@var{n}@r{]} @gol
@@ -266,6 +323,10 @@ Objective-C and Objective-C++ Dialects}.
-fdump-tree-nrv -fdump-tree-vect @gol
-fdump-tree-sra@r{[}-@var{n}@r{]} @gol
-fdump-tree-fre@r{[}-@var{n}@r{]} @gol
+@c APPLE LOCAL begin lno
+-fdump-tree-loop@r{[}-@var{n}@r{]} @gol
+-fdump-tree-vect@r{[}-@var{n}@r{]} @gol
+@c APPLE LOCAL end lno
-ftree-vectorizer-verbose=@var{n} @gol
-feliminate-dwarf2-dups -feliminate-unused-debug-types @gol
-feliminate-unused-debug-symbols -fmem-report -fprofile-arcs -ftree-based-profiling @gol
@@ -285,7 +346,8 @@ Objective-C and Objective-C++ Dialects}.
-fbounds-check -fmudflap -fmudflapth -fmudflapir @gol
-fbranch-probabilities -fprofile-values -fvpt -fbranch-target-load-optimize @gol
-fbranch-target-load-optimize2 -fbtr-bb-exclusive @gol
--fcaller-saves -fcprop-registers @gol
+@c APPLE LOCAL add fcreate-profile
+-fcaller-saves -fcprop-registers -fcreate-profile @gol
-fcse-follow-jumps -fcse-skip-blocks -fdata-sections @gol
-fdelayed-branch -fdelete-null-pointer-checks @gol
-fexpensive-optimizations -ffast-math -ffloat-store @gol
@@ -320,9 +382,13 @@ Objective-C and Objective-C++ Dialects}.
-ftree-pre -ftree-ccp -ftree-dce -ftree-loop-optimize @gol
-ftree-loop-linear -ftree-loop-im -ftree-loop-ivcanon -fivopts @gol
-ftree-dominator-opts -ftree-dse -ftree-copyrename @gol
--ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -ftree-vectorize @gol
+@c APPLE LOCAL lno
+-ftree-ch -ftree-sra -ftree-ter -ftree-lrs -ftree-fre -fscalar-evolutions -fall-data-deps -ftree-vectorize @gol
+@c APPLE LOCAL add fuse-profile
+-fuse-profile @gol
--param @var{name}=@var{value}
--O -O0 -O1 -O2 -O3 -Os}
+@c APPLE LOCAL -fast
+-O -O0 -O1 -O2 -O3 -Os -fast (APPLE ONLY)}
@item Preprocessor Options
@xref{Preprocessor Options,,Options Controlling the Preprocessor}.
@@ -346,6 +412,8 @@ Objective-C and Objective-C++ Dialects}.
@item Linker Options
@xref{Link Options,,Options for Linking}.
@gccoptlist{@var{object-file-name} -l@var{library} @gol
+@c APPLE LOCAL radar 2466994 - -no-c++filt --ilr
+-no-c++filt (APPLE ONLY) @gol
-nostartfiles -nodefaultlibs -nostdlib -pie @gol
-s -static -static-libgcc -shared -shared-libgcc -symbolic @gol
-Wl,@var{option} -Xlinker @var{option} @gol
@@ -366,6 +434,8 @@ Objective-C and Objective-C++ Dialects}.
@c Try and put the significant identifier (CPU or system) first,
@c so users have a clue at guessing where the ones they want will be.
+@c APPLE LOCAL prune man page
+@ignore
@emph{ARC Options}
@gccoptlist{-EB -EL @gol
-mmangle-cpu -mcpu=@var{cpu} -mtext=@var{text-section} @gol
@@ -406,6 +476,8 @@ Objective-C and Objective-C++ Dialects}.
-m32-bit -m16-bit -m8-bit -mno-prologue-epilogue -mno-gotplt @gol
-melf -maout -melinux -mlinux -sim -sim2 @gol
-mmul-bug-workaround -mno-mul-bug-workaround}
+@c APPLE LOCAL prune man page
+@end ignore
@emph{Darwin Options}
@gccoptlist{-all_load -allowable_client -arch -arch_errors_fatal @gol
@@ -432,6 +504,8 @@ Objective-C and Objective-C++ Dialects}.
-unexported_symbols_list -weak_reference_mismatches @gol
-whatsloaded -F -gused -gfull -mone-byte-bool}
+@c APPLE LOCAL prune man page
+@ignore
@emph{DEC Alpha Options}
@gccoptlist{-mno-fp-regs -msoft-float -malpha-as -mgas @gol
-mieee -mieee-with-inexact -mieee-conformant @gol
@@ -481,6 +555,8 @@ Objective-C and Objective-C++ Dialects}.
-mpa-risc-1-1 -mpa-risc-2-0 -mportable-runtime @gol
-mschedule=@var{cpu-type} -mspace-regs -msio -mwsio @gol
-munix=@var{unix-std} -nolibdld -static -threads}
+@c APPLE LOCAL prune man page
+@end ignore
@emph{i386 and x86-64 Options}
@gccoptlist{-mtune=@var{cpu-type} -march=@var{cpu-type} @gol
@@ -497,6 +573,8 @@ Objective-C and Objective-C++ Dialects}.
-mcmodel=@var{code-model} @gol
-m32 -m64}
+@c APPLE LOCAL prune man page
+@ignore
@emph{IA-64 Options}
@gccoptlist{-mbig-endian -mlittle-endian -mgnu-as -mgnu-ld -mno-pic @gol
-mvolatile-asm-stop -mb-step -mregister-names -mno-sdata @gol
@@ -588,6 +666,8 @@ Objective-C and Objective-C++ Dialects}.
-mfloat64 -mno-float32 -mabshi -mno-abshi @gol
-mbranch-expensive -mbranch-cheap @gol
-msplit -mno-split -munix-asm -mdec-asm}
+@c APPLE LOCAL prune man page
+@end ignore
@emph{PowerPC Options}
See RS/6000 and PowerPC Options.
@@ -598,6 +678,8 @@ See RS/6000 and PowerPC Options.
-mpower -mno-power -mpower2 -mno-power2 @gol
-mpowerpc -mpowerpc64 -mno-powerpc @gol
-maltivec -mno-altivec @gol
+@c APPLE LOCAL AltiVec
+-mpim-altivec -mno-pim-altivec @gol
-mpowerpc-gpopt -mno-powerpc-gpopt @gol
-mpowerpc-gfxopt -mno-powerpc-gfxopt @gol
-mnew-mnemonics -mold-mnemonics @gol
@@ -625,6 +707,8 @@ See RS/6000 and PowerPC Options.
-msim -mmvme -mads -myellowknife -memb -msdata @gol
-msdata=@var{opt} -mvxworks -mwindiss -G @var{num} -pthread}
+@c APPLE LOCAL prune man page
+@ignore
@emph{S/390 and zSeries Options}
@gccoptlist{-mtune=@var{cpu-type} -march=@var{cpu-type} @gol
-mhard-float -msoft-float -mbackchain -mno-backchain @gol
@@ -697,6 +781,8 @@ See i386 and x86-64 Options.
@emph{zSeries Options}
See S/390 and zSeries Options.
+@c APPLE LOCAL prune man page
+@end ignore
@item Code Generation Options
@xref{Code Gen Options,,Options for Code Generation Conventions}.
@@ -797,6 +883,15 @@ C++ source code which must be preprocessed. Note that in @samp{.cxx},
the last two letters must both be literally @samp{x}. Likewise,
@samp{.C} refers to a literal capital C@.
+@c APPLE LOCAL begin Objective-C++
+@item @var{file}.mm
+@itemx @var{file}.M
+Objective-C++ source code which must be preprocessed. (APPLE ONLY)
+
+@item @var{file}.mii
+Objective-C++ source code which should not be preprocessed. (APPLE ONLY)
+@c APPLE LOCAL end Objective-C++
+
@item @var{file}.hh
@itemx @var{file}.H
C++ header file to be turned into a precompiled header.
@@ -843,7 +938,10 @@ package body). Such files are also called @dfn{bodies}.
@c @var{file}.pas
@item @var{file}.s
-Assembler code.
+@c APPLE LOCAL begin preprocess .s files
+Assembler code. Apple's version of GCC runs the preprocessor
+on these files as well as those ending in @samp{.S}.
+@c APPLE LOCAL end preprocess .s files
@item @var{file}.S
Assembler code which must be preprocessed.
@@ -880,6 +978,27 @@ Turn off any specification of a language, so that subsequent files are
handled according to their file name suffixes (as they are if @option{-x}
has not been used at all).
+@c APPLE LOCAL begin -ObjC 2001-08-03 --sts **
+@item -ObjC
+@item -ObjC++
+@opindex ObjC
+@opindex ObjC++
+These are similar in effect to @option{-x objective-c} and @option{-x
+objective-c++}, but affect only the choice of compiler for files already
+identified as source files. (APPLE ONLY)
+@c APPLE LOCAL end -ObjC 2001-08-03 --sts **
+
+@c APPLE LOCAL begin fat builds
+@item -arch @var{arch}
+Compile for the specified target architecture @var{arch}. The allowable
+values are @samp{i386} and @samp{ppc}. Multiple options work, and
+direct the compiler to produce ``fat'' binaries including object code
+for each architecture specified with @option{-arch}. This option only
+works if assembler and libraries are available for each architecture
+specified. (APPLE ONLY)
+@opindex arch
+@c APPLE LOCAL end fat builds
+
@item -pass-exit-codes
@opindex pass-exit-codes
Normally the @command{gcc} program will exit with the code of 1 if any
@@ -1150,6 +1269,20 @@ character). In the case of function definitions, a K&R-style list of
arguments followed by their declarations is also provided, inside
comments, after the declaration.
+@c APPLE LOCAL begin AltiVec
+@item -faltivec
+This flag is provided for compatibility with Metrowerks CodeWarrior and MrC
+compilers as well as previous Apple versions of GCC. It causes the
+@option{-mpim-altivec} option to be turned on.
+@c APPLE LOCAL end AltiVec
+
+@c APPLE LOCAL begin CW asm blocks
+@item -fasm-blocks
+Enable the use of blocks and entire functions of assembly code within
+a C or C++ file. The syntax follows that used in CodeWarrior. (APPLE
+ONLY)
+@c APPLE LOCAL end CW asm blocks
+
@item -fno-asm
@opindex fno-asm
Do not recognize @code{asm}, @code{inline} or @code{typeof} as a
@@ -1268,6 +1401,41 @@ Allow conditional expressions with mismatched types in the second and
third arguments. The value of such an expression is void. This option
is not supported for C++.
+@c APPLE LOCAL begin pch distcc --mrs
+@item -fpch-preprocess
+@opindex fpch-preprocess
+Enable PCH processing even when @option{-E} or @option{-save-temps} is used.
+@c APPLE LOCAL end pch distcc --mrs
+
+@c APPLE LOCAL begin non lvalue assign
+@item -fnon-lvalue-assign
+@item fnon-lvalue-assign
+C and C++ forbid the use of casts and conditional expressions as lvalues, e.g.:
+
+@smallexample
+float *p, q, r;
+((int *)p)++;
+(cond ? q : r) = 3.0;
+@end smallexample
+
+@noindent
+As a transitional measure, the Apple version of GCC 4.0 allows casts and
+conditional expressions to be used as lvalues in certain situations. This
+is accomplished via the @option{-fnon-lvalue-assign} switch, which is on
+by default. Whenever an lvalue cast or an lvalue conditional expression is
+encountered, the compiler will issue a deprecation warning and then rewrite
+the expression as follows:
+
+@smallexample
+(type)expr ---becomes---> *(type *)&expr
+cond ? expr1 : expr2 ---becomes---> *(cond ? &expr1 : &expr2)
+@end smallexample
+
+To disallow lvalue casts and lvalue conditional expressions altogether,
+specify @option{-fno-non-lvalue-assign}; lvalue casts and lvalue conditional
+expressions will be disallowed in future versions of Apple's GCC.
+@c APPLE LOCAL end non lvalue assign
+
@item -funsigned-char
@opindex funsigned-char
Let the type @code{char} be unsigned, like @code{unsigned char}.
@@ -1307,6 +1475,36 @@ These options control whether a bit-field is signed or unsigned, when the
declaration does not use either @code{signed} or @code{unsigned}. By
default, such a bit-field is signed, because this is consistent: the
basic integer types such as @code{int} are signed types.
+
+@c APPLE LOCAL begin constant cfstrings
+@item -fconstant-cfstrings
+@opindex fconstant-cfstrings
+Enable the automatic creation of a CoreFoundation-type constant string
+whenever a special builtin @code{__builtin__CFStringMakeConstantString}
+is called on a literal string. (APPLE ONLY)
+@c APPLE LOCAL end constant cfstrings
+
+@c APPLE LOCAL begin pascal strings
+@item -fpascal-strings
+Allow Pascal-style string literals to be constructed. (APPLE ONLY)
+
+@xref{Pascal Strings,,Constructing String Literals with a Pascal-style
+Length Byte}, for more information on the syntax and semantics of Pascal
+string literals.
+@c APPLE LOCAL end pascal strings
+
+@c APPLE LOCAL begin fwritable strings.
+@item -fwritable-strings
+@opindex fwritable-strings
+Store string constants in the writable data segment and don't uniquize
+them. This is for compatibility with old programs which assume they can
+write into string constants.
+
+Writing into string constants is a very bad idea; ``constants'' should
+be constant.
+
+This option is deprecated.
+@c APPLE LOCAL end fwritable strings.
@end table
@node C++ Dialect Options
@@ -1378,7 +1576,10 @@ been added for putting variables into BSS without making them common.
Give string constants type @code{char *} instead of type @code{const
char *}. By default, G++ uses type @code{const char *} as required by
the standard. Even if you use @option{-fno-const-strings}, you cannot
-actually modify the value of a string constant.
+@c APPLE LOCAL begin fwritable strings.
+actually modify the value of a string constant, unless you also use
+@option{-fwritable-strings}.
+@c APPLE LOCAL end fwritable strings.
This option might be removed in a future release of G++. For maximum
portability, you should structure your code so that it works with
@@ -1508,6 +1709,8 @@ Register destructors for objects with static storage duration with the
This option is required for fully standards-compliant handling of static
destructors, but will only work if your C library supports
@code{__cxa_atexit}.
+@c APPLE LOCAL manual
+This option is not supported on Mac OS X.
@item -fvisibility-inlines-hidden
@opindex fvisibility-inlines-hidden
@@ -1877,6 +2080,32 @@ is not @code{nil}. This allows for more efficient entry points in the runtime
to be used. Currently, this option is only available in conjunction with
the NeXT runtime on Mac OS X 10.3 and later.
+@c APPLE LOCAL begin ObjC C++ ivars
+@item -fobjc-call-cxx-cdtors
+@opindex fobjc-call-cxx-cdtors
+For each Objective-C class, check if any of its instance variables is a
+C++ object with a non-trivial default constructor. If so, synthesize a
+special @code{- (id) .cxx_construct} instance method that will run
+non-trivial default constructors on any such instance variables, in order,
+and then return @code{self}. Similarly, check if any instance variable
+is a C++ object with a non-trivial destructor, and if so, synthesize a
+special @code{- (void) .cxx_destruct} method that will run
+all such default destructors, in reverse order.
+
+The @code{- (id) .cxx_construct} and/or @code{- (void) .cxx_destruct} methods
+thusly generated will only operate on instance variables declared in the
+current Objective-C class, and not those inherited from superclasses. It
+is the responsibility of the Objective-C runtime to invoke all such methods
+in an object's inheritance hierarchy. The @code{- (id) .cxx_construct} methods
+will be invoked by the runtime immediately after a new object
+instance is allocated; the @code{- (void) .cxx_destruct} methods will
+be invoked immediately before the runtime deallocates an object instance.
+
+As of this writing, only the NeXT runtime on Mac OS X 10.4 and later has
+support for invoking the @code{- (id) .cxx_construct} and
+@code{- (void) .cxx_destruct} methods.
+@c APPLE LOCAL end ObjC C++ ivars
+
@item -fobjc-exceptions
@opindex fobjc-exceptions
Enable syntactic support for structured exception handling in Objective-C,
@@ -2018,6 +2247,17 @@ stage of compilation is not reached, for example because an error is
found during compilation, or because the @option{-fsyntax-only} option is
being used.
+@c APPLE LOCAL begin Objective-C
+@item -Wstrict-selector-match
+@opindex Wstrict-selector-match
+Warn if multiple methods with differing argument and/or return types are
+found for a given selector when attempting to send a message using this
+selector to a receiver of type @code{id} or @code{Class}. When this flag
+is off (which is the default behavior), the compiler will omit such warnings
+if any differences found are confined to types which share the same size
+and alignment.
+@c APPLE LOCAL end Objective-C
+
@item -Wundeclared-selector
@opindex Wundeclared-selector
Warn if a @code{@@selector(@dots{})} expression referring to an
@@ -2161,6 +2401,37 @@ Inhibit all warning messages.
@opindex Wno-import
Inhibit warning messages about the use of @samp{#import}.
+@c APPLE LOCAL begin -Wno-#warnings
+@item -Wno-#warnings
+@opindex Wno-#warnings
+Inhibit warning messages issued by @samp{#warning}.
+@c APPLE LOCAL end -Wno-#warnings
+
+@c APPLE LOCAL begin -Wpragma-once 2001-08-01 --sts **
+@item -Wpragma-once
+@opindex Wpragma-once
+Warn about the use of @samp{#pragma once}. (APPLE ONLY)
+@c APPLE LOCAL end -Wpragma-once 2001-08-01 --sts **
+
+@c APPLE LOCAL begin -Wextra-tokens 2001-08-02 --sts **
+@item -Wextra-tokens
+@opindex Wextra-tokens
+Warn about extra tokens at the end of prepreprocessor directives. (APPLE ONLY)
+@c APPLE LOCAL end -Wextra-tokens 2001-08-02 --sts **
+
+@c APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts **
+@item -Wnewline-eof
+@opindex Wnewline-eof
+Warn about files missing a newline at the end of the file. (APPLE ONLY)
+@c APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts **
+
+@c APPLE LOCAL begin -Wno-altivec-long-deprecated --ilr **
+@item -Wno-altivec-long-deprecated
+@opindex Wno-altivec-long-deprecated
+Do not warn about the use of the deprecated 'long' keyword in
+AltiVec data types. (APPLE ONLY)
+@c APPLE LOCAL end -Wno-altivec-long-deprecated --ilr **
+
@item -Wchar-subscripts
@opindex Wchar-subscripts
Warn if an array subscript has type @code{char}. This is a common cause
@@ -2638,7 +2909,12 @@ that are easy to avoid (or modify to prevent the warning), even in
conjunction with macros. This also enables some language-specific
warnings described in @ref{C++ Dialect Options} and
@ref{Objective-C and Objective-C++ Dialect Options}.
+@c APPLE LOCAL begin -Wmost
+@item -Wmost
+@opindex Wmost
+This is equivalent to -Wall -Wno-parentheses. (APPLE ONLY)
@end table
+@c APPLE LOCAL end -Wmost
The following @option{-W@dots{}} options are not implied by @option{-Wall}.
Some of them warn about constructions that users generally do not
@@ -2777,6 +3053,13 @@ would check to see whether the two values have ranges that overlap; and
this is done with the relational operators, so equality comparisons are
probably mistaken.
+@c APPLE LOCAL begin -Wfour-char-constants
+@item -Wfour-char-constants
+@opindex Wfour-char-constants
+Warn about four char constants, e.g. OSType 'APPL'. This warning is
+disabled by default.
+@c APPLE LOCAL end
+
@item -Wtraditional @r{(C only)}
@opindex Wtraditional
Warn about certain constructs that behave differently in traditional and
@@ -2941,6 +3224,12 @@ converted to an unsigned type. For example, warn about the assignment
@code{x = -1} if @code{x} is unsigned. But do not warn about explicit
casts like @code{(unsigned) -1}.
+@c APPLE LOCAL begin 64bit shorten warning 3865314
+@item -Wshorten-64-to-32
+@opindex Wshorten-64-to-32
+Warn if a value is implicitly converted from a 64 bit type to a 32 bit type.
+@c APPLE LOCAL end 64bit shorten warning 3865314 */
+
@item -Wsign-compare
@opindex Wsign-compare
@cindex warning for comparison of signed and unsigned values
@@ -3031,9 +3320,13 @@ appropriate may not be detected. This option has no effect unless
@item -Wno-multichar
@opindex Wno-multichar
@opindex Wmultichar
-Do not warn if a multicharacter constant (@samp{'FOOF'}) is used.
+@c APPLE LOCAL begin -Wfour-char-constants
+Do not warn if a multicharacter constant (@samp{'FOO'}) 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.
+This flag does not control warning for a constant with four characters,
+use -Wfour-char-constants instead.
+@c APPLE LOCAL end -Wfour-char-constants
@item -Wno-deprecated-declarations
@opindex Wno-deprecated-declarations
@@ -3190,8 +3483,10 @@ debugging information that only GDB can use; this extra information
makes debugging work better in GDB but will probably make other debuggers
crash or
refuse to read the program. If you want to control for certain whether
-to generate the extra information, use @option{-gstabs+}, @option{-gstabs},
-@option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
+@c APPLE LOCAL begin prune man page
+to generate the extra information, use @option{-gstabs+} or @option{-gstabs}
+(see below).
+@c APPLE LOCAL end prune man page
GCC allows you to use @option{-g} with
@option{-O}. The shortcuts taken by optimized code may occasionally
@@ -3234,6 +3529,8 @@ using GNU extensions understood only by the GNU debugger (GDB)@. The
use of these extensions is likely to make other debuggers crash or
refuse to read the program.
+@c APPLE LOCAL prune man page
+@ignore
@item -gcoff
@opindex gcoff
Produce debugging information in COFF format (if that is supported).
@@ -3252,6 +3549,8 @@ using GNU extensions understood only by the GNU debugger (GDB)@. The
use of these extensions is likely to make other debuggers crash or
refuse to read the program, and may cause assemblers other than the GNU
assembler (GAS) to fail with an error.
+@c APPLE LOCAL prune man page
+@end ignore
@item -gdwarf-2
@opindex gdwarf-2
@@ -3261,17 +3560,27 @@ option, GCC uses features of DWARF version 3 when they are useful;
version 3 is upward compatible with version 2, but may still cause
problems for older debuggers.
+@c APPLE LOCAL begin prune man page
+(Other debug formats, such as @option{-gcoff}, are not supported in
+Darwin or Mac OS X.)
+@ignore
@item -gvms
@opindex gvms
Produce debugging information in VMS debug format (if that is
supported). This is the format used by DEBUG on VMS systems.
+@end ignore
+@c APPLE LOCAL end prune man page
@item -g@var{level}
@itemx -ggdb@var{level}
@itemx -gstabs@var{level}
+@c APPLE LOCAL prune man page
+@ignore
@itemx -gcoff@var{level}
@itemx -gxcoff@var{level}
@itemx -gvms@var{level}
+@c APPLE LOCAL prune man page
+@end ignore
Request debugging information and also use @var{level} to specify how
much information. The default level is 2.
@@ -3838,6 +4147,24 @@ appending @file{.dce} to the source file name.
Dump each function after adding mudflap instrumentation. The file name is
made by appending @file{.mudflap} to the source file name.
+@c APPLE LOCAL begin lno
+@item scev
+@opindex fdump-tree-scev
+Dump the information gathered by the scalar evolution analyzer.
+The file name is made by appending @file{.scev} to the source file name.
+
+@item ddall
+@opindex fdump-tree-ddall
+Dump all the data dependence relations.
+The file name is made by appending @file{.ddall} to the source file name.
+
+@item elck
+@opindex fdump-tree-elck
+Dump each function after performing checks elimination based on scalar
+evolution informations. The file name is made by appending
+@file{.elck} to the source file name.
+@c APPLE LOCAL end lno
+
@item sra
@opindex fdump-tree-sra
Dump each function after performing scalar replacement of aggregates. The
@@ -3874,6 +4201,13 @@ Dump each function after applying the named return value optimization on
generic trees. The file name is made by appending @file{.nrv} to the source
file name.
+@c APPLE LOCAL begin lno
+@item loop
+@opindex fdump-tree-loop
+Dump each function after applying tree-level loop optimizations. The file
+name is made by appending @file{.loop} to the source file name.
+@c APPLE LOCAL end lno
+
@item vect
@opindex fdump-tree-vect
Dump each function after applying vectorization of loops. The file name is
@@ -4138,6 +4472,12 @@ also turns on the following optimization flags:
Please note the warning under @option{-fgcse} about
invoking @option{-O2} on programs that use computed gotos.
+@c APPLE LOCAL begin optimization
+In Apple's version of GCC, @option{-fstrict-aliasing},
+@option{-freorder-blocks}, and @option{-fsched-interblock}
+are disabled by default when optimizing.
+@c APPLE LOCAL end optimization
+
@item -O3
@opindex O3
Optimize yet more. @option{-O3} turns on all optimizations specified by
@@ -4148,6 +4488,52 @@ Optimize yet more. @option{-O3} turns on all optimizations specified by
@opindex O0
Do not optimize. This is the default.
+@c APPLE LOCAL begin -fast
+@item -fast
+@opindex fast
+Optimize for maximum performance. @option{-fast} changes the overall optimization
+strategy of GCC in order to produce the fastest possible running code for PPC7450
+and G5 architectures. By default, @option{-fast} optimizes for G5. Programs
+optimized for G5 will not run on PPC7450. To optimize for PPC7450, add
+@option{-mcpu=7450} on command line.
+
+@option{-fast} currently enables the following optimization flags (for G5 and PPC7450).
+These flags may change in the future. You cannot override any of these options if you use
+@option{-fast} except by setting @option{-mcpu=7450}.
+
+To build shared libraries with @option{-fast}, specify @option{-fPIC} on command line.
+
+@gccoptlist{-O3
+-fgcse-sm
+-funroll-loops
+-fstrict-aliasing
+-fsched-interblock
+-falign-loops=16
+-falign-jumps=16
+-falign-functions=16
+-falign-jumps-max-skip=15
+-falign-loops-max-skip=15
+-malign-natural
+-ffast-math
+-freorder-blocks
+-freorder-blocks-and-partition
+-finline-floor
+-mdynamic-no-pic
+-mpowerpc-gpopt
+-force_cpusubtype_ALL
+-fstrict-aliasing
+-mtune=G5
+-mcpu=G5
+-mpowerpc64}
+
+Important notes: @option{-ffast-math} results in code that is not necessarily
+IEEE-compliant. @option{-fstrict-aliasing} is highly likely break
+non-standard-compliant programs. @option{-malign-natural} only works properly if
+the entire program is compiled with it, and none of the standard headers/libraries
+contain any code that changes alignment when this option is used.
+
+@c APPLE LOCAL end -fast
+
@item -Os
@opindex Os
Optimize for size. @option{-Os} enables all @option{-O2} optimizations that
@@ -4158,6 +4544,15 @@ optimizations designed to reduce code size.
@gccoptlist{-falign-functions -falign-jumps -falign-loops @gol
-falign-labels -freorder-blocks -freorder-blocks-and-partition -fprefetch-loop-arrays}
+@c APPLE LOCAL begin Disable string insns with -Os on Darwin (radar 3509006)
+When compiling for Apple powerPC targets, -Os disables use of the string
+instructions even though they would usually be smaller, because
+the kernel can't emulate them correctly in some rare cases.
+This behavior is not portable to any other gcc environment, and will
+not affect most programs at all. If you really want the string instructions,
+use -mstring.
+@c APPLE LOCAL end Disable string insns with -Os on Darwin (radar 3509006)
+
If you use multiple @option{-O} options, with or without level numbers,
the last such option is the one that is effective.
@end table
@@ -4697,6 +5092,12 @@ effectiveness of code motion optimizations. It also saves one jump. This flag
is enabled by default at @option{-O} and higher. It is not enabled
for @option{-Os}, since it usually increases code size.
+@c APPLE LOCAL begin lno
+@item -ftree-elim-checks
+Perform elimination of checks based on scalar evolution informations.
+This flag is disabled by default.
+@c APPLE LOCAL end lno
+
@item -ftree-loop-optimize
Perform loop optimizations on trees. This flag is enabled by default
at @option{-O} and higher.
@@ -4749,6 +5150,12 @@ optimization later. This is enabled by default at @option{-O} and higher.
@item -ftree-vectorize
Perform loop vectorization on trees.
+@c APPLE LOCAL begin optimization
+In Apple's version of GCC, @option{-fstrict-aliasing} is enabled by default
+when loop vectorization is enabled. See @option{-fstrict-aliasing} document
+for more information.
+@c APPLE LOCAL end optimization
+
@item -ftracer
@opindex ftracer
Perform tail duplication to enlarge superblock size. This transformation
@@ -5088,12 +5495,19 @@ with a single instruction, e.g., sqrt. A program that relies on
IEEE exceptions for math error handling may want to use this flag
for speed while maintaining IEEE arithmetic compatibility.
+@c APPLE LOCAL begin disable math-errno
+@ignore
This option should never be turned on by any @option{-O} option since
it can result in incorrect output for programs which depend on
an exact implementation of IEEE or ISO rules/specifications for
math functions.
The default is @option{-fmath-errno}.
+@end ignore
+(APPLE ONLY) The Darwin math libraries never set errno, so there is
+no point in having the compiler generate code that assumes they
+might. Therefore, the default is @option{-fno-math-errno} on Darwin.
+@c APPLE LOCAL end disable math-errno
@item -funsafe-math-optimizations
@opindex funsafe-math-optimizations
@@ -5748,6 +6162,15 @@ These options come into play when the compiler links object files into
an executable output file. They are meaningless if the compiler is
not doing a link step.
+@c APPLE LOCAL begin linker flags
+In addition to the options listed below, Apple's GCC also accepts and
+passes nearly all of the options defined by the linker @samp{ld} and by
+the library tool @samp{libtool}. Common options include
+@samp{-framework}, @samp{-dynamic}, @samp{-bundle},
+@samp{-flat_namespace}, and so forth. See the ld and libtool man pages
+for further details.
+@c APPLE LOCAL end linker flags
+
@table @gcctabopt
@cindex file names
@item @var{object-file-name}
@@ -5819,6 +6242,12 @@ These entries are usually resolved by entries in
libc. These entry points should be supplied through some other
mechanism when this option is specified.
+@c APPLE LOCAL begin radar 2466994 - -no-c++filt --ilr
+@item -no-c++filt
+By default all linker diagnostic output is piped through c++filt.
+This option suppresses that behavior. (APPLE ONLY)
+@c APPLE LOCAL end radar 2466994 - -no-c++filt --ilr
+
@item -nostdlib
@opindex nostdlib
Do not use the standard system startup files or libraries when linking.
@@ -5866,6 +6295,13 @@ Remove all symbol table and relocation information from the executable.
On systems that support dynamic linking, this prevents linking with the shared
libraries. On other systems, this option has no effect.
+@c APPLE LOCAL begin manual
+This option will not work on Mac OS X unless all libraries (including
+@file{libgcc.a}) have also been compiled with @option{-static}. Since
+neither a static version of libSystem.dylib nor crt0.o are provided, this
+option is not useful to most people.
+@c APPLE LOCAL end manual
+
@item -shared
@opindex shared
Produce a shared object which can then be linked with other objects to
@@ -5879,6 +6315,10 @@ libraries to link against. Failing to supply the correct flags may lead
to subtle defects. Supplying them in cases where they are not necessary
is innocuous.}
+@c APPLE LOCAL begin manual
+This option is not supported on Mac OS X.
+@c APPLE LOCAL end manual
+
@item -shared-libgcc
@itemx -static-libgcc
@opindex shared-libgcc
@@ -6642,17 +7082,27 @@ that macro, which enables you to change the defaults.
@c in Machine Dependent Options
@menu
+@c APPLE LOCAL prune man page
+@ignore
* ARC Options::
* ARM Options::
* AVR Options::
* CRIS Options::
+@c APPLE LOCAL prune man page
+@end ignore
* Darwin Options::
+@c APPLE LOCAL prune man page
+@ignore
* DEC Alpha Options::
* DEC Alpha/VMS Options::
* FRV Options::
* H8/300 Options::
* HPPA Options::
+@c APPLE LOCAL prune man page
+@end ignore
* i386 and x86-64 Options::
+@c APPLE LOCAL prune man page
+@ignore
* IA-64 Options::
* M32R/D Options::
* M680x0 Options::
@@ -6663,8 +7113,12 @@ that macro, which enables you to change the defaults.
* MN10300 Options::
* NS32K Options::
* PDP-11 Options::
+@c APPLE LOCAL prune man page
+@end ignore
* PowerPC Options::
* RS/6000 and PowerPC Options::
+@c APPLE LOCAL prune man page
+@ignore
* S/390 and zSeries Options::
* SH Options::
* SPARC Options::
@@ -6676,8 +7130,12 @@ that macro, which enables you to change the defaults.
* Xstormy16 Options::
* Xtensa Options::
* zSeries Options::
+@c APPLE LOCAL prune man page
+@end ignore
@end menu
+@c APPLE LOCAL prune man page
+@ignore
@node ARC Options
@subsection ARC Options
@cindex ARC Options
@@ -6746,7 +7204,8 @@ leaf functions. The default is @option{-mno-apcs-frame}.
@opindex mapcs
This is a synonym for @option{-mapcs-frame}.
-@ignore
+@c APPLE LOCAL We already have ignore running -- do not do this one --bowdidge
+@c @ignore
@c not currently implemented
@item -mapcs-stack-check
@opindex mapcs-stack-check
@@ -6773,7 +7232,8 @@ size if @option{-mapcs-float} is used.
@opindex mapcs-reentrant
Generate reentrant, position independent code. The default is
@option{-mno-apcs-reentrant}.
-@end ignore
+@c APPLE LOCAL We already have ignore running -- do not do this one --bowdidge
+@c @end ignore
@item -mthumb-interwork
@opindex mthumb-interwork
@@ -7239,6 +7699,8 @@ initialized data and zero-initialized data are allocated consecutively.
Like @option{-sim}, but pass linker options to locate initialized data at
0x40000000 and zero-initialized data at 0x80000000.
@end table
+@c APPLE LOCAL prune man page
+@end ignore
@node Darwin Options
@subsection Darwin Options
@@ -7333,6 +7795,32 @@ enable gdb to dynamically load @code{.o} files into already running
programs. @option{-findirect-data} and @option{-ffix-and-continue}
are provided for backwards compatibility.
+@c APPLE LOCAL KEXT
+@item -fapple-kext
+@c APPLE LOCAL KEXT indirect-virtual-calls --sts
+@itemx -findirect-virtual-calls
+@c APPLE LOCAL KEXT terminated-vtables
+@itemx -fterminated-vtables
+@c APPLE LOCAL KEXT
+@opindex fapple-kext
+@c APPLE LOCAL KEXT indirect-virtual-calls --sts
+@opindex findirect-virtual-calls
+@c APPLE LOCAL KEXT terminated-vtables
+@opindex fterminated-vtables
+@c APPLE LOCAL begin KEXT
+Alter vtables, destructors, and other implementation details to more
+closely resemble the GCC 2.95 ABI. This is to make kernel extensions
+loadable by Darwin kernels, and is required to build any Darwin kernel
+extension. In addition, virtual calls are not made directly, instead,
+code is generated to always go through the virtual table, as virtual
+tables can be patched by the kernel module loader. Vtables are
+altered by adding a zero word at the end of every vtable.
+@option{-fno-exceptions} and @option{-static} must also be used with
+this flag. @option{-findirect-virtual-calls} and
+@option{-fterminated-vtables} are accepted for backwards compatibility
+but will be removed in the future. (APPLE ONLY)
+@c APPLE LOCAL end KEXT
+
@item -all_load
@opindex all_load
Loads all members of static archive libraries.
@@ -7490,6 +7978,8 @@ These options are passed to the Darwin linker. The Darwin linker man page
describes them in detail.
@end table
+@c APPLE LOCAL prune man page
+@ignore
@node DEC Alpha Options
@subsection DEC Alpha Options
@@ -8382,6 +8872,8 @@ Add support for multithreading with the @dfn{dce thread} library
under HP-UX@. This option sets flags for both the preprocessor and
linker.
@end table
+@c APPLE LOCAL prune man page
+@end ignore
@node i386 and x86-64 Options
@subsection Intel 386 and AMD x86-64 Options
@@ -8822,6 +9314,8 @@ about addresses and sizes of sections. Currently GCC does not implement
this model.
@end table
+@c APPLE LOCAL prune man page
+@ignore
@node IA-64 Options
@subsection IA-64 Options
@cindex IA-64 Options
@@ -10242,6 +10736,8 @@ Use Unix assembler syntax. This is the default when configured for
Use DEC assembler syntax. This is the default when configured for any
PDP-11 target other than @samp{pdp11-*-bsd}.
@end table
+@c APPLE LOCAL prune man page
+@end ignore
@node PowerPC Options
@subsection PowerPC Options
@@ -10410,6 +10906,35 @@ the AltiVec instruction set. You may also need to set
@option{-mabi=altivec} to adjust the current ABI with AltiVec ABI
enhancements.
+@c APPLE LOCAL begin AltiVec
+@item -mpim-altivec
+@itemx -mno-pim-altivec
+@opindex mpim-altivec
+@opindex mno-pim-altivec
+Enable (or disable) built-in compiler support for the syntactic extensions as
+well as operations and predicates defined in the Motorola AltiVec
+Technology Programming Interface Manual (PIM). This includes the
+recognition of @code{vector} and @code{pixel} as (context-dependent)
+keywords, the definition of built-in functions such as @code{vec_add},
+and the use of parenthesized comma expression as AltiVec literals.
+Note that unlike the option @option{-maltivec}, the extension does not require
+the inclusion of any special header files; if @code{<altivec.h>} is included,
+a warning will be issued and the contents of the header will be
+ignored. The preprocessor shall provide an @code{__APPLE_ALTIVEC__}
+manifest constant when @option{-mpim-altivec} is specified. (APPLE ONLY)
+
+In addition, the @option{-mpim-altivec} option disables the inlining of
+functions containing AltiVec instructions into functions that do not make
+use of the vector unit. Certain other optimizations, such as inline
+vectorization of @code{memset} and @code{memcpy} calls, are also disabled.
+These adjustments make it possible to compile programs whose use of AltiVec
+instructions is preceded by a run-time check for the presence of AltiVec
+functionality, and that can therefore be made to run on G3 processors.
+Note that all of these optimizations may be re-enabled by supplying
+the @option{-maltivec} option, or an @option{-mcpu} option specifying
+a processor that supports AltiVec instructions.
+@c APPLE LOCAL end AltiVec
+
@item -mabi=spe
@opindex mabi=spe
Extend the current ABI with SPE ABI extensions. This does not change
@@ -10551,6 +11076,16 @@ Generate code that does not use (uses) the floating-point register set.
Software floating point emulation is provided if you use the
@option{-msoft-float} option, and pass the option to GCC when linking.
+@c APPLE LOCAL begin describe actual behavior 3888787
+(APPLE ONLY) While the -msoft-float option is supported, the libraries that
+do the floating point emulation are not shipped on Apple PowerPCs, with the
+effect that the emulation does not work. However, the option
+may be useful for a different reason. Normally the compiler can use floating
+point registers in contexts where you might not expect it, for example, to
+copy data from one memory location to another. The -msoft-float option will
+prevent it from doing this.
+@c APPLE LOCAL end describe actual behavior 3888787
+
@item -mmultiple
@itemx -mno-multiple
@opindex mmultiple
@@ -10925,6 +11460,8 @@ This option sets flags for both the preprocessor and linker.
@end table
+@c APPLE LOCAL prune man page
+@ignore
@node S/390 and zSeries Options
@subsection S/390 and zSeries Options
@cindex S/390 and zSeries Options
@@ -11929,6 +12466,8 @@ every cross-file call, not just those that really will be out of range.
@cindex zSeries options
These are listed under @xref{S/390 and zSeries Options}.
+@c APPLE LOCAL prune man page
+@end ignore
@node Code Gen Options
@section Options for Code Generation Conventions
@@ -12127,6 +12666,10 @@ only on certain machines. For the 386, GCC supports PIC for System V
but not for the Sun 386i. Code generated for the IBM RS/6000 is always
position-independent.
+@c APPLE LOCAL begin manual
+@option{-fpic} is not supported on Mac OS X.
+@c APPLE LOCAL end manual
+
@item -fPIC
@opindex fPIC
If supported for the target machine, emit position-independent code,
@@ -12137,6 +12680,10 @@ PowerPC and SPARC@.
Position-independent code requires special support, and therefore works
only on certain machines.
+@c APPLE LOCAL begin manual
+@option{-fPIC} is the default on Darwin and Mac OS X.
+@c APPLE LOCAL end manual
+
@item -fpie
@itemx -fPIE
@opindex fpie
diff --git a/gcc/doc/trouble.texi b/gcc/doc/trouble.texi
index 01c0c192d59..1cfc212f5ed 100644
--- a/gcc/doc/trouble.texi
+++ b/gcc/doc/trouble.texi
@@ -275,15 +275,19 @@ string its argument points to.
@cindex @code{sscanf}, and constant strings
@cindex @code{fscanf}, and constant strings
@cindex @code{scanf}, and constant strings
-Another consequence is that @code{sscanf} does not work on some very
-old systems when passed a string constant as its format control string
-or input. This is because @code{sscanf} incorrectly tries to write
-into the string constant. Likewise @code{fscanf} and @code{scanf}.
-
-The solution to these problems is to change the program to use
+@c APPLE LOCAL begin fwritable strings.
+Another consequence is that @code{sscanf} does not work on some systems
+when passed a string constant as its format control string or input.
+This is because @code{sscanf} incorrectly tries to write into the string
+constant. Likewise @code{fscanf} and @code{scanf}.
+
+@opindex fwritable-strings
+The best solution to these problems is to change the program to use
@code{char}-array variables with initialization strings for these
-purposes instead of string constants.
-
+purposes instead of string constants. But if this is not possible,
+you can use the @option{-fwritable-strings} flag, which directs GCC
+to handle string constants the same way most C compilers do.
+@c APPLE LOCAL end fwritable strings.
@item
@code{-2147483648} is positive.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 49bca54c951..6eacae8fad0 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -1703,8 +1703,103 @@ dwarf2out_frame_debug_expr (rtx expr, const char *label)
{
int regno;
- gcc_assert (GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT);
- offset = INTVAL (XEXP (XEXP (dest, 0), 1));
+ /* APPLE LOCAL begin 'reg + index' case. */
+ offset = 0x696b6c6c;
+
+ if (GET_CODE (XEXP (XEXP (dest, 0), 1)) == CONST_INT)
+ offset = INTVAL (XEXP (XEXP (dest, 0), 1));
+ /* If it's a 'reg + index', we need to find out what value
+ the index reg has at this point. (This can happen
+ because some architectures have registers which can
+ only be stored using a "reg + index" mode.)
+
+ This method of finding out the index value is VERY
+ FRAGILE. Ideally we'd try to add a note to the save
+ insn, but... */
+ else if (GET_CODE (XEXP (XEXP (dest, 0), 1)) == REG)
+ {
+ unsigned the_reg = REGNO (XEXP (XEXP (dest, 0), 1));
+ rtx insn;
+
+ /* The REG_FRAME_RELATED_EXPR can sometimes be
+ out-of-date after the optimiser/inliner has done
+ its stuff. For example,
+
+ (insn: (set (mem:V16QI (plus:SI (reg/f:SI 1 r1)
+ (reg:SI 6 r6)) [0 S16 A8])
+ (reg:V16QI 108 v31))
+ ...
+ (expr_list:REG_FRAME_RELATED_EXPR
+ (set (mem:V16QI (plus:SI (reg/f:SI 1 r1)
+ (reg:SI 0 r0)) [0 S16 A8])
+ (reg:V16QI 108 v31))
+
+ Note that the optimiser has used R6 instead of the original
+ R0 to store the SP offset. Alas, we blindly look for R0
+ here, since DEST is the REG_FRAME_RELATED_EXPR, so we need
+ to check for that.
+
+ This needs a rework from scratch, but it'll do for now. */
+
+ insn = XEXP (XEXP (XEXP (PATTERN (current_output_insn),
+ 0), 0), 1);
+ if (GET_CODE (insn) == REG)
+ the_reg = REGNO (insn);
+
+ insn = PREV_INSN (current_output_insn);
+ for (; insn != NULL; insn = PREV_INSN (insn))
+ {
+ if (GET_CODE (insn) != INSN
+ || PATTERN (insn) == NULL)
+ ;
+ else if (GET_CODE (PATTERN (insn)) == SET)
+ {
+ rtx p = PATTERN (insn);
+ if (SET_DEST (p) != NULL
+ && GET_CODE (SET_DEST (p)) == REG
+ && REGNO (SET_DEST (p)) == the_reg)
+ {
+ if (GET_CODE (SET_SRC (p)) == CONST_INT)
+ {
+ offset = INTVAL (SET_SRC (p));
+ break;
+ }
+ else
+ abort ();
+ }
+ }
+ else
+ /* A label? All bets are off. */
+ if (GET_CODE (PATTERN (insn)) == CODE_LABEL)
+ abort ();
+ }
+
+ /* DEST can also be something like:
+
+ (mem:V16QI (plus:SI (plus:SI (reg/f:SI 1 r1)
+ (const_int 147792 [0x24150]))
+ (reg:SI 0 r0)) [0 S16 A8])
+
+ This is handled here by adjusting the offset appropriately. */
+
+ insn = XEXP (XEXP (dest, 0), 0);
+ if (GET_CODE (insn) == PLUS && GET_CODE (XEXP (insn, 0)) == REG
+ && GET_CODE (XEXP (insn, 1)) == CONST_INT)
+ {
+ gcc_assert (offset != 0x696b6c6c);
+ offset += INTVAL (XEXP (insn, 1));
+
+ /* Set DEST to be the inner PLUS so that
+ REGNO (XEXP (XEXP (dest, 0), 0) will be sensible. */
+
+ dest = XEXP (dest, 0);
+ }
+ }
+ else
+ abort ();
+ gcc_assert (offset != 0x696b6c6c);
+ /* APPLE LOCAL end 'reg + index' case. */
+
if (GET_CODE (XEXP (dest, 0)) == MINUS)
offset = -offset;
diff --git a/gcc/explow.c b/gcc/explow.c
index c1cd34cddc8..060fe063846 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -580,7 +580,22 @@ copy_to_mode_reg (enum machine_mode mode, rtx x)
gcc_assert (GET_MODE (x) == mode || GET_MODE (x) == VOIDmode);
if (x != temp)
+ /* APPLE LOCAL begin Don't assign PARALLEL pattern to psuedo register */
+ {
+ tree exp = (current_function_decl != NULL_TREE) ?
+ DECL_RESULT (current_function_decl) : NULL_TREE;
+ if (exp != NULL_TREE && DECL_RTL_IF_SET (exp) == x
+ && GET_CODE (x) == PARALLEL)
+ {
+ tree type = TREE_TYPE (exp);
+ rtx memloc = assign_temp (type, 1, 1, 1);
+ memloc = validize_mem (memloc);
+ emit_group_store (memloc, x, type, int_size_in_bytes (type));
+ x = memloc;
+ }
emit_move_insn (temp, x);
+ }
+ /* APPLE LOCAL end Don't assign PARALLEL pattern to psuedo register */
return temp;
}
diff --git a/gcc/expmed.c b/gcc/expmed.c
index 49b1faa77cf..d658d26a4ab 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -669,7 +669,15 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
/* Fetch that unit, store the bitfield in it, then store
the unit. */
tempreg = copy_to_reg (op0);
- store_bit_field (tempreg, bitsize, bitpos, fieldmode, orig_value);
+ /* APPLE LOCAL begin do not use float fieldmode */
+ /* If value was float, we munged it to be int above, so it
+ is never appropriate to use a float fieldmode here. */
+ store_bit_field (tempreg, bitsize, bitpos,
+ (GET_MODE_CLASS (fieldmode) != MODE_INT
+ && GET_MODE_CLASS (fieldmode) != MODE_PARTIAL_INT)
+ ? GET_MODE (orig_value) : fieldmode,
+ orig_value);
+ /* APPLE LOCAL end do not use float fieldmode */
emit_move_insn (op0, tempreg);
return value;
}
diff --git a/gcc/flags.h b/gcc/flags.h
index 695d6228f65..a6f7d815f1d 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -143,12 +143,26 @@ extern int flag_short_enums;
extern int flag_pcc_struct_return;
+/* APPLE LOCAL begin fwritable-strings */
+/* Nonzero for -fwritable-strings:
+ store string constants in data segment and don't uniquize them. */
+
+extern int flag_writable_strings;
+/* APPLE LOCAL end fwritable-strings */
+
/* 0 means straightforward implementation of complex divide acceptable.
1 means wide ranges of inputs must work for complex divide.
2 means C99-like requirements for complex multiply and divide. */
extern int flag_complex_method;
+/* APPLE LOCAL begin -fobey-inline */
+/* Nonzero for -fobey-inline: 'inline' keyword must be obeyed, regardless
+ of codesize. */
+
+extern int flag_obey_inline;
+/* APPLE LOCAL end -fobey-inline */
+
/* Nonzero means that we don't want inlining by virtue of -fno-inline,
not just because the tree inliner turned us off. */
@@ -288,4 +302,33 @@ extern const char *flag_random_seed;
#define HONOR_SIGN_DEPENDENT_ROUNDING(MODE) \
(MODE_HAS_SIGN_DEPENDENT_ROUNDING (MODE) && flag_rounding_math)
+/* APPLE LOCAL begin -fast or -fastf or -fastcp */
+/* Nonzero if we should perform SPEC oriented optimizations for C. */
+extern int flag_fast;
+/* Nonzero if we should perform SPEC oriented optimizations for C that is
+ produced by the NAG Fortan-to-C translator. */
+extern int flag_fastf;
+/* Nonzero if we should perform SPEC oriented optimizations for C++. */
+extern int flag_fastcp;
+/* APPLE LOCAL end -fast or -fastf or -fastcp */
+
+/* APPLE LOCAL begin gdb only used symbols */
+#ifdef DBX_ONLY_USED_SYMBOLS
+/* Nonzero if generating debugger info for used symbols only. */
+extern int flag_debug_only_used_symbols;
+#endif
+/* APPLE LOCAL end gdb only used symbols */
+
+/* APPLE LOCAL begin predictive compilation */
+extern int predictive_compilation;
+/* APPLE LOCAL end predictive compilation */
+
+/* APPLE LOCAL begin disable_typechecking_for_spec_flag */
+extern int disable_typechecking_for_spec_flag;
+/* APPLE LOCAL end disable_typechecking_for_spec_flag */
+
+/* APPLE LOCAL begin Altivec */
+extern int flag_disable_opts_for_faltivec;
+/* APPLE LOCAL end Altivec */
+
#endif /* ! GCC_FLAGS_H */
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index ef31a32f54e..ffaaf2237a6 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -6484,7 +6484,8 @@ static
tree
fold (tree expr)
{
- const tree t = expr;
+ /* APPLE LOCAL altivec */
+ tree t = expr;
const tree type = TREE_TYPE (expr);
tree t1 = NULL_TREE;
tree tem;
@@ -6496,6 +6497,15 @@ fold (tree expr)
if all operands are constant. */
int wins = 1;
+ /* APPLE LOCAL begin AltiVec */
+ /* Fold constant comma expressions. */
+ while (TREE_CODE (t) == COMPOUND_EXPR && TREE_CONSTANT (t))
+ t = TREE_OPERAND (t, 1);
+
+ code = TREE_CODE (t);
+ kind = TREE_CODE_CLASS (code);
+ /* APPLE LOCAL end AltiVec */
+
/* Return right away if a constant. */
if (kind == tcc_constant)
return t;
diff --git a/gcc/fortran/ChangeLog.lno b/gcc/fortran/ChangeLog.lno
new file mode 100644
index 00000000000..32ad9683ae5
--- /dev/null
+++ b/gcc/fortran/ChangeLog.lno
@@ -0,0 +1,2 @@
+ * f95-lang.c (gfc_init_builtin_functions): Init
+ BUILT_IN_MAYBE_INFINITE_LOOP builtin.
diff --git a/gcc/fortran/f95-lang.c b/gcc/fortran/f95-lang.c
index 7f04b7ca261..4f3b4e1543d 100644
--- a/gcc/fortran/f95-lang.c
+++ b/gcc/fortran/f95-lang.c
@@ -145,6 +145,22 @@ static void gfc_expand_function (tree);
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+/* APPLE LOCAL begin constant cfstrings */
+enum { blabla } c_language;
+const char *constant_string_class_name = "die die";
+int flag_next_runtime = 1;
+/* APPLE LOCAL end constant cfstrings */
+
+/* APPLE LOCAL disable_typechecking_for_spec_flag */
+int disable_typechecking_for_spec_flag = 0;
+
+/* APPLE LOCAL begin CW asm blocks */
+/* Dummies needed because we use them from cpplib, yuck. */
+int flag_cw_asm_blocks;
+int cw_asm_state;
+int cw_asm_in_operands;
+/* APPLE LOCAL end CW asm blocks */
+
/* A list (chain of TREE_LIST nodes) of all LABEL_DECLs in the function
that have names. Here so we can clear out their names' definitions
at the end of the function. */
@@ -828,6 +844,12 @@ gfc_init_builtin_functions (void)
ftype = build_function_type (long_integer_type_node, tmp);
gfc_define_builtin ("__builtin_expect", ftype, BUILT_IN_EXPECT,
"__builtin_expect", true);
+ /* APPLE LOCAL begin lno */
+ ftype = build_function_type (void_type_node, void_list_node);
+ gfc_define_builtin ("__builtin_maybe_infinite_loop", ftype,
+ BUILT_IN_MAYBE_INFINITE_LOOP, "maybe_infinite_loop",
+ false);
+ /* APPLE LOCAL end lno */
build_common_builtin_nodes ();
targetm.init_builtins ();
diff --git a/gcc/function.c b/gcc/function.c
index c4656e53587..432232db62f 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -501,6 +501,23 @@ assign_stack_local (enum machine_mode mode, HOST_WIDE_INT size, int align)
return assign_stack_local_1 (mode, size, align, cfun);
}
+/* APPLE LOCAL begin new function for rs6000 consumption */
+/* Wrapper around assign_stack_local_1; assign a local stack slot for the
+ current function, then set the mem_alias to a new alias set.
+ This can be used only in situations where the target code can
+ guarantee that the slot is used in a way that cannot conflict
+ with anything else. */
+
+rtx
+assign_stack_local_with_alias (enum machine_mode mode, HOST_WIDE_INT size,
+ int align)
+{
+ rtx mem = assign_stack_local_1 (mode, size, align, cfun);
+ set_mem_alias_set (mem, new_alias_set ());
+ return mem;
+}
+/* APPLE LOCAL end new function for rs6000 consumption */
+
/* Removes temporary slot TEMP from LIST. */
@@ -3056,6 +3073,8 @@ assign_parms (tree fndecl)
tree fnargs, parm;
rtx internal_arg_pointer;
int varargs_setup = 0;
+ /* APPLE LOCAL AltiVec */
+ int pass, last_pass;
/* If the reg that the virtual arg pointer will be translated into is
not a fixed reg or is the stack pointer, make a copy of the virtual
@@ -3075,58 +3094,71 @@ assign_parms (tree fndecl)
assign_parms_initialize_all (&all);
fnargs = assign_parms_augmented_arg_list (&all);
- for (parm = fnargs; parm; parm = TREE_CHAIN (parm))
+ /* APPLE LOCAL begin AltiVec */
+ last_pass = 1;
+
+ for (pass = 1; pass <= last_pass; pass++)
{
- struct assign_parm_data_one data;
+ for (parm = fnargs; parm; parm = TREE_CHAIN (parm))
+ {
+ struct assign_parm_data_one data;
- /* Extract the type of PARM; adjust it according to ABI. */
- assign_parm_find_data_types (&all, parm, &data);
+ tree type = TREE_TYPE (parm);
+ /* In 1st iteration over actual arguments, only consider non-vectors.
+ During 2nd iteration, finish off with vector parameters. */
+ if (!current_function_stdarg && targetm.calls.skip_vec_args (type, pass, &last_pass))
+ continue;
- /* Early out for errors and void parameters. */
- if (data.passed_mode == VOIDmode)
- {
- SET_DECL_RTL (parm, const0_rtx);
- DECL_INCOMING_RTL (parm) = DECL_RTL (parm);
- continue;
- }
+ /* Extract the type of PARM; adjust it according to ABI. */
+ assign_parm_find_data_types (&all, parm, &data);
- /* Handle stdargs. LAST_NAMED is a slight mis-nomer; it's also true
- for the unnamed dummy argument following the last named argument.
- See ABI silliness wrt strict_argument_naming and NAMED_ARG. So
- we only want to do this when we get to the actual last named
- argument, which will be the first time LAST_NAMED gets set. */
- if (data.last_named && !varargs_setup)
- {
- varargs_setup = true;
- assign_parms_setup_varargs (&all, &data, false);
- }
+ /* Early out for errors and void parameters. */
+ if (data.passed_mode == VOIDmode)
+ {
+ SET_DECL_RTL (parm, const0_rtx);
+ DECL_INCOMING_RTL (parm) = DECL_RTL (parm);
+ continue;
+ }
- /* Find out where the parameter arrives in this function. */
- assign_parm_find_entry_rtl (&all, &data);
+ /* Handle stdargs. LAST_NAMED is a slight mis-nomer; it's also true
+ for the unnamed dummy argument following the last named argument.
+ See ABI silliness wrt strict_argument_naming and NAMED_ARG. So
+ we only want to do this when we get to the actual last named
+ argument, which will be the first time LAST_NAMED gets set. */
+ if (data.last_named && !varargs_setup)
+ {
+ varargs_setup = true;
+ assign_parms_setup_varargs (&all, &data, false);
+ }
- /* Find out where stack space for this parameter might be. */
- if (assign_parm_is_stack_parm (&all, &data))
- {
- assign_parm_find_stack_rtl (parm, &data);
- assign_parm_adjust_entry_rtl (&data);
- }
+ /* Find out where the parameter arrives in this function. */
+ assign_parm_find_entry_rtl (&all, &data);
- /* Record permanently how this parm was passed. */
- set_decl_incoming_rtl (parm, data.entry_parm);
+ /* Find out where stack space for this parameter might be. */
+ if (assign_parm_is_stack_parm (&all, &data))
+ {
+ assign_parm_find_stack_rtl (parm, &data);
+ assign_parm_adjust_entry_rtl (&data);
+ }
- /* Update info on where next arg arrives in registers. */
- FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
- data.passed_type, data.named_arg);
+ /* Record permanently how this parm was passed. */
+ set_decl_incoming_rtl (parm, data.entry_parm);
- assign_parm_adjust_stack_rtl (&data);
+ /* Update info on where next arg arrives in registers. */
+ FUNCTION_ARG_ADVANCE (all.args_so_far, data.promoted_mode,
+ data.passed_type, data.named_arg);
- if (assign_parm_setup_block_p (&data))
- assign_parm_setup_block (&all, parm, &data);
- else if (data.passed_pointer || use_register_for_decl (parm))
- assign_parm_setup_reg (&all, parm, &data);
- else
- assign_parm_setup_stack (&all, parm, &data);
+ assign_parm_adjust_stack_rtl (&data);
+
+ if (assign_parm_setup_block_p (&data))
+ assign_parm_setup_block (&all, parm, &data);
+ else if (data.passed_pointer || use_register_for_decl (parm))
+ assign_parm_setup_reg (&all, parm, &data);
+ else
+ assign_parm_setup_stack (&all, parm, &data);
+ }
}
+ /* APPLE LOCAL end AltiVec */
if (targetm.calls.split_complex_arg && fnargs != all.orig_fnargs)
assign_parms_unsplit_complex (&all, fnargs);
@@ -3160,6 +3192,8 @@ assign_parms (tree fndecl)
current_function_pretend_args_size = all.pretend_args_size;
all.stack_args_size.constant += all.extra_pretend_bytes;
current_function_args_size = all.stack_args_size.constant;
+ /* APPLE LOCAL sibcall optimization stomped CW frames (radar 3007352) */
+ cfun->unrounded_args_size = all.stack_args_size.constant;
/* Adjust function incoming argument size for alignment and
minimum length. */
diff --git a/gcc/function.h b/gcc/function.h
index f760075c638..19f44853ef8 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -249,6 +249,15 @@ struct function GTY(())
needed by inner routines. */
rtx x_arg_pointer_save_area;
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Nonzero if this is an all-assembly function. */
+ unsigned int cw_asm_function : 1;
+ /* Nonzero if we don't want to emit any return instructions. */
+ unsigned int cw_asm_noreturn : 1;
+ /* If nonzero, use this as the explicitly-defined frame size. */
+ int cw_asm_frame_size;
+ /* APPLE LOCAL end CW asm blocks */
+
/* Offset to end of allocated area of stack frame.
If stack grows down, this is the address of the last stack slot allocated.
If stack grows up, this is the address for the next slot. */
@@ -329,6 +338,10 @@ struct function GTY(())
final flowgraph size. */
int max_jumptable_ents;
+ /* APPLE LOCAL begin sibcall optimization stomped CW frames (radar 3007352) */
+ int unrounded_args_size;
+ /* APPLE LOCAL end sibcall optimization stomped CW frames (radar 3007352) */
+
/* UIDs for LABEL_DECLs. */
int last_label_uid;
@@ -422,6 +435,15 @@ struct function GTY(())
/* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
unsigned int arg_pointer_save_area_init : 1;
+
+ /* APPLE LOCAL begin lno */
+ /* Nonzero if the loops that are possibly infinite are marked. */
+ unsigned int marked_maybe_inf_loops : 1;
+ /* APPLE LOCAL end lno */
+
+ /* APPLE LOCAL begin 3837835 */
+ unsigned int uses_vector : 1;
+ /* APPLE LOCAL end 3837835 */
};
/* The function currently being compiled. */
diff --git a/gcc/gcc.c b/gcc/gcc.c
index a9eec5a7200..d70e4dff9bd 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -240,6 +240,35 @@ static const char *const spec_version = DEFAULT_TARGET_VERSION;
static const char *spec_machine = DEFAULT_TARGET_MACHINE;
+/* APPLE LOCAL begin CC_PRINT_OPTIONS (radar 3313335) */
+static char *cc_print_options = 0;
+static char *cc_print_options_filename;
+/* APPLE LOCAL end CC_PRINT_OPTIONS */
+
+/* APPLE LOCAL constant cfstrings */
+static int use_constant_cfstrings = 0;
+/* APPLE LOCAL begin deployment target */
+/* The deployment target (i.e., the minimum version of MacOS X that
+ the binary is expected to be used on). */
+static const char *macosx_deployment_target = 0;
+static unsigned int macosx_version_min_required = 0;
+
+/* The following table should be NULL-terminated and kept in
+ lexicographic order. */
+
+static struct macosx_vers {
+ const char *vers_str;
+ unsigned int vers_num;
+} macosx_vers_tbl[] = {
+ { "10.0", 1000 },
+ { "10.1", 1010 },
+ { "10.2", 1020 },
+ { "10.3", 1030 },
+ { "10.4", 1040 },
+ { NULL, 0 }
+};
+/* APPLE LOCAL end deployment target */
+
/* Nonzero if cross-compiling.
When -b is used, the value comes from the `specs' file. */
@@ -325,6 +354,8 @@ static const char *eval_spec_function (const char *, const char *);
static const char *handle_spec_function (const char *);
static char *save_string (const char *, int);
static void set_collect_gcc_options (void);
+/* APPLE LOCAL %b/save-temps can clobber input file (radar 2871891) --ilr */
+static const char *check_basename_derived_file (const char *string);
static void do_spec_path (struct prefix_list *, const char *, int, int, int, const char *, const char *);
static int do_spec_1 (const char *, int, const char *);
static int do_spec_2 (const char *);
@@ -453,6 +484,10 @@ or with constant text in a single argument.
%I Substitute any of -iprefix (made from GCC_EXEC_PREFIX), -isysroot
(made from TARGET_SYSTEM_ROOT), and -isystem (made from COMPILER_PATH
and -B options) as necessary.
+ APPLE LOCAL frameworks
+ %Q Substitute -iframework default paths.
+ APPLE LOCAL constant cfstrings
+ %yC Emit '-mconstant-cfstrings' option, if needed.
%s current argument is the name of a library or startup file of some sort.
Search for that file in a standard list of directories
and substitute the full name found.
@@ -696,16 +731,18 @@ proper position among the other output files. */
/* 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. */
+/* APPLE LOCAL begin add fcreate-profile */
#ifndef LINK_COMMAND_SPEC
#define LINK_COMMAND_SPEC "\
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
%{static:} %{L*} %(mfwrap) %(link_libgcc) %o %(mflib)\
- %{fprofile-arcs|fprofile-generate:-lgcov}\
+ %{fprofile-arcs|fprofile-generate|fcreate-profile:-lgcov}\
%{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif
+/* APPLE LOCAL end add fcreate-profile */
#ifndef LINK_LIBGCC_SPEC
# ifdef LINK_LIBGCC_SPECIAL
@@ -763,10 +800,18 @@ static const char *sysroot_hdrs_suffix_spec = SYSROOT_HEADERS_SUFFIX_SPEC;
static const char *trad_capable_cpp =
"cc1 -E %{traditional|ftraditional|traditional-cpp:-traditional-cpp}";
+/* APPLE LOCAL begin pch */
+/* When making PCH file use this. */
+static const char *pch =
+"-o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V";
+/* APPLE LOCAL end pch */
+
/* We don't wrap .d files in %W{} since a missing .d file, and
therefore no dependency entry, confuses make into thinking a .o
file that happens to exist is up-to-date. */
static const char *cpp_unique_options =
+/* APPLE LOCAL constant cfstrings */
+"%yC"
"%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}}\
%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I\
%{MD:-MD %{!o:%b.d}%{o*:%.d%*}}\
@@ -794,6 +839,13 @@ static const char *cpp_debug_options = "%{d*}";
/* NB: This is shared amongst all front-ends. */
static const char *cc1_options =
+/* APPLE LOCAL constant cfstrings */
+"%yC"
+/* APPLE LOCAL begin -fast */
+"%{fast:-O3}\
+ %{fastf:-O3}\
+ %{fastcp:-O3}"
+/* APPLE LOCAL end -fast */
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
%1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}%{!c:%{!S:-auxbase %b}}\
@@ -942,24 +994,28 @@ static const struct compiler default_compilers[] =
{"@c",
/* cc1 has an integrated ISO C preprocessor. We should invoke the
external preprocessor if -save-temps is given. */
+ /* APPLE LOCAL begin treat -fast same as -combine --dbj */
"%{E|M|MM:%(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)}\
+ "/* APPLE LOCAL cpp-precomp compatibility */"\
+ %{precomp:%ecpp-precomp not supported}%{no-cpp-precomp:}%{Wno-precomp:}\
%{!E:%{!M:%{!MM:\
%{traditional|ftraditional:\
%eGNU C no longer supports -traditional without -E}\
- %{!combine:\
+ %{combine|fast|fastf|fastcp:\
+ %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
+ %(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i}}\
+ %{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
+ cc1 %(cpp_unique_options) %(cc1_options)}}\
+ %{!fsyntax-only:%(invoke_as)}};:\
%{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\
- cc1 -fpreprocessed %{save-temps:%b.i} %{!save-temps:%g.i} \
+"/* APPLE LOCAL predictive compilation */"\
+ cc1 -fpreprocessed %<fpredictive-compilation* %{save-temps:%b.i} %{!save-temps:%g.i} \
%(cc1_options)}\
%{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
cc1 %(cpp_unique_options) %(cc1_options)}}}\
- %{!fsyntax-only:%(invoke_as)}} \
- %{combine:\
- %{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
- %(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i}}\
- %{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
- cc1 %(cpp_unique_options) %(cc1_options)}}\
- %{!fsyntax-only:%(invoke_as)}}}}}}", 0, 1, 1},
+ %{!fsyntax-only:%(invoke_as)}}}}}", 0, 1, 1},
+ /* APPLE LOCAL end treat -fast same as -combine --dbj */
{"-",
"%{!E:%e-E required when input is from standard input}\
%(trad_capable_cpp) %(cpp_options) %(cpp_debug_options)", 0, 0, 0},
@@ -971,18 +1027,28 @@ static const struct compiler default_compilers[] =
%{!E:%{!M:%{!MM:\
%{save-temps|traditional-cpp|no-integrated-cpp:%(trad_capable_cpp) \
%(cpp_options) -o %{save-temps:%b.i} %{!save-temps:%g.i} \n\
- cc1 -fpreprocessed %{save-temps:%b.i} %{!save-temps:%g.i} \
+"/* APPLE LOCAL predictive compilation */"\
+ cc1 -fpreprocessed %<fpredictive-compilation* %{save-temps:%b.i} %{!save-temps:%g.i} \
%(cc1_options)\
- -o %g.s %{!o*:--output-pch=%i.gch}\
- %W{o*:--output-pch=%*}%V}\
+"/* APPLE LOCAL pch */"\
+ %(pch)}\
%{!save-temps:%{!traditional-cpp:%{!no-integrated-cpp:\
cc1 %(cpp_unique_options) %(cc1_options)\
- -o %g.s %{!o*:--output-pch=%i.gch}\
- %W{o*:--output-pch=%*}%V}}}}}}", 0, 0, 0},
+"/* APPLE LOCAL pch */"\
+ %(pch)}}}}}}", 0, 0, 0},
{".i", "@cpp-output", 0, 1, 0},
{"@cpp-output",
- "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
- {".s", "@assembler", 0, 1, 0},
+ /* APPLE LOCAL predictive compilation */
+ "%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %<fpredictive-compilation* %{!fsyntax-only:%(invoke_as)}}}}", 0, 1, 0},
+ /* APPLE LOCAL begin preprocess .s files 2001-07-24 --sts */
+ /* This is kind of lame; the purpose of having .s and .S be treated
+ differently is so that we can control whether to run the
+ preprocessor on assembly files. The standard behavior would
+ still work even on HFS filesystems, because they preserve case,
+ but we'd have to get a number of projects to change their files,
+ and of course that's just *too* *hard*. */
+ {".s", "@assembler-with-cpp", 0, 1, 0},
+ /* APPLE LOCAL end preprocess .s files 2001-07-24 --sts */
{"@assembler",
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0, 1, 0},
{".S", "@assembler-with-cpp", 0, 1, 0},
@@ -1009,6 +1075,12 @@ static const struct compiler default_compilers[] =
static const int n_default_compilers = ARRAY_SIZE (default_compilers) - 1;
+/* APPLE LOCAL begin -ObjC 2001-08-03 --sts */
+/* -ObjC is not the same as -x objective-c, since it only affects the
+ expectation of the language in files already thought to be source
+ code. */
+static const char *default_language;
+/* APPLE LOCAL end -ObjC 2001-08-03 --sts */
/* A vector of options to give to the linker.
These options are accumulated by %x,
and substituted into the linker command with %X. */
@@ -1524,6 +1596,8 @@ static struct spec_list static_specs[] =
INIT_STATIC_SPEC ("cpp_debug_options", &cpp_debug_options),
INIT_STATIC_SPEC ("cpp_unique_options", &cpp_unique_options),
INIT_STATIC_SPEC ("trad_capable_cpp", &trad_capable_cpp),
+ /* APPLE LOCAL pch */
+ INIT_STATIC_SPEC ("pch", &pch),
INIT_STATIC_SPEC ("cc1", &cc1_spec),
INIT_STATIC_SPEC ("cc1_options", &cc1_options),
INIT_STATIC_SPEC ("cc1plus", &cc1plus_spec),
@@ -2717,7 +2791,8 @@ execute (void)
/* If -v, print what we are about to do, and maybe query. */
- if (verbose_flag)
+ /* APPLE LOCAL begin CC_PRINT_OPTIONS (radar 3313335, 3360444) */
+ if (verbose_flag || cc_print_options)
{
/* For help listings, put a blank line between sub-processes. */
if (print_help_list)
@@ -2728,29 +2803,49 @@ execute (void)
{
const char *const *j;
- if (verbose_only_flag)
+ FILE *f = stderr;
+ if (cc_print_options)
+ {
+ if (cc_print_options_filename)
+ {
+ f = fopen (cc_print_options_filename, "a");
+ if (!f)
+ {
+ fprintf (stderr, "can not open CC_PRINT_OPTIONS_FILE %s\n",
+ cc_print_options_filename);
+ exit (1);
+ }
+ }
+ fprintf (f, "[Logging gcc options]");
+ }
+
+ if (verbose_only_flag || cc_print_options)
{
for (j = commands[i].argv; *j; j++)
{
const char *p;
- fprintf (stderr, " \"");
+ fprintf (f, " \"");
for (p = *j; *p; ++p)
{
if (*p == '"' || *p == '\\' || *p == '$')
- fputc ('\\', stderr);
- fputc (*p, stderr);
+ fputc ('\\', f);
+ fputc (*p, f);
}
- fputc ('"', stderr);
+ fputc ('"', f);
}
}
else
for (j = commands[i].argv; *j; j++)
- fprintf (stderr, " %s", *j);
+ fprintf (f, " %s", *j);
/* Print a pipe symbol after all but the last command. */
if (i + 1 != n_commands)
- fprintf (stderr, " |");
- fprintf (stderr, "\n");
+ fprintf (f, " |");
+ fprintf (f, "\n");
+
+ if (cc_print_options_filename)
+ fclose (f);
+/* APPLE LOCAL end CC_PRINT_OPTIONS */
}
fflush (stderr);
if (verbose_only_flag != 0)
@@ -2809,6 +2904,17 @@ execute (void)
char *errmsg_fmt, *errmsg_arg;
const char *string = commands[i].argv[0];
+ /* APPLE LOCAL begin verbose help (radar #2920964) */
+ if (verbose_flag && print_help_list
+ && (!strcmp ("/usr/libexec/gcc/darwin/ppc/as", string)
+ || !strcmp ("/usr/libexec/gcc/darwin/i386/as", string)
+ || !strcmp ("ld", string)))
+ {
+ /* Do nothing.
+ as and ld do not entertain --help. */
+ }
+ else
+ /* APPLE LOCAL end */
/* For some bizarre reason, the second argument of execvp() is
char *const *, not const char *const *. */
commands[i].pid = pexecute (string, (char *const *) commands[i].argv,
@@ -2848,6 +2954,16 @@ execute (void)
int status;
int pid;
+ /* APPLE LOCAL begin verbose help (radar #2920964) */
+ if (verbose_flag && print_help_list
+ && (!strcmp ("as", commands[i].prog)
+ || !strcmp ("ld", commands[i].prog)))
+ {
+ /* as and ld do not entertain --help. */
+ i++;
+ continue;
+ }
+ /* APPLE LOCAL end */
pid = pwait (commands[i].pid, &status, 0);
gcc_assert (pid >= 0);
@@ -2951,9 +3067,14 @@ struct infile
{
const char *name;
const char *language;
+ /* APPLE LOCAL begin IMI */
struct compiler *incompiler;
+
+ /* Use separate temp file for each input file. */
+ const char *temp_filename;
bool compiled;
bool preprocessed;
+ /* APPLE LOCAL end IMI */
};
/* Also a vector of input files specified. */
@@ -2967,6 +3088,15 @@ int n_infiles;
static bool combine_inputs;
+/* APPLE LOCAL begin IMA variables */
+
+/* True if "-traditional-cpp" appears on commandline. */
+static int traditional_cpp_flag = 0;
+
+/* True if "-E" appears on commandline. */
+static int capital_e_flag = 0;
+/* APPLE LOCAL end */
+
/* This counts the number of libraries added by lang_specific_driver, so that
we can tell if there were any user supplied any files or libraries. */
@@ -3174,6 +3304,13 @@ process_command (int argc, const char **argv)
}
}
+ /* APPLE LOCAL begin translate_options */
+ /* FSF patch pending. Move translate_options() call before -b processing
+ so that -bundle like options can be translated, if required. */
+ /* Convert new-style -- options to old-style. */
+ translate_options (&argc, (const char *const **) &argv);
+ /* APPLE LOCAL end */
+
/* If there is a -V or -b option (or both), process it now, before
trying to interpret the rest of the command line. */
if (argc > 1 && argv[1][0] == '-'
@@ -3376,6 +3513,24 @@ process_command (int argc, const char **argv)
}
}
+ /* APPLE LOCAL begin deployment target */
+ /* Retrieve the deployment target from the environment, and then decide
+ whether to enable '-fconstant-cfstrings' by default. */
+ macosx_deployment_target = getenv ("MACOSX_DEPLOYMENT_TARGET");
+ if (macosx_deployment_target)
+ {
+ struct macosx_vers *v = macosx_vers_tbl;
+
+ while (v->vers_str && strcmp (macosx_deployment_target, v->vers_str))
+ v++;
+ if (v->vers_str)
+ {
+ macosx_version_min_required = v->vers_num;
+ use_constant_cfstrings = (macosx_version_min_required >= 1020);
+ }
+ }
+ /* APPLE LOCAL end deployment target */
+
/* Convert new-style -- options to old-style. */
translate_options (&argc, (const char *const **) &argv);
@@ -3431,8 +3586,15 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
/* CPP driver cannot obtain switch from cc1_options. */
if (is_cpp_driver)
add_preprocessor_option ("--help", 6);
+ /* APPLE LOCAL begin verbose help (radar #2920964) */
+#if 0
+ /* Our assembler and linkder do not support --help. */
+ /* APPLE LOCAL end */
add_assembler_option ("--help", 6);
add_linker_option ("--help", 6);
+ /* APPLE LOCAL begin verbose help (radar #2920964) */
+#endif
+ /* APPLE LOCAL end */
}
else if (strcmp (argv[i], "-ftarget-help") == 0)
{
@@ -3549,6 +3711,43 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
save_temps_flag = 1;
n_switches++;
}
+ /* APPLE LOCAL begin IMA */
+ else if (strcmp (argv[i], "-fast") == 0
+ || strcmp (argv[i], "-fastf") == 0
+ || strcmp (argv[i], "-fastcp") == 0)
+ {
+ combine_flag = 1;
+ n_switches++;
+ }
+ else if (strcmp (argv[i], "-traditional-cpp") == 0)
+ {
+ traditional_cpp_flag = 1;
+ n_switches++;
+ }
+ else if (strcmp (argv[i], "-E") == 0)
+ {
+ capital_e_flag = 1;
+ n_switches++;
+ }
+ /* APPLE LOCAL end IMA */
+ /* APPLE LOCAL begin -weak_* (radar 3235250) */
+ else if (strcmp (argv[i], "-weak_library") == 0)
+ {
+ if (i + 1 == argc)
+ fatal ("argument to `-weak_library' is missing");
+
+ n_infiles += 2;
+ i++;
+ }
+ else if (strcmp (argv[i], "-weak_framework") == 0)
+ {
+ if (i + 1 == argc)
+ fatal ("argument to `-weak_framework' is missing");
+
+ n_infiles += 2;
+ i++;
+ }
+ /* APPLE LOCAL end -weak_* (radar 3235250) */
else if (strcmp (argv[i], "-combine") == 0)
{
combine_flag = 1;
@@ -3600,6 +3799,22 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
verbose_only_flag++;
verbose_flag++;
}
+ /* APPLE LOCAL begin constant cfstrings */
+ else if (strcmp (argv[i], "-fconstant-cfstrings") == 0)
+ use_constant_cfstrings = 1;
+ else if (strcmp (argv[i], "-fno-constant-cfstrings") == 0)
+ use_constant_cfstrings = 0;
+ /* APPLE LOCAL end constant cfstrings */
+ /* APPLE LOCAL begin frameworks */
+ else if (strcmp (argv[i], "-framework") == 0)
+ {
+ if (i + 1 == argc)
+ fatal ("argument to `-framework' is missing");
+
+ n_infiles += 2;
+ i++;
+ }
+ /* APPLE LOCAL end frameworks */
else if (argv[i][0] == '-' && argv[i][1] != 0)
{
const char *p = &argv[i][1];
@@ -3885,6 +4100,33 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
/* More prefixes are enabled in main, after we read the specs file
and determine whether this is cross-compilation or not. */
+ /* APPLE LOCAL begin constant cfstrings */
+ /* Check if '-fconstant-cfstrings' usage is valid, given our deployment
+ target. If not, issue a warning and then suppress the option. */
+ if (use_constant_cfstrings)
+ {
+ if (macosx_version_min_required && macosx_version_min_required < 1020)
+ {
+ error ("warning: `-fconstant-cfstrings' ignored because MACOSX_DEPLOYMENT_TARGET is \"%s\"",
+ macosx_deployment_target);
+ use_constant_cfstrings = 0;
+ }
+ }
+ /* APPLE LOCAL end constant cfstrings */
+ /* APPLE LOCAL begin deployment target */
+ /* Synthesize the deployment target manifest constant. */
+ if (macosx_version_min_required)
+ {
+#define VERSION_MIN_REQUIRED_FMT "-D__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__=%d"
+ char *macro_def = xmalloc (strlen (VERSION_MIN_REQUIRED_FMT) + 30);
+
+ sprintf (macro_def, VERSION_MIN_REQUIRED_FMT, macosx_version_min_required);
+ add_preprocessor_option (macro_def, strlen (macro_def));
+ free (macro_def);
+#undef VERSION_MIN_REQUIRED_FMT
+ }
+ /* APPLE LOCAL end deployment target */
+
/* Then create the space for the vectors and scan again. */
switches = xmalloc ((n_switches + 1) * sizeof (struct switchstr));
@@ -3991,14 +4233,62 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\n"
infiles[n_infiles].language = "*";
infiles[n_infiles++].name = argv[i];
}
+ /* APPLE LOCAL begin -weak_* (radar 3235250) */
+ else if (strncmp (argv[i], "-weak-l", 7) == 0)
+ {
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[i];
+ }
+ else if (strcmp (argv[i], "-weak_library") == 0)
+ {
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[i];
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[++i];
+ }
+ else if (strcmp (argv[i], "-weak_framework") == 0)
+ {
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[i];
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[++i];
+ }
+ /* APPLE LOCAL end -weak_* (radar #3235250) */
else if (strcmp (argv[i], "-specs") == 0)
i++;
else if (strncmp (argv[i], "-specs=", 7) == 0)
;
+ /* APPLE LOCAL begin -ObjC 2001-08-03 --sts */
+ else if (!strcmp (argv[i], "-ObjC") || !strcmp (argv[i], "-fobjc"))
+ {
+ default_language = "objective-c";
+ add_linker_option ("-ObjC", 5);
+ }
+ else if (strcmp (argv[i], "-ObjC++") == 0)
+ {
+ default_language = "objective-c++";
+ add_linker_option ("-ObjC", 5);
+ }
+ /* APPLE LOCAL end -ObjC 2001-08-03 --sts */
else if (strcmp (argv[i], "-time") == 0)
;
else if (strcmp (argv[i], "-###") == 0)
;
+ /* APPLE LOCAL begin constant cfstrings */
+ else if (strcmp (argv[i], "-fconstant-cfstrings") == 0)
+ ;
+ else if (strcmp (argv[i], "-fno-constant-cfstrings") == 0)
+ ;
+ /* APPLE LOCAL end constant cfstrings */
+ /* APPLE LOCAL begin frameworks */
+ else if (strcmp (argv[i], "-framework") == 0)
+ {
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[i];
+ infiles[n_infiles].language = "*";
+ infiles[n_infiles++].name = argv[++i];
+ }
+ /* APPLE LOCAL end frameworks */
else if (argv[i][0] == '-' && argv[i][1] != 0)
{
const char *p = &argv[i][1];
@@ -4228,6 +4518,14 @@ static int delete_this_arg;
is the output file name of this compilation. */
static int this_is_output_file;
+/* APPLE LOCAL begin %b/save-temps can clobber input file (radar 2871891) --ilr */
+/* Nonzero if %b or %B has been seen; the next arg to be terminated
+ is a temp file based on the input file's basename. This has
+ the potential to be the same as the input file itself so we
+ need to take precautions if it is. */
+static int this_is_basename_derived_file = 0;
+/* APPLE LOCAL end %b/save-temps can clobber input file (radar 2871891) --ilr */
+
/* Nonzero means %s has been seen; the next arg to be terminated
is the name of a library file and we should try the standard
search dirs for it. */
@@ -4248,6 +4546,10 @@ do_spec (const char *spec)
{
int value;
+ /* APPLE LOCAL begin %b/save-temps can clobber input file (radar 2871891) --ilr */
+ this_is_basename_derived_file = 0;
+ /* APPLE LOCAL end %b/save-temps can clobber input file (radar 2871891) --ilr */
+
value = do_spec_2 (spec);
/* Force out any unfinished command.
@@ -4266,6 +4568,81 @@ do_spec (const char *spec)
return value;
}
+/* APPLE LOCAL begin %b/save-temps can clobber input file (radar 2871891) --ilr */
+/* For %b and %B specs, which create a filename based on the input
+ file's basename, there is a possibility that the resulting file
+ is the same as the input file. Assuming that such names are
+ intended to be used as intermediate (temporary) files there is
+ the risk of clobbering the input file. We check for that here
+ and use a temp file instead if that would happen. */
+
+static const char *
+check_basename_derived_file (const char *string)
+{
+ int suffix_length, string_length;
+ const char *suffix;
+
+ static struct base_temp_name {
+ int suffix_length;
+ int filename_length;
+ const char *filename;
+ struct base_temp_name *next;
+ } *t, *base_temp_names = NULL;
+
+ if (strcmp (string, input_filename) != 0)
+ {
+ struct stat st_temp;
+
+ /* Note, set_input() resets input_stat_set to 0. This can also
+ be done buy or for %U, %u, and %g. */
+ if (input_stat_set == 0)
+ {
+ input_stat_set = stat (input_filename, &input_stat);
+ if (input_stat_set >= 0)
+ input_stat_set = 1;
+ }
+
+ if (input_stat_set != 1
+ || stat (string, &st_temp) < 0
+ || input_stat.st_dev != st_temp.st_dev
+ || input_stat.st_ino != st_temp.st_ino)
+ {
+ this_is_basename_derived_file = 0;
+ return string;
+ }
+ }
+
+ string_length = strlen (string);
+ suffix_length = string_length - basename_length;
+ suffix = string + string_length - suffix_length;
+
+ if (suffix_length > 0)
+ {
+ for (t = base_temp_names; t; t = t->next)
+ if (t->suffix_length == suffix_length
+ && strcmp (t->filename + t->filename_length - suffix_length,
+ suffix) == 0)
+ break;
+ }
+ else
+ t = NULL;
+
+ if (!t)
+ {
+ t = (struct base_temp_name *) xmalloc (sizeof (struct base_temp_name));
+ t->next = base_temp_names;
+ base_temp_names = t;
+
+ t->filename = make_temp_file (suffix);
+ t->filename_length = strlen (t->filename);
+ t->suffix_length = suffix_length;
+ }
+
+ delete_this_arg = 1;
+ return t->filename;
+}
+/* APPLE LOCAL end %b/save-temps can clobber input file (radar 2871891) --ilr */
+
static int
do_spec_2 (const char *spec)
{
@@ -4519,9 +4896,14 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{
obstack_1grow (&obstack, 0);
string = obstack_finish (&obstack);
- if (this_is_library_file)
+ /* APPLE LOCAL begin %b/save-temps can clobber input file (radar 2871891) --ilr */
+ if (this_is_basename_derived_file)
+ string = check_basename_derived_file (string);
+ else if (this_is_library_file)
string = find_file (string);
- store_arg (string, delete_this_arg, this_is_output_file);
+ store_arg (string, delete_this_arg, this_is_output_file
+ || this_is_basename_derived_file);
+ /* APPLE LOCAL end %b/save-temps can clobber input file (radar 2871891) --ilr */
if (this_is_output_file)
outfiles[input_file_number] = string;
}
@@ -4554,6 +4936,8 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
arg_going = 0;
delete_this_arg = 0;
this_is_output_file = 0;
+ /* APPLE LOCAL %b/save-temps can clobber input file (radar 2871891) --ilr */
+ this_is_basename_derived_file = 0;
this_is_library_file = 0;
input_from_pipe = 0;
break;
@@ -4564,9 +4948,14 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{
obstack_1grow (&obstack, 0);
string = obstack_finish (&obstack);
- if (this_is_library_file)
+ /* APPLE LOCAL begin %b/save-temps can clobber input file (radar 2871891) --ilr */
+ if (this_is_basename_derived_file)
+ string = check_basename_derived_file (string);
+ else if (this_is_library_file)
string = find_file (string);
- store_arg (string, delete_this_arg, this_is_output_file);
+ store_arg (string, delete_this_arg, this_is_output_file
+ || this_is_basename_derived_file);
+ /* APPLE LOCAL end %b/save-temps can clobber input file (radar 2871891) --ilr */
if (this_is_output_file)
outfiles[input_file_number] = string;
}
@@ -4583,9 +4972,14 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
{
obstack_1grow (&obstack, 0);
string = obstack_finish (&obstack);
- if (this_is_library_file)
+ /* APPLE LOCAL begin %b/save-temps can clobber input file (radar 2871891) --ilr */
+ if (this_is_basename_derived_file)
+ string = check_basename_derived_file (string);
+ else if (this_is_library_file)
string = find_file (string);
- store_arg (string, delete_this_arg, this_is_output_file);
+ store_arg (string, delete_this_arg, this_is_output_file
+ || this_is_basename_derived_file);
+ /* APPLE LOCAL end %b/save-temps can clobber input file (radar 2871891) --ilr */
if (this_is_output_file)
outfiles[input_file_number] = string;
}
@@ -4593,6 +4987,8 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
arg_going = 0;
delete_this_arg = 0;
this_is_output_file = 0;
+ /* APPLE LOCAL %b/save-temps can clobber input file (radar 2871891) --ilr */
+ this_is_basename_derived_file = 0;
this_is_library_file = 0;
break;
@@ -4603,6 +4999,8 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
fatal ("spec '%s' invalid", spec);
case 'b':
+ /* APPLE LOCAL %b/save-temps can clobber input file (radar 2871891) --ilr */
+ this_is_basename_derived_file = 1;
obstack_grow (&obstack, input_basename, basename_length);
arg_going = 1;
break;
@@ -4816,6 +5214,15 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
suffix. */
for (t = temp_names; t; t = t->next)
if (t->length == suffix_length
+ /* APPLE LOCAL begin IMA */
+#if 0
+ /* This causes gcc.dg/cpp/trad/builtins.c to fail.
+ Disable this for now. */
+ /* Create new temp file for each source file. */
+ && strcmp (suffix, ".i")
+ && strcmp (suffix, ".ii")
+#endif
+ /* APPLE LOCAL end IMA */
&& strncmp (t->suffix, suffix, suffix_length) == 0
&& t->unique == (c == 'u' || c == 'U' || c == 'j'))
break;
@@ -4843,13 +5250,17 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
temp_filename_length = strlen (temp_filename);
t->filename = temp_filename;
t->filename_length = temp_filename_length;
+ /* APPLE LOCAL begin IMA */
+ infiles[input_file_number].temp_filename = temp_filename;
+ /* APPLE LOCAL end IMA */
}
if (saved_suffix)
free (saved_suffix);
obstack_grow (&obstack, t->filename, t->filename_length);
- delete_this_arg = 1;
+ /* APPLE LOCAL what is this for? */
+ delete_this_arg = (save_temps_flag == 0);
}
arg_going = 1;
break;
@@ -4903,6 +5314,26 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
}
break;
+ /* APPLE LOCAL begin constant cfstrings */
+ case 'y':
+ {
+ int c1 = *p++;
+
+ if (c1 == 'C')
+ {
+ if (use_constant_cfstrings)
+ {
+ do_spec_1 (" ", 0, NULL);
+ do_spec_1 ("-mconstant-cfstrings", 1, NULL);
+ do_spec_1 (" ", 0, NULL);
+ }
+ }
+ else
+ abort ();
+ }
+ break;
+ /* APPLE LOCAL end constant cfstrings */
+
case 'o':
{
int max = n_infiles;
@@ -6033,6 +6464,11 @@ main (int argc, const char **argv)
const char *p;
struct user_specs *uptr;
+ /* APPLE LOCAL begin CC_PRINT_OPTIONS (radar 3313335, 3360444) */
+ cc_print_options = getenv ("CC_PRINT_OPTIONS");
+ cc_print_options_filename = getenv ("CC_PRINT_OPTIONS_FILE");
+ /* APPLE LOCAL end */
+
p = argv[0] + strlen (argv[0]);
while (p != argv[0] && !IS_DIR_SEPARATOR (p[-1]))
--p;
@@ -6457,8 +6893,10 @@ main (int argc, const char **argv)
infiles[i].compiled = false;
infiles[i].preprocessed = false;
}
-
- if (combine_flag && save_temps_flag)
+
+ /* APPLE LOCAL begin IMA */
+ if (combine_flag
+ && (save_temps_flag || traditional_cpp_flag || capital_e_flag))
{
bool save_combine_inputs = combine_inputs;
/* Must do a separate pre-processing pass for C & Objective-C files, to
@@ -6485,7 +6923,7 @@ main (int argc, const char **argv)
input_filename, &input_file_compiler->spec[1]);
this_file_error = 1;
}
- else
+ else if (capital_e_flag)
{
value = do_spec (input_file_compiler->spec);
infiles[i].preprocessed = true;
@@ -6500,8 +6938,34 @@ main (int argc, const char **argv)
if (value < 0)
this_file_error = 1;
}
+ else if (save_temps_flag)
+ {
+ value = do_spec (input_file_compiler->spec);
+ infiles[i].preprocessed = TRUE;
+ if (have_o_argbuf_index)
+ infiles[i].name = argbuf[have_o_argbuf_index];
+ else
+ abort ();
+
+ infiles[i].incompiler = lookup_compiler (infiles[i].name,
+ strlen (infiles[i].name),
+ infiles[i].language);
+
+ }
+ else if (traditional_cpp_flag)
+ {
+ /* Temp file name is stored in infiles->temp_filename.
+ Use it as input file name. */
+ infiles[i].name = infiles[i].temp_filename;
+ infiles[i].incompiler = lookup_compiler (infiles[i].name,
+ strlen (infiles[i].name),
+ infiles[i].language);
+ }
}
+ if (value < 0)
+ this_file_error = 1;
+
if (this_file_error)
{
delete_failure_queue ();
@@ -6512,6 +6976,7 @@ main (int argc, const char **argv)
}
combine_inputs = save_combine_inputs;
}
+/* APPLE LOCAL end IMI */
for (i = 0; (int) i < n_infiles; i++)
{
@@ -6548,7 +7013,15 @@ main (int argc, const char **argv)
input_filename, &input_file_compiler->spec[1]);
this_file_error = 1;
}
- else
+ /* APPLE LOCAL begin IMA */
+ /* Check if -E is not used on command line OR input file is
+ assembly file. If -E is used then do not invoke compiler
+ again, because preprocessed output is already generated
+ above. However
+ 1) If -E is used with assembly input file then continue.
+ 2) If inputs are not combined then continue. */
+ else if (!capital_e_flag || !combine_inputs)
+ /* APPLE LOCAL end IMA */
{
value = do_spec (input_file_compiler->spec);
infiles[i].compiled = true;
@@ -6704,6 +7177,27 @@ lookup_compiler (const char *name, size_t length, const char *language)
if (cp >= compilers)
{
+ /* APPLE LOCAL begin -ObjC 2001-08-03 --sts */
+ /* We found a language, but because we set a default language,
+ override with the default. */
+ if (default_language)
+ {
+ struct compiler *ncomp = lookup_compiler (NULL, 0, default_language);
+#if 0 /* unhelpful without docs to educate users, skip for now -sts 2002-01-01 */
+ if (cp == ncomp
+ || (cp->spec[0] == '@'
+ && ncomp
+ && strcmp (cp->spec, ncomp->suffix) == 0))
+ {
+ if (strcmp (default_language, "objective-c") == 0)
+ error ("Warning: -ObjC/-fobjc option is redundant");
+ if (strcmp (default_language, "objective-c++") == 0)
+ error ("Warning: -ObjC++ option is redundant");
+ }
+#endif
+ return ncomp;
+ }
+ /* APPLE LOCAL end -ObjC 2001-08-03 --sts */
if (cp->spec[0] != '@')
/* A non-alias entry: return it. */
return cp;
diff --git a/gcc/gcc.h b/gcc/gcc.h
index 6c3c9829cbc..711adc0afc6 100644
--- a/gcc/gcc.h
+++ b/gcc/gcc.h
@@ -38,6 +38,8 @@ struct spec_function
|| (CHAR) == 'e' || (CHAR) == 'T' || (CHAR) == 'u' \
|| (CHAR) == 'I' || (CHAR) == 'm' || (CHAR) == 'x' \
|| (CHAR) == 'L' || (CHAR) == 'A' || (CHAR) == 'V' \
+ /* APPLE LOCAL frameworks */ \
+ || (CHAR) == 'F' \
|| (CHAR) == 'B' || (CHAR) == 'b')
/* This defines which multi-letter switches take arguments. */
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 92a19dbd545..33d4ac5ee50 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -739,6 +739,17 @@ gcse_main (rtx f, FILE *file)
changed = one_cprop_pass (pass + 1, 0, 0);
timevar_pop (TV_CPROP1);
+ /* APPLE LOCAL begin div by const */
+ /* div by const optimization can introduce new instructions.
+ All this stuff needs to be recomputed. */
+ free_gcse_mem ();
+ max_gcse_regno = max_reg_num ();
+ alloc_gcse_mem (f);
+ free_reg_set_mem ();
+ alloc_reg_set_mem (max_reg_num ());
+ compute_sets (f);
+ /* APPLE LOCAL end div by const */
+
if (optimize_size)
/* Do nothing. */ ;
else
@@ -2946,6 +2957,64 @@ cprop_insn (rtx insn, int alter_jumps)
if (INSN_DELETED_P (insn))
return 1;
}
+ /* APPLE LOCAL begin div by const */
+ /* Look for int div by constant and expand if found. */
+ if ( GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == SET
+ && ( GET_CODE (XEXP (PATTERN (insn), 1)) == DIV
+ || GET_CODE (XEXP (PATTERN (insn), 1)) == UDIV)
+ && GET_MODE (XEXP (PATTERN (insn), 1)) == SImode
+ && GET_CODE (XEXP (XEXP (PATTERN (insn), 1), 1)) == CONST_INT )
+ {
+ rtx seq, result, target;
+ target = XEXP (PATTERN (insn), 0);
+ start_sequence ();
+ result = expand_divmod (0, TRUNC_DIV_EXPR, SImode,
+ XEXP (XEXP (PATTERN (insn), 1), 0),
+ XEXP (XEXP (PATTERN (insn), 1), 1),
+ target,
+ GET_CODE (XEXP (PATTERN (insn), 1))==DIV ? 0 : 1);
+ if ( result != target )
+ emit_move_insn (target, result);
+ seq = get_insns ();
+ end_sequence ();
+ emit_insn_after (seq, insn);
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ update_bb_for_insn (BLOCK_FOR_INSN (insn));
+ changed = 1;
+ break;
+ }
+ else if ( GET_CODE (insn) == INSN
+ && GET_CODE (PATTERN (insn)) == SET
+ && (note = find_reg_equal_equiv_note (insn))
+ && (GET_CODE (XEXP (note, 0)) == DIV
+ || GET_CODE (XEXP (note, 0)) == UDIV)
+ && GET_MODE (XEXP (note, 0)) == SImode
+ && GET_CODE (XEXP (XEXP (note, 0), 1)) == CONST_INT )
+ {
+ rtx seq, result, target;
+ target = XEXP (PATTERN (insn), 0);
+ start_sequence ();
+ result = expand_divmod (0, TRUNC_DIV_EXPR, SImode,
+ XEXP (XEXP (note, 0), 0),
+ XEXP (XEXP (note, 0), 1),
+ target,
+ GET_CODE (XEXP (note, 0))==DIV ? 0 : 1);
+ if ( result != target )
+ emit_move_insn (target, result);
+ seq = get_insns ();
+ end_sequence ();
+ emit_insn_after (seq, insn);
+ PUT_CODE (insn, NOTE);
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
+ NOTE_SOURCE_FILE (insn) = 0;
+ update_bb_for_insn (BLOCK_FOR_INSN (insn));
+ changed = 1;
+ break;
+ }
+ /* APPLE LOCAL end div by const */
}
else if (REG_P (src)
&& REGNO (src) >= FIRST_PSEUDO_REGISTER
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index ad2c880ee51..2c30757ea7d 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1236,6 +1236,17 @@ get_output_file_with_visibility (const char *input_file)
output_name = "gt-c-common.h", for_name = "c-common.c";
else if (strcmp (basename, "c-tree.h") == 0)
output_name = "gt-c-decl.h", for_name = "c-decl.c";
+ /* APPLE LOCAL begin Objective-C++ */
+ else if (strncmp (basename, "cp", 2) == 0 && IS_DIR_SEPARATOR (basename[2])
+ && strcmp (basename + 3, "cp-tree.h") == 0)
+ output_name = "gt-cp-tree.h", for_name = "cp/tree.c";
+ else if (strncmp (basename, "cp", 2) == 0 && IS_DIR_SEPARATOR (basename[2])
+ && strcmp (basename + 3, "decl.h") == 0)
+ output_name = "gt-cp-decl.h", for_name = "cp/decl.c";
+ else if (strncmp (basename, "cp", 2) == 0 && IS_DIR_SEPARATOR (basename[2])
+ && strcmp (basename + 3, "name-lookup.h") == 0)
+ output_name = "gt-cp-name-lookup.h", for_name = "cp/name-lookup.c";
+ /* APPLE LOCAL end Objective-C++ */
else if (strncmp (basename, "objc", 4) == 0 && IS_DIR_SEPARATOR (basename[4])
&& strcmp (basename + 5, "objc-act.h") == 0)
output_name = "gt-objc-objc-act.h", for_name = "objc/objc-act.c";
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index d461d776ee8..d641bd4d82a 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -619,6 +619,25 @@ mostly_copy_tree_r (tree *tp, int *walk_subtrees, void *data)
return NULL_TREE;
}
+/* APPLE LOCAL begin PR 14498, etc --bowdidge */
+/* This routine was deleted from FSF mainline and lno-branch; however,
+ we're still using it in the next routine. Keep a local copy until
+ we can rewrite that other stuff. The FIXME on this worries me. */
+
+/* Mark all the _DECL nodes under *TP as volatile. FIXME: This must die
+ after VA_ARG_EXPRs are properly lowered. */
+
+static tree
+mark_decls_volatile_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
+ void *data ATTRIBUTE_UNUSED)
+{
+ if (SSA_VAR_P (*tp))
+ TREE_THIS_VOLATILE (*tp) = 1;
+
+ return NULL_TREE;
+}
+/* APPLE LOCAL end PR 14498, etc --bowdidge */
+
/* Callback for walk_tree to unshare most of the shared trees rooted at
*TP. If *TP has been visited already (i.e., TREE_VISITED (*TP) == 1),
then *TP is deep copied by calling copy_tree_r.
@@ -659,7 +678,24 @@ copy_if_shared_r (tree *tp, int *walk_subtrees ATTRIBUTE_UNUSED,
/* Otherwise, mark the tree as visited and keep looking. */
else
- TREE_VISITED (t) = 1;
+ /* APPLE LOCAL begin PR 14498 etc. --dbj */
+ /* History is complicated, this was in mainline prior to merge,
+ temporarily and erroneously removed at merge snapshot,
+ later put back, still later replaced by different mechanism. */
+ {
+ TREE_VISITED (t) = 1;
+ if (TREE_CODE (*tp) == VA_ARG_EXPR)
+ {
+ /* Mark any _DECL inside the operand as volatile to avoid
+ the optimizers messing around with it. We have to do this
+ early, otherwise we might mark a variable as volatile
+ after we gimplify other statements that use the variable
+ assuming it's not volatile. */
+ walk_tree (&TREE_OPERAND (*tp, 0), mark_decls_volatile_r,
+ NULL, NULL);
+ }
+ }
+ /* APPLE LOCAL end PR 14498 etc. */
return NULL_TREE;
}
@@ -3805,6 +3841,16 @@ gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p,
case MISALIGNED_INDIRECT_REF:
ret = gimplify_expr (&TREE_OPERAND (*expr_p, 0), pre_p, post_p,
is_gimple_reg, fb_rvalue);
+
+ /* APPLE LOCAL begin Objective-C */
+ /* Useless type conversions may have been discarded, so ensure
+ that the INDIRECT_REF has a type corresponding to the pointee
+ type of its operand. */
+ if (TREE_CODE (*expr_p) == INDIRECT_REF)
+ TREE_TYPE (*expr_p)
+ = TREE_TYPE (TREE_TYPE (TREE_OPERAND (*expr_p, 0)));
+ /* APPLE LOCAL end Objective-C */
+
recalculate_side_effects (*expr_p);
break;
diff --git a/gcc/ginclude/tgmath.h b/gcc/ginclude/tgmath.h
new file mode 100644
index 00000000000..f78453bc3fa
--- /dev/null
+++ b/gcc/ginclude/tgmath.h
@@ -0,0 +1,175 @@
+/* APPLE LOCAL file radar 2872232 */
+/* Copyright (C) 2004
+ Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* As a special exception, if you include this header file into source
+ files compiled by GCC, this header file does not by itself cause
+ the resulting executable to be covered by the GNU General Public
+ License. This exception does not however invalidate any other
+ reasons why the executable file might be covered by the GNU General
+ Public License. */
+
+/*
+ * ISO C Standard: 7.22 Type-generic math <tgmath.h>
+ */
+
+#ifndef _TGMATH_H
+#define _TGMATH_H
+
+#include <math.h>
+
+#ifndef __cplusplus
+#include <complex.h>
+
+/* Naming convention: generic macros are defining using
+ __TGMATH_CPLX*, __TGMATH_REAL*, and __TGMATH_CPLX_ONLY. _CPLX
+ means the generic argument(s) may be real or complex, _REAL means
+ real only, _CPLX means complex only. If there is no suffix, we are
+ defining a function of one generic argument. If the suffix is _n
+ it is a function of n generic arguments. If the suffix is _m_n it
+ is a function of n arguments, the first m of which are generic. We
+ only define these macros for values of n and/or m that are needed. */
+
+/* The general rules for generic macros are given in 7.22 paragraphs 1 and 2.
+ If any generic parameter is complex, we use a complex version. Otherwise
+ we use a real version. If the real part of any generic parameter is long
+ double, we use the long double version. Otherwise if the real part of any
+ generic paramter is double or of integer type, we use the double version.
+ Otherwise we use the float version. */
+
+#define __tg_cplx(expr) \
+ __builtin_classify_type(expr) == 9
+
+#define __tg_ldbl(expr) \
+ __builtin_types_compatible_p(__typeof__(expr), long double)
+
+#define __tg_dbl(expr) \
+ (__builtin_types_compatible_p(__typeof__(expr), double) \
+ || __builtin_classify_type(expr) == 1)
+
+#define __tg_choose(x,f,d,l) \
+ __builtin_choose_expr(__tg_ldbl(x), l, \
+ __builtin_choose_expr(__tg_dbl(x), d, \
+ f))
+
+#define __tg_choose_2(x,y,f,d,l) \
+ __builtin_choose_expr(__tg_ldbl(x) || __tg_ldbl(y), l, \
+ __builtin_choose_expr(__tg_dbl(x) || __tg_dbl(y), d, \
+ f))
+
+#define __tg_choose_3(x,y,z,f,d,l) \
+ __builtin_choose_expr(__tg_ldbl(x) || __tg_ldbl(y) || __tg_ldbl(z), l, \
+ __builtin_choose_expr(__tg_dbl(x) || __tg_dbl(y) \
+ || __tg_dbl(z), d, \
+ f))
+
+#define __TGMATH_CPLX(z,R,C) \
+ __builtin_choose_expr (__tg_cplx(z), \
+ __tg_choose (__real__(z), C##f(z), (C)(z), C##l(z)), \
+ __tg_choose (z, R##f(z), (R)(z), R##l(z)))
+
+#define __TGMATH_CPLX_2(z1,z2,R,C) \
+ __builtin_choose_expr (__tg_cplx(z1) || __tg_cplx(z2), \
+ __tg_choose_2 (__real__(z1), __real__(z2), \
+ C##f(z1,z2), (C)(z1,z2), C##l(z1,z2)), \
+ __tg_choose_2 (z1, z2, \
+ R##f(z1,z2), (R)(z1,z2), R##l(z1,z2)))
+
+#define __TGMATH_REAL(x,R) \
+ __tg_choose (x, R##f(x), (R)(x), R##l(x))
+#define __TGMATH_REAL_2(x,y,R) \
+ __tg_choose_2 (x, y, R##f(x,y), (R)(x,y), R##l(x,y))
+#define __TGMATH_REAL_3(x,y,z,R) \
+ __tg_choose_3 (x, y, z, R##f(x,y,z), (R)(x,y,z), R##l(x,y,z))
+#define __TGMATH_REAL_1_2(x,y,R) \
+ __tg_choose (x, R##f(x,y), (R)(x,y), R##l(x,y))
+#define __TGMATH_REAL_2_3(x,y,z,R) \
+ __tg_choose_2 (x, y, R##f(x,y,z), (R)(x,y,z), R##l(x,y,z))
+#define __TGMATH_CPLX_ONLY(z,C) \
+ __tg_choose (__real__(z), C##f(z), (C)(z), C##l(z))
+
+/* Functions defined in both <math.h> and <complex.h> (7.22p4) */
+#define acos(z) __TGMATH_CPLX(z, acos, cacos)
+#define asin(z) __TGMATH_CPLX(z, asin, casin)
+#define atan(z) __TGMATH_CPLX(z, atan, catan)
+#define acosh(z) __TGMATH_CPLX(z, acosh, cacosh)
+#define asinh(z) __TGMATH_CPLX(z, asinh, casinh)
+#define atanh(z) __TGMATH_CPLX(z, atanh, catanh)
+#define cos(z) __TGMATH_CPLX(z, cos, ccos)
+#define sin(z) __TGMATH_CPLX(z, sin, csin)
+#define tan(z) __TGMATH_CPLX(z, tan, ctan)
+#define cosh(z) __TGMATH_CPLX(z, cosh, ccosh)
+#define sinh(z) __TGMATH_CPLX(z, sinh, csinh)
+#define tanh(z) __TGMATH_CPLX(z, tanh, ctanh)
+#define exp(z) __TGMATH_CPLX(z, exp, cexp)
+#define log(z) __TGMATH_CPLX(z, log, clog)
+#define pow(z1,z2) __TGMATH_CPLX_2(z1, z2, pow, cpow)
+#define sqrt(z) __TGMATH_CPLX(z, sqrt, csqrt)
+#define fabs(z) __TGMATH_CPLX(z, fabs, cabs)
+
+/* Functions defined in <math.h> only (7.22p5) */
+#define atan2(x,y) __TGMATH_REAL_2(x, y, atan2)
+#define cbrt(x) __TGMATH_REAL(x, cbrt)
+#define ceil(x) __TGMATH_REAL(x, ceil)
+#define copysign(x,y) __TGMATH_REAL_2(x, y, copysign)
+#define erf(x) __TGMATH_REAL(x, erf)
+#define erfc(x) __TGMATH_REAL(x, erfc)
+#define exp2(x) __TGMATH_REAL(x, exp2)
+#define expm1(x) __TGMATH_REAL(x, expm1)
+#define fdim(x,y) __TGMATH_REAL_2(x, y, fdim)
+#define floor(x) __TGMATH_REAL(x, floor)
+#define fma(x,y,z) __TGMATH_REAL_3(x, y, z, fma)
+#define fmax(x,y) __TGMATH_REAL_2(x, y, fmax)
+#define fmin(x,y) __TGMATH_REAL_2(x, y, fmin)
+#define fmod(x,y) __TGMATH_REAL_2(x, y, fmod)
+#define frexp(x,y) __TGMATH_REAL_1_2(x, y, frexp)
+#define hypot(x,y) __TGMATH_REAL_2(x, y, hypot)
+#define ilogb(x) __TGMATH_REAL(x, ilogb)
+#define ldexp(x,y) __TGMATH_REAL_1_2(x, y, ldexp)
+#define lgamma(x) __TGMATH_REAL(x, lgamma)
+#define llrint(x) __TGMATH_REAL(x, llrint)
+#define llround(x) __TGMATH_REAL(x, llround)
+#define log10(x) __TGMATH_REAL(x, log10)
+#define log1p(x) __TGMATH_REAL(x, log1p)
+#define log2(x) __TGMATH_REAL(x, log2)
+#define logb(x) __TGMATH_REAL(x, logb)
+#define lrint(x) __TGMATH_REAL(x, lrint)
+#define lround(x) __TGMATH_REAL(x, lround)
+#define nearbyint(x) __TGMATH_REAL(x, nearbyint)
+#define nextafter(x,y) __TGMATH_REAL_2(x, y, nextafter)
+#define nexttoward(x,y) __TGMATH_REAL_1_2(x, y, nexttoward)
+#define remainder(x,y) __TGMATH_REAL_2(x, y, remainder)
+#define remquo(x,y,z) __TGMATH_REAL_2_3(x, y, z, remquo)
+#define rint(x) __TGMATH_REAL(x, rint)
+#define round(x) __TGMATH_REAL(x, round)
+#define scalbn(x,y) __TGMATH_REAL_2(x, y, scalbn)
+#define scalbln(x,y) __TGMATH_REAL_2(x, y, scalbln)
+#define tgamma(x) __TGMATH_REAL(x, tgamma)
+#define trunc(x) __TGMATH_REAL(x, trunc)
+
+/* Functions defined in <complex.h> only (7.22p6) */
+#define carg(z) __TGMATH_CPLX_ONLY(z, carg)
+#define cimag(z) __TGMATH_CPLX_ONLY(z, cimag)
+#define conj(z) __TGMATH_CPLX_ONLY(z, conj)
+#define cproj(z) __TGMATH_CPLX_ONLY(z, cproj)
+#define creal(z) __TGMATH_CPLX_ONLY(z, creal)
+
+#endif /* __cplusplus */
+#endif /* _TGMATH_H */
diff --git a/gcc/global.c b/gcc/global.c
index 35fec4a4392..9c9b58c5609 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -37,6 +37,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "output.h"
#include "toplev.h"
+/* APPLE LOCAL begin rewrite weight computation */
+/* The rewritten weight computation works fine on Darwin, but causes
+ bootstrap compares to fail on Linux. */
+#ifdef CONFIG_DARWIN_H
+#define REWRITE_WEIGHT_COMPUTATION
+#endif
+/* APPLE LOCAL end rewrite weight computation */
+
/* This pass of the compiler performs global register allocation.
It assigns hard register numbers to all the pseudo registers
that were not handled in local_alloc. Assignments are recorded
@@ -225,6 +233,18 @@ static HARD_REG_SET regs_used_so_far;
static int local_reg_n_refs[FIRST_PSEUDO_REGISTER];
+/* APPLE LOCAL begin rewrite weight computation */
+#ifdef REWRITE_WEIGHT_COMPUTATION
+/* Overall weight of each hard reg, as used by local alloc.
+ This was formerly computed once as
+ SUM(REG_FREQ(i))/SUM(REG_LIVE_LENGTH(i)) where the sums
+ are computed over all uses. But that computation produces very
+ wrong answers when a reg is used both inside and outside a loop.
+ Now it is computed as
+ SUM (REG_FREQ(i)/REG_LIVE_LENGTH(i)) over all uses. */
+
+static double local_reg_weight[FIRST_PSEUDO_REGISTER];
+#else
/* Frequency of uses of given hard reg. */
static int local_reg_freq[FIRST_PSEUDO_REGISTER];
@@ -232,6 +252,8 @@ static int local_reg_freq[FIRST_PSEUDO_REGISTER];
This is actually the sum of the live lengths of the specific regs. */
static int local_reg_live_length[FIRST_PSEUDO_REGISTER];
+#endif /* REWRITE_WEIGHT_COMPUTATION */
+/* APPLE LOCAL end rewrite weight computation */
/* Set to 1 a bit in a vector TABLE of HARD_REG_SETs, for vector
element I, and hard register number J. */
@@ -493,9 +515,17 @@ global_alloc (FILE *file)
/* Calculate amount of usage of each hard reg by pseudos
allocated by local-alloc. This is to see if we want to
override it. */
+ /* APPLE LOCAL begin rewrite weight computation */
+#ifndef REWRITE_WEIGHT_COMPUTATION
memset (local_reg_live_length, 0, sizeof local_reg_live_length);
+#endif /* REWRITE_WEIGHT_COMPUTATION */
memset (local_reg_n_refs, 0, sizeof local_reg_n_refs);
+#ifdef REWRITE_WEIGHT_COMPUTATION
+ memset (local_reg_weight, 0, sizeof local_reg_weight);
+#else
memset (local_reg_freq, 0, sizeof local_reg_freq);
+#endif /* REWRITE_WEIGHT_COMPUTATION */
+ /* APPLE LOCAL end rewrite weight computation */
for (i = FIRST_PSEUDO_REGISTER; i < (size_t) max_regno; i++)
if (reg_renumber[i] >= 0)
{
@@ -506,15 +536,29 @@ global_alloc (FILE *file)
for (j = regno; j < endregno; j++)
{
local_reg_n_refs[j] += REG_N_REFS (i);
+ /* APPLE LOCAL begin rewrite weight computation */
+#ifdef REWRITE_WEIGHT_COMPUTATION
+ if ( REG_LIVE_LENGTH (i) > 0 )
+ local_reg_weight[j] += (double)REG_FREQ (i)
+ / (double) REG_LIVE_LENGTH (i);
+#else
local_reg_freq[j] += REG_FREQ (i);
local_reg_live_length[j] += REG_LIVE_LENGTH (i);
+#endif /* REWRITE_WEIGHT_COMPUTATION */
+ /* APPLE LOCAL end rewrite weight computation */
}
}
/* We can't override local-alloc for a reg used not just by local-alloc. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (regs_ever_live[i])
+ /* APPLE LOCAL begin rewrite weight computation */
+#ifdef REWRITE_WEIGHT_COMPUTATION
+ local_reg_n_refs[i] = 0;
+#else
local_reg_n_refs[i] = 0, local_reg_freq[i] = 0;
+#endif /* REWRITE_WEIGHT_COMPUTATION */
+ /* APPLE LOCAL end rewrite weight computation */
allocno_row_words = (max_allocno + INT_BITS - 1) / INT_BITS;
@@ -1265,6 +1309,15 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere
#endif
)
{
+ /* APPLE LOCAL begin rewrite weight computation */
+#ifdef REWRITE_WEIGHT_COMPUTATION
+ /* We explicitly evaluate the divide result into a temporary
+ variable so as to avoid excess precision problems that occur
+ on an i386-unknown-sysv4.2 (unixware) host. */
+ double tmp = ((double) allocno[num].freq
+ / allocno[num].live_length);
+#else
+ /* APPLE LOCAL end rewrite weight computation */
/* We explicitly evaluate the divide results into temporary
variables so as to avoid excess precision problems that occur
on an i386-unknown-sysv4.2 (unixware) host. */
@@ -1273,8 +1326,15 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere
/ local_reg_live_length[regno]);
double tmp2 = ((double) allocno[num].freq
/ allocno[num].live_length);
+ /* APPLE LOCAL begin rewrite weight computation */
+#endif /* REWRITE_WEIGHT_COMPUTATION */
+#ifdef REWRITE_WEIGHT_COMPUTATION
+ if (local_reg_weight[regno] < tmp)
+#else
if (tmp1 < tmp2)
+#endif /* REWRITE_WEIGHT_COMPUTATION */
+ /* APPLE LOCAL end rewrite weight computation */
{
/* Hard reg REGNO was used less in total by local regs
than it would be used by this one allocno! */
@@ -1321,7 +1381,11 @@ find_reg (int num, HARD_REG_SET losers, int alt_regs_p, int accept_call_clobbere
SET_HARD_REG_BIT (regs_used_so_far, j);
/* This is no longer a reg used just by local regs. */
local_reg_n_refs[j] = 0;
+ /* APPLE LOCAL begin rewrite weight computation */
+#ifndef REWRITE_WEIGHT_COMPUTATION
local_reg_freq[j] = 0;
+#endif /* REWRITE_WEIGHT_COMPUTATION */
+ /* APPLE LOCAL end rewrite weight computation */
}
/* For each other pseudo-reg conflicting with this one,
mark it as conflicting with the hard regs this one occupies. */
diff --git a/gcc/hooks.c b/gcc/hooks.c
index d091583a2d3..eb91b5dc13f 100644
--- a/gcc/hooks.c
+++ b/gcc/hooks.c
@@ -149,10 +149,12 @@ hook_void_tree (tree a ATTRIBUTE_UNUSED)
{
}
+/* APPLE LOCAL begin 3739318 FSF Candidate. */
void
hook_void_constcharptr (const char *a ATTRIBUTE_UNUSED)
{
}
+/* APPLE LOCAL end 3739318 FSF Candidate. */
void
hook_void_tree_treeptr (tree a ATTRIBUTE_UNUSED, tree *b ATTRIBUTE_UNUSED)
@@ -234,6 +236,24 @@ hook_constcharptr_tree_null (tree t ATTRIBUTE_UNUSED)
return NULL;
}
+/* APPLE LOCAL begin constant cfstrings */
+/* Generic hook that takes a tree and returns NULL. */
+tree
+hook_tree_tree_null (tree a ATTRIBUTE_UNUSED)
+{
+ return NULL;
+}
+
+/* Generic hook that takes three trees and returns NULL. */
+tree
+hook_tree_tree_tree_tree_null (tree a ATTRIBUTE_UNUSED,
+ tree b ATTRIBUTE_UNUSED,
+ tree c ATTRIBUTE_UNUSED)
+{
+ return NULL;
+}
+/* APPLE LOCAL end constant cfstrings */
+
tree
hook_tree_tree_bool_null (tree t ATTRIBUTE_UNUSED, bool ignore ATTRIBUTE_UNUSED)
{
diff --git a/gcc/hooks.h b/gcc/hooks.h
index b0f47b7913f..51d062104e5 100644
--- a/gcc/hooks.h
+++ b/gcc/hooks.h
@@ -63,5 +63,9 @@ extern rtx hook_rtx_rtx_null (rtx);
extern rtx hook_rtx_tree_int_null (tree, int);
extern tree hook_tree_tree_identity (tree a);
extern const char *hook_constcharptr_tree_null (tree);
+/* APPLE LOCAL begin constant cfstrings */
+extern tree hook_tree_tree_null (tree);
+extern tree hook_tree_tree_tree_tree_null (tree, tree, tree);
+/* APPLE LOCAL end constant cfstrings */
extern tree hook_tree_tree_bool_null (tree, bool);
#endif
diff --git a/gcc/java/ChangeLog.lno b/gcc/java/ChangeLog.lno
new file mode 100644
index 00000000000..35f846515ff
--- /dev/null
+++ b/gcc/java/ChangeLog.lno
@@ -0,0 +1,4 @@
+2004-07-13 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * builtins.c (initialize_builtins): Initialize
+ BUILT_IN_MAYBE_INFINITE_LOOP.
diff --git a/gcc/java/builtins.c b/gcc/java/builtins.c
index f4a8efb2a1b..850e797426e 100644
--- a/gcc/java/builtins.c
+++ b/gcc/java/builtins.c
@@ -161,6 +161,8 @@ initialize_builtins (void)
{
tree double_ftype_double, double_ftype_double_double;
tree float_ftype_float, float_ftype_float_float;
+ /* APPLE LOCAL lno */
+ tree void_ftype;
tree t;
int i;
@@ -185,6 +187,10 @@ initialize_builtins (void)
t = tree_cons (NULL_TREE, double_type_node, t);
double_ftype_double_double = build_function_type (double_type_node, t);
+ /* APPLE LOCAL begin lno */
+ void_ftype = build_function_type (void_type_node, NULL_TREE);
+ /* APPLE LOCAL end lno */
+
define_builtin (BUILT_IN_FMOD, "__builtin_fmod",
double_ftype_double_double, "fmod");
define_builtin (BUILT_IN_FMODF, "__builtin_fmodf",
@@ -216,6 +222,10 @@ initialize_builtins (void)
double_ftype_double, "_ZN4java4lang4Math4sqrtEd");
define_builtin (BUILT_IN_TAN, "__builtin_tan",
double_ftype_double, "_ZN4java4lang4Math3tanEd");
+ /* APPLE LOCAL begin lno */
+ define_builtin (BUILT_IN_MAYBE_INFINITE_LOOP, "__builtin_maybe_infinite_loop",
+ void_ftype, "__builtin_maybe_infinite_loop");
+ /* APPLE LOCAL end lno */
build_common_builtin_nodes ();
}
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index b7aa61650d3..04c00e78338 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -663,6 +663,8 @@ java_init_decl_processing (void)
/* Define these next since types below may used them. */
integer_type_node = java_type_for_size (INT_TYPE_SIZE, 0);
+ /* APPLE LOCAL lno */
+ long_integer_type_node = java_type_for_size (LONG_TYPE_SIZE, 0);
integer_zero_node = build_int_cst (NULL_TREE, 0);
integer_one_node = build_int_cst (NULL_TREE, 1);
integer_two_node = build_int_cst (NULL_TREE, 2);
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index b89bdf9b6d8..24c3d0b95ad 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -752,6 +752,56 @@ java_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED,
#undef WALK_SUBTREE
}
+/* APPLE LOCAL begin AltiVec */
+/* Placeholders to make linking work, remove when altivec support is correct */
+
+int comptypes (tree type1, tree type2);
+
+int
+comptypes (tree type1, tree type2)
+{
+ register tree t1 = type1;
+ register tree t2 = type2;
+ if (t1 == t2 || !t1 || !t2
+ || TREE_CODE (t1) == ERROR_MARK || TREE_CODE (t2) == ERROR_MARK)
+ return 1;
+ return 0;
+}
+
+tree default_conversion (tree exp);
+
+tree
+default_conversion (tree exp)
+{
+ return exp;
+}
+
+tree lang_build_type_variant (tree type, int constp ATTRIBUTE_UNUSED, int volatilep ATTRIBUTE_UNUSED);
+
+tree
+lang_build_type_variant (tree type, int constp ATTRIBUTE_UNUSED, int volatilep ATTRIBUTE_UNUSED)
+{
+ return type;
+}
+/* APPLE LOCAL end AltiVec */
+
+/* APPLE LOCAL begin constant cfstrings */
+enum { blabla } c_language;
+const char *constant_string_class_name = "die die";
+int flag_next_runtime = 1;
+/* APPLE LOCAL end constant cfstrings */
+
+/* APPLE LOCAL disable_typechecking_for_spec_flag */
+int disable_typechecking_for_spec_flag = 0;
+
+/* APPLE LOCAL begin CW asm blocks */
+/* Dummies needed because we use them from cpplib, yuck. */
+int flag_cw_asm_blocks;
+int cw_asm_state;
+int cw_asm_in_operands;
+/* APPLE LOCAL end CW asm blocks */
+
+
/* Every call to a static constructor has an associated boolean
variable which is in the outermost scope of the calling method.
This variable is used to avoid multiple calls to the static
diff --git a/gcc/lambda.h b/gcc/lambda.h
index 98fe6bd1ca6..b7d5dfc0b00 100644
--- a/gcc/lambda.h
+++ b/gcc/lambda.h
@@ -23,6 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define LAMBDA_H
#include "vec.h"
+/* APPLE LOCAL lno */
+#include "ggc.h"
/* An integer vector. A vector formally consists of an element of a vector
space. A vector space is a set that is closed under vector addition
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index 59083ad7b56..4193588970b 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -52,6 +52,8 @@ extern tree lhd_do_nothing_iii_return_null_tree (int, int, int);
extern int lhd_safe_from_p (rtx, tree);
extern tree lhd_staticp (tree);
extern void lhd_print_tree_nothing (FILE *, tree, int);
+/* APPLE LOCAL kext identify vtables */
+extern int lhd_vtable_p (tree);
extern const char *lhd_decl_printable_name (tree, int);
extern int lhd_types_compatible_p (tree, tree);
extern rtx lhd_expand_expr (tree, rtx, enum machine_mode, int, rtx *);
@@ -91,6 +93,8 @@ extern int lhd_gimplify_expr (tree *, tree *, tree *);
#define LANG_HOOKS_IDENTIFIER_SIZE sizeof (struct lang_identifier)
#define LANG_HOOKS_INIT hook_bool_void_false
#define LANG_HOOKS_FINISH lhd_do_nothing
+/* APPLE LOCAL Objective-C++ */
+#define LANG_HOOKS_FINISH_FILE lhd_do_nothing
#define LANG_HOOKS_PARSE_FILE lhd_do_nothing_i
#define LANG_HOOKS_CLEAR_BINDING_STACK lhd_do_nothing
#define LANG_HOOKS_INIT_OPTIONS hook_uint_uint_constcharptrptr_0
@@ -115,6 +119,8 @@ extern int lhd_gimplify_expr (tree *, tree *, tree *);
#define LANG_HOOKS_PRINT_DECL lhd_print_tree_nothing
#define LANG_HOOKS_PRINT_TYPE lhd_print_tree_nothing
#define LANG_HOOKS_PRINT_IDENTIFIER lhd_print_tree_nothing
+/* APPLE LOCAL kext identify vtables */
+#define LANG_HOOKS_VTABLE_P lhd_vtable_p
#define LANG_HOOKS_PRINT_ERROR_FUNCTION lhd_print_error_function
#define LANG_HOOKS_DECL_PRINTABLE_NAME lhd_decl_printable_name
#define LANG_HOOKS_GET_CALLEE_FNDECL lhd_return_null_tree
@@ -259,6 +265,8 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_POST_OPTIONS, \
LANG_HOOKS_INIT, \
LANG_HOOKS_FINISH, \
+ /* APPLE LOCAL Objective-C++ */ \
+ LANG_HOOKS_FINISH_FILE, \
LANG_HOOKS_PARSE_FILE, \
LANG_HOOKS_CLEAR_BINDING_STACK, \
LANG_HOOKS_GET_ALIAS_SET, \
@@ -288,6 +296,8 @@ extern tree lhd_make_node (enum tree_code);
LANG_HOOKS_ATTRIBUTE_TABLE, \
LANG_HOOKS_COMMON_ATTRIBUTE_TABLE, \
LANG_HOOKS_FORMAT_ATTRIBUTE_TABLE, \
+/* APPLE LOCAL kext identify vtables */ \
+ LANG_HOOKS_VTABLE_P, \
LANG_HOOKS_FUNCTION_INITIALIZER, \
LANG_HOOKS_TREE_INLINING_INITIALIZER, \
LANG_HOOKS_CALLGRAPH_INITIALIZER, \
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index 0cf31be7806..fac3725491f 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -366,6 +366,14 @@ lhd_tree_inlining_anon_aggr_type_p (tree t ATTRIBUTE_UNUSED)
return 0;
}
+/* APPLE LOCAL begin kext identify vtables */
+int
+lhd_vtable_p (tree t ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+/* APPLE LOCAL end kext identify vtables */
+
/* lang_hooks.tree_inlining.start_inlining and end_inlining perform any
language-specific bookkeeping necessary for processing
FN. start_inlining returns nonzero if inlining should proceed, zero if
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index f57f14821ec..2a09981a2bf 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -253,6 +253,11 @@ struct lang_hooks
/* Called at the end of compilation, as a finalizer. */
void (*finish) (void);
+ /* APPLE LOCAL begin Objective-C++ */
+ /* Called at the end of the translation unit. */
+ void (*finish_file) PARAMS ((void));
+ /* APPLE LOCAL end Objective-C++ */
+
/* Parses the entire file. The argument is nonzero to cause bison
parsers to dump debugging information during parsing. */
void (*parse_file) (int);
@@ -383,6 +388,10 @@ struct lang_hooks
const struct attribute_spec *common_attribute_table;
const struct attribute_spec *format_attribute_table;
+ /* APPLE LOCAL begin kext identify vtables */
+ int (*vtable_p) (tree);
+ /* APPLE LOCAL end kext identify vtables */
+
/* Function-related language hooks. */
struct lang_hooks_for_functions function;
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 56a9bc4e87a..ed2ea91e7f4 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -47,6 +47,14 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#undef abort
#endif
+/* APPLE LOCAL begin libcc_kext */
+#ifdef LIBCC_KEXT
+/* Make aborts into panics (kernel panics presumably) */
+#define abort() panic()
+extern void panic (void);
+#endif
+/* APPLE LOCAL end libcc_kext */
+
#ifdef HAVE_GAS_HIDDEN
#define ATTRIBUTE_HIDDEN __attribute__ ((__visibility__ ("hidden")))
#else
diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c
index 965e2e3edd8..fa497d5bf52 100644
--- a/gcc/loop-doloop.c
+++ b/gcc/loop-doloop.c
@@ -160,6 +160,13 @@ doloop_valid_p (struct loop *loop, struct niter_desc *desc)
If the absolute increment is not 1, the loop can be infinite
even with LTU/GTU, e.g. for (i = 3; i > 0; i -= 2)
+ APPLE LOCAL begin lno
+ Note that with LE and GE, the loop behavior is undefined
+ (C++ standard section 5 clause 5) if an overflow occurs, say
+ between INT_MAX and INT_MAX + 1. We thus don't have to worry
+ about these two cases.
+ APPLE LOCAL end lno
+
??? We could compute these conditions at run-time and have a
additional jump around the loop to ensure an infinite loop.
However, it is very unlikely that this is the intended
@@ -451,6 +458,17 @@ doloop_optimize (struct loop *loop)
if (dump_file)
fprintf (dump_file, "Doloop: Processing loop %d.\n", loop->num);
+ /* APPLE LOCAL begin lno */
+ /* Ignore large loops. */
+ if (loop->ninsns > (unsigned) PARAM_VALUE (PARAM_MAX_DOLOOP_INSNS))
+ {
+ if (dump_file)
+ fprintf (dump_file,
+ "Doloop: The loop is too large.\n");
+ return false;
+ }
+ /* APPLE LOCAL end lno */
+
iv_analysis_loop_init (loop);
/* Find the simple exit of a LOOP. */
diff --git a/gcc/loop.c b/gcc/loop.c
index 2b765c821d8..a1947074910 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -502,12 +502,25 @@ struct loop_info
#define PREFETCH_CONDITIONAL 1
#endif
+/* APPLE LOCAL begin avoid out-of-bounds refs */
+/* If the first or last uid lies outside the loop, assume the
+ lifetime extends to that end of the loop. */
#define LOOP_REG_LIFETIME(LOOP, REGNO) \
-((REGNO_LAST_LUID (REGNO) - REGNO_FIRST_LUID (REGNO)))
-
+(((REGNO_LAST_UID (REGNO) > max_uid_for_loop) \
+ ? (INSN_LUID ((LOOP)->end)) \
+ : (REGNO_LAST_LUID (REGNO))) \
+ - ((REGNO_FIRST_UID (REGNO) > max_uid_for_loop) \
+ ? (INSN_LUID ((LOOP)->start)) \
+ : (REGNO_FIRST_LUID (REGNO))))
+
+/* uid's that are too big are derived from nested loops and are
+ not referenced outside this loop, hence they are not global. */
#define LOOP_REG_GLOBAL_P(LOOP, REGNO) \
-((REGNO_LAST_LUID (REGNO) > INSN_LUID ((LOOP)->end) \
- || REGNO_FIRST_LUID (REGNO) < INSN_LUID ((LOOP)->start)))
+((REGNO_LAST_UID (REGNO) > max_uid_for_loop) ? 0 : \
+(((REGNO_FIRST_UID (REGNO) > max_uid_for_loop) ? 0 : \
+((((REGNO_LAST_LUID (REGNO) > INSN_LUID ((LOOP)->end) \
+ || REGNO_FIRST_LUID (REGNO) < INSN_LUID ((LOOP)->start))))))))
+/* APPLE LOCAL end avoid out-of-bounds refs */
#define LOOP_REGNO_NREGS(REGNO, SET_DEST) \
((REGNO) < FIRST_PSEUDO_REGISTER \
@@ -1893,6 +1906,8 @@ combine_movables (struct loop_movables *movables, struct loop_regs *regs)
&& GET_MODE_CLASS (GET_MODE (m1->set_dest)) == MODE_INT
&& (GET_MODE_BITSIZE (GET_MODE (m->set_dest))
>= GET_MODE_BITSIZE (GET_MODE (m1->set_dest)))))
+ /* APPLE LOCAL combine hoisted consts */
+ && m1->regno >= FIRST_PSEUDO_REGISTER
/* See if the source of M1 says it matches M. */
&& ((REG_P (m1->set_src)
&& matched_regs[REGNO (m1->set_src)])
@@ -5571,7 +5586,8 @@ loop_giv_reduce_benefit (struct loop *loop ATTRIBUTE_UNUSED,
/* Increasing the benefit is risky, since this is only a guess.
Avoid increasing register pressure in cases where there would
be no other benefit from reducing this giv. */
- && benefit > 0
+ /* APPLE LOCAL compare >= 0, not > 0. */
+ && benefit >= 0
&& GET_CODE (v->mult_val) == CONST_INT)
{
int size = GET_MODE_SIZE (GET_MODE (v->mem));
@@ -6504,10 +6520,25 @@ strength_reduce (struct loop *loop, int flags)
value, so we don't need another one. We can't calculate the
proper final value for such a biv here anyways. */
if (bl->final_value && ! bl->reversed)
- loop_insn_sink_or_swim (loop,
- gen_load_of_final_value (bl->biv->dest_reg,
- bl->final_value));
-
+ /* APPLE LOCAL begin put this insn after the loop in all cases */
+ /* Putting it before the loop can cause problems in an
+ obscure case. "a" is the variable we're currently
+ looking at:
+ b <- a
+ loop beginning
+ b++; and references
+ a++; no references
+ if we put the final value for a before the loop, then
+ eliminate b in favor of c later on, we'll get this
+ before the loop:
+ b <- a
+ a <- final value
+ c <- a
+ which is no good. */
+ loop_insn_sink (loop, gen_load_of_final_value (bl->biv->dest_reg,
+ bl->final_value));
+ /* APPLE LOCAL end put this insn after the loop in all cases */
+
if (loop_dump_stream)
fprintf (loop_dump_stream, "Reg %d: biv eliminated\n",
bl->regno);
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index c88fca98186..5a67005decc 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -339,13 +339,15 @@ for ml in $MULTILIBS; do
out="libgcc/${dir}/${name}${objext}"
outS="libgcc/${dir}/${name}_s${objext}"
+# APPLE LOCAL begin libcc_kext move options to start of line for overriding --bowdidge
echo $outS: $libgcc2_c_dep
- echo " $gcc_compile" $flags -DL$name \
- -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $outS
+ echo " $gcc_compile" -fexceptions -fnon-call-exceptions $flags -DL$name \
+ -c '$(srcdir)/libgcc2.c' -o $outS
echo $out: $libgcc2_c_dep
- echo " $gcc_compile" $flags -DL$name '$(vis_hide)' \
- -fexceptions -fnon-call-exceptions -c '$(srcdir)/libgcc2.c' -o $out
+ echo " $gcc_compile" -fexceptions -fnon-call-exceptions $flags -DL$name '$(vis_hide)' \
+ -c '$(srcdir)/libgcc2.c' -o $out
+# APPLE LOCAL end libcc_kext move options to start of line for overriding --bowdidge
echo $libgcc_a: $out
echo $libgcc_s_so: $outS
@@ -766,7 +768,8 @@ EOF
fi
# Shared libraries.
- if [ "$libgcc_s_so" ]; then
+ # APPLE LOCAL libcc_kext
+ if [ "$libgcc_s_so" -a "$dir" != "static" -a "$dir" != "kext" ]; then
echo ""
echo "$libgcc_s_so: stmp-dirs $libunwind_so"
echo " $SHLIB_LINK" \
@@ -835,7 +838,8 @@ for ml in $MULTILIBS; do
echo ' $(INSTALL_DATA)' ${dir}/libgcc_eh.a ${ldir}/
echo ' $(RANLIB_FOR_TARGET)' ${ldir}/libgcc_eh.a
- if [ -z "$SHLIB_MULTILIB" ]; then
+ # APPLE LOCAL libcc_kext
+ if [ -z "$SHLIB_MULTILIB" -a "$dir" != "static" -a "$dir" != "kext" ]; then
if [ "$dir" = . ]; then
shlib_base_name=libgcc_s
shlibunwind_base_name=libunwind
diff --git a/gcc/objc/ChangeLog.apple-ppc b/gcc/objc/ChangeLog.apple-ppc
new file mode 100644
index 00000000000..279147dc545
--- /dev/null
+++ b/gcc/objc/ChangeLog.apple-ppc
@@ -0,0 +1,232 @@
+2005-02-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4006978
+ * objc-act.c (objc_is_public): Remove unneeded code.
+
+2005-02-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3635843, 3922342
+ * objc-act.c (OBJC_VERSION): Bump to '6' for the NeXT.
+ (objc_is_gcable_type, objc_substitute_decl,
+ objc_build_ivar_assignment, objc_build_global_assignment,
+ objc_build_strong_cast_assignment, objc_is_gcable_p,
+ objc_is_ivar_reference_p, objc_is_global_reference_p,
+ objc_generate_write_barrier): New functions.
+ (TAG_ASSIGNIVAR, TAG_ASSIGNGLOBAL, TAG_ASSIGNSTRONGCAST,
+ TAG_MSGSEND_FAST, TAG_ASSIGNIVAR_FAST, OFFS_MSGSEND_FAST,
+ OFFS_ASSIGNIVAR_FAST): New macros.
+ (synth_module_prologue): Synthesize 'objc_msgSend_Fast'
+ function prototype.
+ (build_next_objc_exception_stuff): Synthesize
+ 'objc_assign_ivar', 'objc_assign_ivar_Fast',
+ 'objc_assign_global' and 'objc_assign_strongCast'
+ function prototypes.
+ (build_objc_method_call): Call 'objc_msgSend_Fast'
+ instead of 'objc_msgSend' if '-fobjc-direct-dispatch'
+ has been specified.
+ (finish_objc): Generate image info if '-fobjc-gc'
+ has been specified.
+ (generate_objc_image_info): Set a bit indicating if
+ '-fobjc-gc' has been specified.
+ * objc-act.h (OCTI_UMSG_FAST_DECL, OCTI_ASSIGN_IVAR_DECL,
+ OCTI_ASSIGN_IVAR_FAST_DECL, OCTI_ASSIGN_GLOBAL_DECL,
+ OCTI_ASSIGN_STRONGCAST_DECL): New enum slots.
+ (umsg_fast_decl, objc_assign_ivar_decl,
+ objc_assign_ivar_fast_decl, objc_assign_global_decl,
+ objc_assign_strong_cast_decl): New slot accessors.
+
+2005-02-11 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3962013 (Part 2)
+ * objc-act.c (objc_types_share_size_and_alignment): New
+ function.
+ (check_duplicates): Update comment.
+ (comp_proto_with_proto): If types do not match, call
+ objc_types_share_size_and_alignment() as a fallback in
+ non-strict mode.
+
+2005-02-11 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3978619
+ * objc-act.c (should_call_super_dealloc): New variable.
+ (objc_finish_message_expr): If calling [super dealloc],
+ clear the should_call_super_dealloc variable.
+ (start_method_def): If defining a 'dealloc' method in a
+ non-root class, set the should_call_super_dealloc variable.
+ (objc_finish_method_definition): Print a warning if
+ the should_call_super_dealloc is set.
+
+2005-02-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3982256
+ * objc-act.c: Update copyright notice; include langhooks-def.h.
+ (objc_types_compatible_p): New lang hook function.
+ * objc-act.h: Update copyright notice.
+ (objc_types_compatible_p): New prototype.
+ * objc-lang.c: Update copyright notice.
+ (LANG_HOOKS_TYPES_COMPATIBLE_P): Point at objc_types_compatible_p().
+
+2005-02-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3987972
+ * objc-act.c (objc_start_function): Reset
+ 'current_function_returns_value' and 'current_function_returns_null'
+ global flags.
+
+2005-01-30 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3962013
+ * objc-act.c (comp_proto_with_proto): Add a STRICT parameter
+ to allow for relaxed type comparisons.
+ (check_duplicates): If '-Wno-strict-selector-match' is specified,
+ do not warn about multiple method signatures if they differ only
+ in their ObjC types.
+ (add_method_to_hash_list, objc_add_method, really_start_method):
+ Adjust calls to comp_proto_with_proto().
+
+2005-01-27 Matt Austern <austern@apple.com>
+
+ Radar 3971445
+ * objc-act.c (objc_finish_file): In Objective-C++ mode, set at_eof
+ before calling instantiate_pending_templates.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ * objc-act.c (objc_get_class_reference): Move stray
+ APPLE LOCAL marker.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3955336
+ * objc-act.c (objc_get_class_reference): In Objective-C++,
+ make sure a type is declared in the global namespace before
+ looking it up as an ObjC class.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3953044 (PR objc/19321)
+ * objc-act.c (get_arg_type_list): Decay function arguments into
+ pointers.
+ (objc_push_parm): Likewise; bring PARM_DECL construction closer
+ in line with what the C front-end does.
+ (objc_get_parm_info): Call pushdecl() and finish_decl() on
+ each PARM_DECL, like the C front-end does.
+ (start_method_def): Remove redundant ARRAY_TYPE decay.
+ (objc_start_function): Bring closer in line with what the
+ C front-end does for functions.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3951689
+ * objc-act.c (next_sjlj_build_enter_and_setjmp): For
+ Objective-C++, convert _setjmp() argument to type the
+ function expects.
+ (objc_finish_try_stmt, objc_build_synchronized): Return
+ the resulting statement node.
+
+2005-01-14 Mike Stump <mrs@apple.com>
+
+ Radar 3948135
+ * lang-specs.h ("@objective-c"): Use cc1obj when -E is used so
+ that -fzero-link is accepted.
+
+2005-01-12 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3882153
+ * objc-act.c (objc_finish_file): Do not synthesize metadata
+ when generating a PCH file.
+
+2005-01-11 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3918079
+ * objc-act.c (OBJC_LOOKUP_CLASS, OBJC_LOOKUP_NO_SUPER): New
+ flags.
+ (lookup_method_static): Generalize third argument to indicate
+ whether to search superclasses for a method.
+ (really_start_method): When looking for matching method in
+ the @interface, do not look in superclasses.
+
+2005-01-06 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3925982
+ * objc-act.c (objc_method_parm_type): Return the type found
+ rather than its main variant.
+ (encode_aggregate_within): Streamline util_obstack accesses;
+ allow for records and/or pointers thereto to be const-qualified.
+
+2005-01-03 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3926282 (PR objc/18971)
+ * objc-act.c (get_arg_type_list, start_method_def): Decay
+ array arguments into pointers.
+ (gen_type_name_0): Learn to pretty-print array types.
+
+2004-11-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3761423
+ * objc-act.c (build_private_template): Return 'void';
+ move fix for Radar 3261135 from continue_class().
+ (objc_is_public): Robustify for use with ObjC++; examine
+ "raw" ivars of the ObjC class instead of side-effected
+ fields of the underlying struct.
+ (continue_class): Return "raw" ivar list instead of
+ struct field list; move Radar 3261135 to
+ build_private_template(), and call it.
+
+2004-11-01 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 2810013 (fix from mainline)
+ * objc-act.c (objc_lookup_ivar): The new OTHER parameter
+ contains the result of the ID lookup by the C or C++
+ front-end; in class methods, use OTHER if it exists;
+ in instance methods, use OTHER only if it is locally
+ declared.
+
+2004-10-27 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3854155
+ * objc-act.c (generate_shared_structures): Add a CLS_FLAGS
+ parameter whose value gets ORed into the INFO field of
+ the class descriptor.
+ (CLS_HAS_CXX_STRUCTORS): New metadata bit.
+ (objc_generate_cxx_cdtors): Set flag in current imp_entry
+ if either '-.cxx_construct' or '-.cxx_destruct' were
+ synthesized...
+ (continue_class): ...after initially clearing it herre.
+ (finish_objc): Adjust call to generate_shared_structures(),
+ passing in CLS_HAS_CXX_STRUCTORS for classes with non-POD
+ ivars.
+ * objc-act.h (struct imp_entry): New has_cxx_cdtors field.
+
+2004-10-26 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3833116 (fix from mainline)
+ * objc-act.c (finish_class): Do not synthesize bogus
+ 'extern objc_object *_Foo;' declarations for @interface Foo.
+
+2004-10-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ Radar 3845826 (PR objc/17923)
+ * objc-act.c (objc_build_string_object): Create a CONST_DECL
+ for the NeXT runtime case.
+
+2004-10-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3540965
+ * objc-act.c (objc_generate_cxx_ctor_or_dtor,
+ objc_generate_cxx_cdtors): New functions.
+ (TAG_CXX_CONSTRUCT, TAG_CXX_DESTRUCT): New macros.
+ (objc_finish_implementation): Call objc_generate_cxx_cdtors()
+ if -fobjc-call-cxx-cdtors has been specified.
+ (add_instance_variable): Emit different diagnostics for
+ -fobjc-call-cxx-cdtors than for -fno-objc-call-cxx-cdtors.
+
+2004-10-13 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3677258
+ * objc-act.c (add_class): Add a 'name' parameter, and point it
+ back at 'class' via IDENTIFIER_INTERFACE_VALUE accessor.
+ (lookup_interface): Look in IDENTIFIER_INTERFACE_VALUE accessor
+ instead of searching for class in a list.
+ (start_class): Adjust calls to add_class().
+ * objc-act.h (IDENTIFIER_INTERFACE_VALUE): Reformat.
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index 08909437aa6..19e21946728 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -49,31 +49,47 @@ objc-warn = $(STRICT_WARN)
# Bison-1.75 output yields (harmless) -Wtraditional warnings
objc/objc-parse.o-warn = -Wno-error
+# APPLE LOCAL begin order files --ilr
+ifeq ($(ORDER_FILES),yes)
+CC1OBJ_ORDER_FLAGS = `if [ -f $(srcdir)/../order-files/cc1obj.order ]; then \
+ echo -sectorder __TEXT __text $(srcdir)/../order-files/cc1obj.order -e start ; fi`
+else
+CC1OBJ_ORDER_FLAGS =
+endif
+# APPLE LOCAL end order files --ilr
+
# Language-specific object files for Objective C.
OBJC_OBJS = objc/objc-lang.o objc/objc-parse.o objc/objc-act.o
+# APPLE LOCAL begin order files --ilr
cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
- $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBS)
+ $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBS) \
+ $(CC1OBJ_ORDER_FLAGS)
+# APPLE LOCAL end order files --ilr
# Objective C language specific files.
+# APPLE LOCAL begin Radar 4015820
objc/objc-lang.o : objc/objc-lang.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(C_TREE_H) $(C_PRETTY_PRINT_H) $(DIAGNOSTIC_H) \
$(GGC_H) langhooks.h $(LANGHOOKS_DEF_H) $(C_COMMON_H) gtype-objc.h \
- c-objc-common.h objc/objc-act.h
+ c-objc-common.h objc/objc-act.h tree-gimple.h
+# APPLE LOCAL end Radar 4015820
objc/objc-parse.o : objc/objc-parse.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
toplev.h $(GGC_H) input.h flags.h output.h langhooks.h $(C_COMMON_H) \
$(C_PRAGMA_H)
+# APPLE LOCAL begin Radar 4015820
objc/objc-act.o : objc/objc-act.c \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_H) \
$(EXPR_H) $(TARGET_H) $(C_TREE_H) diagnostic.h toplev.h flags.h \
objc/objc-act.h input.h function.h output.h debug.h langhooks.h \
- $(LANGHOOKS_DEF_H) $(HASHTAB_H) c-pragma.h gt-objc-objc-act.h
+ $(LANGHOOKS_DEF_H) $(HASHTAB_H) c-pragma.h gt-objc-objc-act.h tree-gimple.h
+# APPLE LOCAL end Radar 4015820
objc.srcextra: objc/objc-parse.c objc/objc-parse.y
-cp -p $^ $(srcdir)/objc
diff --git a/gcc/objc/config-lang.in b/gcc/objc/config-lang.in
index 72de2ffc59d..8ca93dc1263 100644
--- a/gcc/objc/config-lang.in
+++ b/gcc/objc/config-lang.in
@@ -32,7 +32,11 @@ compilers="cc1obj\$(exeext)"
stagestuff="cc1obj\$(exeext)"
-target_libs=target-libobjc
+# APPLE LOCAL begin libobjc
+# We use libobjc4 instead. To build libobjc anyway, add
+# '--enable-libobjc' to the 'configure' command line.
+# target_libs=target-libobjc
+# APPLE LOCAL end libobjc
# Most of the object files for cc1obj actually come from C.
lang_requires="c"
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index e6201afbad5..4a4d6b331bf 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -77,6 +77,10 @@ Boston, MA 02111-1307, USA. */
#define OBJC_VOID_AT_END void_list_node
+/* APPLE LOCAL begin ObjC super dealloc */
+static unsigned int should_call_super_dealloc = 0;
+/* APPLE LOCAL end ObjC super dealloc */
+
/* When building Objective-C++, we are not linking against the C front-end
and so need to replicate the C tree-construction functions in some way. */
#ifdef OBJCPLUS
@@ -126,7 +130,8 @@ char *util_firstobj;
the module (file) was compiled for, and is recorded in the
module descriptor. */
-#define OBJC_VERSION (flag_next_runtime ? 5 : 8)
+/* APPLE LOCAL ObjC GC */
+#define OBJC_VERSION (flag_next_runtime ? 6 : 8)
#define PROTOCOL_VERSION 2
/* (Decide if these can ever be validly changed.) */
@@ -175,6 +180,17 @@ static tree get_super_receiver (void);
static void build_objc_exception_stuff (void);
static void build_next_objc_exception_stuff (void);
+/* APPLE LOCAL begin ObjC GC */
+static int objc_is_gcable_type (tree, int);
+static tree objc_substitute_decl (tree, tree, tree);
+static tree objc_build_ivar_assignment (tree, tree, tree);
+static tree objc_build_global_assignment (tree, tree);
+static tree objc_build_strong_cast_assignment (tree, tree);
+static int objc_is_gcable_p (tree);
+static int objc_is_ivar_reference_p (tree);
+static int objc_is_global_reference_p (tree);
+/* APPLE LOCAL end ObjC GC */
+
static tree build_ivar_template (void);
static tree build_method_template (void);
static void build_private_template (tree);
@@ -190,10 +206,18 @@ static int ivar_list_length (tree);
static tree get_class_ivars (tree);
static void generate_ivar_lists (void);
static void generate_dispatch_tables (void);
-static void generate_shared_structures (void);
+/* APPLE LOCAL ObjC C++ ivars */
+static void generate_shared_structures (int);
static tree generate_protocol_list (tree);
static void build_protocol_reference (tree);
+/* APPLE LOCAL begin ObjC C++ ivars */
+#ifdef OBJCPLUS
+static void objc_generate_cxx_ctor_or_dtor (bool);
+static void objc_generate_cxx_cdtors (void);
+#endif
+/* APPLE LOCAL end ObjC C++ ivars */
+
static tree build_keyword_selector (tree);
static const char *synth_id_with_class_suffix (const char *, tree);
@@ -215,7 +239,8 @@ static void hash_add_attr (hash, tree);
static tree lookup_method (tree, tree);
static tree lookup_method_static (tree, tree, int);
static void add_method_to_hash_list (hash *, tree);
-static tree add_class (tree);
+/* APPLE LOCAL objc speedup --dpatel */
+static tree add_class (tree, tree);
static void add_category (tree, tree);
static inline tree lookup_category (tree, tree);
@@ -256,7 +281,10 @@ static void really_start_method (tree, tree);
static void really_start_method (tree, struct c_arg_info *);
#endif
static int objc_types_are_equivalent (tree, tree);
-static int comp_proto_with_proto (tree, tree);
+/* APPLE LOCAL begin Objective-C */
+static int objc_types_share_size_and_alignment (tree, tree);
+static int comp_proto_with_proto (tree, tree, int);
+/* APPLE LOCAL end Objective-C */
static tree get_arg_type_list (tree, int, int);
static void objc_push_parm (tree);
#ifdef OBJCPLUS
@@ -378,6 +406,8 @@ static const char *default_constant_string_class_name;
/* Runtime metadata flags. */
#define CLS_FACTORY 0x0001L
#define CLS_META 0x0002L
+/* APPLE LOCAL ObjC C++ ivars */
+#define CLS_HAS_CXX_STRUCTORS 0x2000L
#define OBJC_MODIFIER_STATIC 0x00000001
#define OBJC_MODIFIER_FINAL 0x00000002
@@ -405,11 +435,39 @@ static const char *default_constant_string_class_name;
#define TAG_SETJMP "_setjmp"
#define UTAG_EXCDATA "_objc_exception_data"
+/* APPLE LOCAL begin ObjC GC */
+#define TAG_ASSIGNIVAR "objc_assign_ivar"
+#define TAG_ASSIGNGLOBAL "objc_assign_global"
+#define TAG_ASSIGNSTRONGCAST "objc_assign_strongCast"
+/* APPLE LOCAL end ObjC GC */
+
+/* APPLE LOCAL begin ObjC direct dispatch */
+/* Branch entry points. All that matters here are the addresses;
+ functions with these names do not really exist in libobjc. */
+
+#define TAG_MSGSEND_FAST "objc_msgSend_Fast"
+#define TAG_ASSIGNIVAR_FAST "objc_assign_ivar_Fast"
+
+#define OFFS_MSGSEND_FAST 0xFFFEFF00
+#define OFFS_ASSIGNIVAR_FAST 0xFFFEFEC0
+/* APPLE LOCAL end ObjC direct dispatch */
+
+/* APPLE LOCAL begin ObjC C++ ivars */
+#define TAG_CXX_CONSTRUCT ".cxx_construct"
+#define TAG_CXX_DESTRUCT ".cxx_destruct"
+/* APPLE LOCAL end ObjC C++ ivars */
+
/* GNU-specific tags. */
#define TAG_EXECCLASS "__objc_exec_class"
#define TAG_GNUINIT "__objc_gnu_init"
+/* APPLE LOCAL begin Objective-C */
+/* Flags for lookup_method_static(). */
+#define OBJC_LOOKUP_CLASS 1 /* Look for class methods. */
+#define OBJC_LOOKUP_NO_SUPER 2 /* Do not examine superclasses. */
+/* APPLE LOCAL end Objective-C */
+
/* The OCTI_... enumeration itself is in objc/objc-act.h. */
tree objc_global_trees[OCTI_MAX];
@@ -595,10 +653,12 @@ objc_finish_file (void)
instantiate_pending_templates (0);
#endif
+ /* APPLE LOCAL begin Objective-C */
/* Finalize Objective-C runtime data. No need to generate tables
- and code if only checking syntax. */
- if (!flag_syntax_only)
+ and code if only checking syntax, or if generating a PCH file. */
+ if (!flag_syntax_only && !pch_file)
finish_objc ();
+ /* APPLE LOCAL end Objective-C */
if (gen_declaration_file)
fclose (gen_declaration_file);
@@ -746,6 +806,13 @@ objc_continue_implementation (void)
void
objc_finish_implementation (void)
{
+ /* APPLE LOCAL begin ObjC C++ ivars */
+#ifdef OBJCPLUS
+ if (flag_objc_call_cxx_cdtors)
+ objc_generate_cxx_cdtors ();
+#endif
+ /* APPLE LOCAL end ObjC C++ ivars */
+
if (objc_implementation_context)
{
finish_class (objc_implementation_context);
@@ -1439,6 +1506,19 @@ synth_module_prologue (void)
objc_super_type = build_pointer_type (xref_tag (RECORD_TYPE,
get_identifier (TAG_SUPER)));
+ /* APPLE LOCAL begin Objective-C++ */
+ /* Declare pointers to method and ivar lists. */
+ objc_method_list_ptr = build_pointer_type
+ (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_METHOD_LIST)));
+ objc_method_proto_list_ptr
+ = build_pointer_type (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_METHOD_PROTOTYPE_LIST)));
+ objc_ivar_list_ptr = build_pointer_type
+ (xref_tag (RECORD_TYPE,
+ get_identifier (UTAG_IVAR_LIST)));
+ /* APPLE LOCAL end Objective-C++ */
+
if (flag_next_runtime)
{
/* NB: In order to call one of the ..._stret (struct-returning)
@@ -1468,6 +1548,23 @@ synth_module_prologue (void)
type, 0, NOT_BUILT_IN,
NULL, NULL_TREE);
+ /* APPLE LOCAL begin ObjC direct dispatch */
+ /* id objc_msgSend_Fast (id, SEL, ...)
+ __attribute__ ((hard_coded_address (OFFS_MSGSEND_FAST))); */
+#ifdef TARGET_POWERPC
+ umsg_fast_decl = builtin_function (TAG_MSGSEND_FAST,
+ type, 0, NOT_BUILT_IN,
+ NULL, NULL_TREE);
+ DECL_ATTRIBUTES (umsg_fast_decl)
+ = tree_cons (get_identifier ("hard_coded_address"),
+ build_int_cst (NULL_TREE, OFFS_MSGSEND_FAST),
+ NULL_TREE);
+#else
+ /* Not needed on x86 (at least for now). */
+ umsg_fast_decl = umsg_decl;
+#endif
+ /* APPLE LOCAL end ObjC direct dispatch */
+
/* id objc_msgSendSuper (struct objc_super *, SEL, ...); */
/* id objc_msgSendSuper_stret (struct objc_super *, SEL, ...); */
type
@@ -1674,6 +1771,15 @@ objc_build_string_object (tree string)
TREE_SET_CODE (string, STRING_CST);
length = TREE_STRING_LENGTH (string) - 1;
+ /* APPLE LOCAL begin constant cfstrings */
+ /* The target may have different ideas on how to construct an
+ ObjC string literal. On Darwin (Mac OS X), for example,
+ we may wish to obtain a constant CFString reference instead. */
+ constructor = (*targetm.construct_objc_string) (string);
+ if (constructor)
+ return build_c_cast (objc_object_type, constructor);
+ /* APPLE LOCAL end constant cfstrings */
+
/* Check whether the string class being used actually exists and has the
correct ivar layout. */
if (!string_layout_checked)
@@ -2548,17 +2654,28 @@ tree
objc_get_class_reference (tree ident)
{
tree orig_ident;
+ /* APPLE LOCAL Objective-C++ */
+ bool local_scope = false;
#ifdef OBJCPLUS
if (processing_template_decl)
/* Must wait until template instantiation time. */
return build_min_nt (CLASS_REFERENCE_EXPR, ident);
if (TREE_CODE (ident) == TYPE_DECL)
- ident = DECL_NAME (ident);
+ /* APPLE LOCAL begin Objective-C++ */
+ {
+ /* The type must exist in the global namespace. */
+ if (DECL_CONTEXT (ident) && DECL_CONTEXT (ident) != global_namespace)
+ local_scope = true;
+
+ ident = DECL_NAME (ident);
+ }
+ /* APPLE LOCAL end Objective-C++ */
#endif
orig_ident = ident;
- if (!(ident = objc_is_class_name (ident)))
+ /* APPLE LOCAL Objective-C++ */
+ if (local_scope || !(ident = objc_is_class_name (ident)))
{
error ("%qs is not an Objective-C class name or alias",
IDENTIFIER_POINTER (orig_ident));
@@ -2806,21 +2923,290 @@ objc_is_object_ptr (tree type)
return ret;
}
+/* APPLE LOCAL begin ObjC GC */
+static int
+objc_is_gcable_type (tree type, int or_strong_p)
+{
+ tree name;
+
+ if (!TYPE_P (type))
+ return 0;
+ if (objc_is_id (TYPE_MAIN_VARIANT (type)))
+ return 1;
+ if (or_strong_p && lookup_attribute ("objc_gc", TYPE_ATTRIBUTES (type)))
+ return 1;
+ if (TREE_CODE (type) != POINTER_TYPE && TREE_CODE (type) != INDIRECT_REF)
+ return 0;
+ type = TREE_TYPE (type);
+ if (TREE_CODE (type) != RECORD_TYPE)
+ return 0;
+ name = TYPE_NAME (type);
+ return (objc_is_class_name (name) != NULL_TREE);
+}
+
+static tree
+objc_substitute_decl (tree expr, tree oldexpr, tree newexpr)
+{
+ if (expr == oldexpr)
+ return newexpr;
+
+ switch (TREE_CODE (expr))
+ {
+ case COMPONENT_REF:
+ return build_component_ref (objc_substitute_decl (TREE_OPERAND (expr, 0),
+ oldexpr,
+ newexpr),
+ DECL_NAME (TREE_OPERAND (expr, 1)));
+ case ARRAY_REF:
+ return build_array_ref (objc_substitute_decl (TREE_OPERAND (expr, 0),
+ oldexpr,
+ newexpr),
+ TREE_OPERAND (expr, 1));
+ case INDIRECT_REF:
+ return build_indirect_ref (objc_substitute_decl (TREE_OPERAND (expr, 0),
+ oldexpr,
+ newexpr), "->");
+ default:
+ return expr;
+ }
+}
+
+static tree
+objc_build_ivar_assignment (tree outervar, tree lhs, tree rhs)
+{
+ tree func_params;
+ /* The LHS parameter contains the expression 'outervar->memberspec';
+ we need to transform it into '&((typeof(outervar) *) 0)->memberspec',
+ where memberspec may be arbitrarily complex (e.g., 'g->f.d[2].g[3]').
+ */
+ tree offs
+ = objc_substitute_decl
+ (lhs, outervar, convert (TREE_TYPE (outervar), integer_zero_node));
+ tree func
+ = (flag_objc_direct_dispatch
+ ? objc_assign_ivar_fast_decl
+ : objc_assign_ivar_decl);
+
+ offs = convert (integer_type_node, build_unary_op (ADDR_EXPR, offs, 0));
+ offs = fold (offs);
+ func_params = tree_cons (NULL_TREE,
+ convert (objc_object_type, rhs),
+ tree_cons (NULL_TREE, convert (objc_object_type, outervar),
+ tree_cons (NULL_TREE, offs,
+ NULL_TREE)));
+
+ assemble_external (func);
+ return build_function_call (func, func_params);
+}
+
+static tree
+objc_build_global_assignment (tree lhs, tree rhs)
+{
+ tree func_params = tree_cons (NULL_TREE,
+ convert (objc_object_type, rhs),
+ tree_cons (NULL_TREE, convert (build_pointer_type (objc_object_type),
+ build_unary_op (ADDR_EXPR, lhs, 0)),
+ NULL_TREE));
+
+ assemble_external (objc_assign_global_decl);
+ return build_function_call (objc_assign_global_decl, func_params);
+}
+
+static tree
+objc_build_strong_cast_assignment (tree lhs, tree rhs)
+{
+ tree func_params = tree_cons (NULL_TREE,
+ convert (objc_object_type, rhs),
+ tree_cons (NULL_TREE, convert (build_pointer_type (objc_object_type),
+ build_unary_op (ADDR_EXPR, lhs, 0)),
+ NULL_TREE));
+
+ assemble_external (objc_assign_strong_cast_decl);
+ return build_function_call (objc_assign_strong_cast_decl, func_params);
+}
+
+static int
+objc_is_gcable_p (tree expr)
+{
+ return (TREE_CODE (expr) == COMPONENT_REF
+ ? objc_is_gcable_p (TREE_OPERAND (expr, 1))
+ : TREE_CODE (expr) == ARRAY_REF
+ ? (objc_is_gcable_p (TREE_TYPE (expr))
+ || objc_is_gcable_p (TREE_OPERAND (expr, 0)))
+ : TREE_CODE (expr) == ARRAY_TYPE
+ ? objc_is_gcable_p (TREE_TYPE (expr))
+ : TYPE_P (expr)
+ ? objc_is_gcable_type (expr, 1)
+ : (objc_is_gcable_p (TREE_TYPE (expr))
+ || (DECL_P (expr)
+ && lookup_attribute ("objc_gc", DECL_ATTRIBUTES (expr)))));
+}
+
+static int
+objc_is_ivar_reference_p (tree expr)
+{
+ return (TREE_CODE (expr) == ARRAY_REF
+ ? objc_is_ivar_reference_p (TREE_OPERAND (expr, 0))
+ : TREE_CODE (expr) == COMPONENT_REF
+ ? TREE_CODE (TREE_OPERAND (expr, 1)) == FIELD_DECL
+ : 0);
+}
+
+static int
+objc_is_global_reference_p (tree expr)
+{
+ return (TREE_CODE (expr) == INDIRECT_REF || TREE_CODE (expr) == PLUS_EXPR
+ ? objc_is_global_reference_p (TREE_OPERAND (expr, 0))
+ : DECL_P (expr)
+ ? (!DECL_CONTEXT (expr) || TREE_STATIC (expr))
+ : 0);
+}
+
+tree
+objc_generate_write_barrier (tree lhs, enum tree_code modifycode, tree rhs)
+{
+ tree result = NULL_TREE, outer;
+ int strong_cast_p = 0, outer_gc_p = 0, indirect_p = 0;
+
+ /* See if we have any lhs casts, and strip them out. NB: The lvalue casts
+ will have been transformed to the form '*(type *)&expr'. */
+ if (TREE_CODE (lhs) == INDIRECT_REF)
+ {
+ outer = TREE_OPERAND (lhs, 0);
+
+ while (!strong_cast_p
+ && (TREE_CODE (outer) == CONVERT_EXPR
+ || TREE_CODE (outer) == NOP_EXPR
+ || TREE_CODE (outer) == NON_LVALUE_EXPR))
+ {
+ tree lhstype = TREE_TYPE (outer);
+
+ /* Descend down the cast chain, and record the first objc_gc
+ attribute found. */
+ if (POINTER_TYPE_P (lhstype))
+ {
+ tree attr
+ = lookup_attribute ("objc_gc",
+ TYPE_ATTRIBUTES (TREE_TYPE (lhstype)));
+
+ if (attr)
+ strong_cast_p = 1;
+ }
+
+ outer = TREE_OPERAND (outer, 0);
+ }
+ }
+
+ /* If we have a __strong cast, it trumps all else. */
+ if (strong_cast_p)
+ {
+ if (modifycode != NOP_EXPR)
+ goto invalid_pointer_arithmetic;
+
+ if (warn_assign_intercept)
+ warning ("strong-cast assignment has been intercepted");
+
+ result = objc_build_strong_cast_assignment (lhs, rhs);
+
+ goto exit_point;
+ }
+
+ /* the lhs must be of a suitable type, regardless of its underlying
+ structure. */
+ if (!objc_is_gcable_p (lhs))
+ goto exit_point;
+
+ outer = lhs;
+
+ while (outer
+ && (TREE_CODE (outer) == COMPONENT_REF
+ || TREE_CODE (outer) == ARRAY_REF))
+ outer = TREE_OPERAND (outer, 0);
+
+ if (TREE_CODE (outer) == INDIRECT_REF)
+ {
+ outer = TREE_OPERAND (outer, 0);
+ indirect_p = 1;
+ }
+
+ outer_gc_p = objc_is_gcable_p (outer);
+
+ /* Handle ivar assignments. */
+ if (objc_is_ivar_reference_p (lhs))
+ {
+ /* if the struct to the left of the ivar is not an Objective-C object (__strong
+ doesn't cut it here), the best we can do here is suggest a cast. */
+ if (!objc_is_gcable_type (TREE_TYPE (outer), 0))
+ {
+ /* We may still be able to use the global write barrier... */
+ if (!indirect_p && objc_is_global_reference_p (outer))
+ goto global_reference;
+
+ suggest_cast:
+ if (modifycode == NOP_EXPR)
+ {
+ if (warn_assign_intercept)
+ warning ("strong-cast may possibly be needed");
+ }
+
+ goto exit_point;
+ }
+
+ if (modifycode != NOP_EXPR)
+ goto invalid_pointer_arithmetic;
+
+ if (warn_assign_intercept)
+ warning ("instance variable assignment has been intercepted");
+
+ result = objc_build_ivar_assignment (outer, lhs, rhs);
+
+ goto exit_point;
+ }
+
+ /* Likewise, intercept assignment to global/static variables if their type is
+ GC-marked. */
+ if (objc_is_global_reference_p (outer))
+ {
+ if (indirect_p)
+ goto suggest_cast;
+
+ global_reference:
+ if (modifycode != NOP_EXPR)
+ {
+ invalid_pointer_arithmetic:
+ if (outer_gc_p)
+ warning ("pointer arithmetic for garbage-collected objects not allowed");
+
+ goto exit_point;
+ }
+
+ if (warn_assign_intercept)
+ warning ("global/static variable assignment has been intercepted");
+
+ result = objc_build_global_assignment (lhs, rhs);
+ }
+
+ /* In all other cases, fall back to the normal mechanism. */
+ exit_point:
+ return result;
+}
+/* APPLE LOCAL end ObjC GC */
+
static tree
lookup_interface (tree ident)
{
- tree chain;
+ /* APPLE LOCAL objc speedup --dpatel */
+ /* tree chain; */
#ifdef OBJCPLUS
if (ident && TREE_CODE (ident) == TYPE_DECL)
ident = DECL_NAME (ident);
#endif
- for (chain = interface_chain; chain; chain = TREE_CHAIN (chain))
- {
- if (ident == CLASS_NAME (chain))
- return chain;
- }
- return NULL_TREE;
+ /* APPLE LOCAL begin objc speedup --dpatel */
+ return (ident && TREE_CODE (ident) == IDENTIFIER_NODE
+ ? IDENTIFIER_INTERFACE_VALUE (ident)
+ : NULL_TREE);
+ /* APPLE LOCAL end objc speedup --dpatel */
}
/* Implement @defs (<classname>) within struct bodies. */
@@ -3014,6 +3400,14 @@ next_sjlj_build_enter_and_setjmp (void)
t = build_component_ref (cur_try_context->stack_decl,
get_identifier ("buf"));
t = build_fold_addr_expr (t);
+ /* APPLE LOCAL begin Objective-C++ */
+#ifdef OBJCPLUS
+ /* Convert _setjmp argument to type that is expected. */
+ if (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl)))
+ t = convert (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (objc_setjmp_decl))), t);
+ else
+#endif
+ /* APPLE LOCAL end Objective-C++ */
t = convert (ptr_type_node, t);
t = tree_cons (NULL, t, NULL);
sj = build_function_call (objc_setjmp_decl, t);
@@ -3336,7 +3730,8 @@ objc_build_finally_clause (location_t finally_locus, tree body)
/* Called to finalize a @try construct. */
-void
+/* APPLE LOCAL Objective-C++ */
+tree
objc_finish_try_stmt (void)
{
struct objc_try_context *c = cur_try_context;
@@ -3374,6 +3769,8 @@ objc_finish_try_stmt (void)
cur_try_context = c->outer;
free (c);
+ /* APPLE LOCAL Objective-C++ */
+ return stmt;
}
tree
@@ -3405,7 +3802,8 @@ objc_build_throw_stmt (tree throw_expr)
return add_stmt (build_function_call (objc_exception_throw_decl, args));
}
-void
+/* APPLE LOCAL Objective-C++ */
+tree
objc_build_synchronized (location_t start_locus, tree mutex, tree body)
{
tree args, call;
@@ -3425,7 +3823,8 @@ objc_build_synchronized (location_t start_locus, tree mutex, tree body)
/* Put the that and the body in a TRY_FINALLY. */
objc_begin_try_stmt (start_locus, body);
objc_build_finally_clause (input_location, call);
- objc_finish_try_stmt ();
+ /* APPLE LOCAL Objective-C++ */
+ return objc_finish_try_stmt ();
}
@@ -3507,6 +3906,44 @@ build_next_objc_exception_stuff (void)
OBJC_VOID_AT_END)));
objc_exception_match_decl
= builtin_function (TAG_EXCEPTIONMATCH, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+
+ /* APPLE LOCAL begin ObjC GC */
+ /* id objc_assign_ivar (id, id, unsigned int); */
+ /* id objc_assign_ivar_Fast (id, id, unsigned int)
+ __attribute__ ((hard_coded_address (OFFS_ASSIGNIVAR_FAST))); */
+ temp_type
+ = build_function_type (objc_object_type,
+ tree_cons
+ (NULL_TREE, objc_object_type,
+ tree_cons (NULL_TREE, objc_object_type,
+ tree_cons (NULL_TREE,
+ unsigned_type_node,
+ OBJC_VOID_AT_END))));
+ objc_assign_ivar_decl
+ = builtin_function (TAG_ASSIGNIVAR, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+#ifdef TARGET_POWERPC
+ objc_assign_ivar_fast_decl
+ = builtin_function (TAG_ASSIGNIVAR_FAST, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ DECL_ATTRIBUTES (objc_assign_ivar_fast_decl)
+ = tree_cons (get_identifier ("hard_coded_address"),
+ build_int_cst (NULL_TREE, OFFS_ASSIGNIVAR_FAST),
+ NULL_TREE);
+#else
+ /* Not needed on x86 (at least for now). */
+ objc_assign_ivar_fast_decl = objc_assign_ivar_decl;
+#endif
+
+ /* id objc_assign_global (id, id *); */
+ /* id objc_assign_strongCast (id, id *); */
+ temp_type = build_function_type (objc_object_type,
+ tree_cons (NULL_TREE, objc_object_type,
+ tree_cons (NULL_TREE, build_pointer_type (objc_object_type),
+ OBJC_VOID_AT_END)));
+ objc_assign_global_decl
+ = builtin_function (TAG_ASSIGNGLOBAL, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ objc_assign_strong_cast_decl
+ = builtin_function (TAG_ASSIGNSTRONGCAST, temp_type, 0, NOT_BUILT_IN, NULL, NULL_TREE);
+ /* APPLE LOCAL end ObjC GC */
}
static void
@@ -3554,6 +3991,14 @@ build_private_template (tree class)
INIT_TYPE_OBJC_INFO (record);
TYPE_OBJC_INTERFACE (record) = class;
CLASS_STATIC_TEMPLATE (class) = record;
+
+ /* APPLE LOCAL begin NSFoundation classes not included in -gused (radar #3261135) */
+ /* FSF Candidate */
+ /* Set the TREE_USED bit for this struct, so that stab generator can emit
+ stabs for this struct type. */
+ if (flag_debug_only_used_symbols && TYPE_STUB_DECL (record))
+ TREE_USED (TYPE_STUB_DECL (record)) = 1;
+ /* APPLE LOCAL end NSFoundation classes not included in -gused (radar #3261135) */
}
}
@@ -3593,20 +4038,18 @@ build_protocol_template (void)
"protocol_list");
chainon (field_decl_chain, field_decl);
- /* struct objc_method_list *instance_methods; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- (UTAG_METHOD_PROTOTYPE_LIST))),
+ /* APPLE LOCAL begin Objective-C++ */
+ /* struct _objc__method_prototype_list *instance_methods; */
+ field_decl = create_field_decl (objc_method_proto_list_ptr,
"instance_methods");
+ /* APPLE LOCAL end Objective-C++ */
chainon (field_decl_chain, field_decl);
- /* struct objc_method_list *class_methods; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- (UTAG_METHOD_PROTOTYPE_LIST))),
+ /* APPLE LOCAL begin Objective-C++ */
+ /* struct _objc__method_prototype_list *class_methods; */
+ field_decl = create_field_decl (objc_method_proto_list_ptr,
"class_methods");
+ /* APPLE LOCAL end Objective-C++ */
chainon (field_decl_chain, field_decl);
finish_struct (objc_protocol_template, field_decl_chain, NULL_TREE);
@@ -3706,7 +4149,8 @@ objc_method_parm_type (tree type)
type = TREE_VALUE (TREE_TYPE (type));
if (TREE_CODE (type) == TYPE_DECL)
type = TREE_TYPE (type);
- return TYPE_MAIN_VARIANT (type);
+ /* APPLE LOCAL Objective-C */
+ return type;
}
static int
@@ -3884,6 +4328,137 @@ generate_protocol_references (tree plist)
}
}
+/* APPLE LOCAL begin ObjC C++ ivars */
+/* Generate either '- .cxx_construct' or '- .cxx_destruct' for the
+ current class. */
+#ifdef OBJCPLUS
+static void
+objc_generate_cxx_ctor_or_dtor (bool dtor)
+{
+ tree fn, body, compound_stmt, ivar;
+
+ /* - (id) .cxx_construct { ... return self; } */
+ /* - (void) .cxx_construct { ... } */
+
+ objc_set_method_type (MINUS_EXPR);
+ objc_start_method_definition
+ (objc_build_method_signature (build_tree_list (NULL_TREE,
+ dtor
+ ? void_type_node
+ : objc_object_type),
+ get_identifier (dtor
+ ? TAG_CXX_DESTRUCT
+ : TAG_CXX_CONSTRUCT),
+ make_node (TREE_LIST)));
+ body = begin_function_body ();
+ compound_stmt = begin_compound_stmt (0);
+
+ ivar = CLASS_IVARS (implementation_template);
+ /* Destroy ivars in reverse order. */
+ if (dtor)
+ ivar = nreverse (copy_list (ivar));
+
+ for (; ivar; ivar = TREE_CHAIN (ivar))
+ {
+ if (TREE_CODE (ivar) == FIELD_DECL)
+ {
+ tree type = TREE_TYPE (ivar);
+
+ /* Call the ivar's default constructor or destructor. Do not
+ call the destructor unless a corresponding constructor call
+ has also been made (or is not needed). */
+ if (IS_AGGR_TYPE (type)
+ && (dtor
+ ? (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
+ && (!TYPE_NEEDS_CONSTRUCTING (type)
+ || TYPE_HAS_DEFAULT_CONSTRUCTOR (type)))
+ : (TYPE_NEEDS_CONSTRUCTING (type)
+ && TYPE_HAS_DEFAULT_CONSTRUCTOR (type))))
+ finish_expr_stmt
+ (build_special_member_call
+ (build_ivar_reference (DECL_NAME (ivar)),
+ dtor ? complete_dtor_identifier : complete_ctor_identifier,
+ NULL_TREE, type, LOOKUP_NORMAL));
+ }
+ }
+
+ /* The constructor returns 'self'. */
+ if (!dtor)
+ finish_return_stmt (self_decl);
+
+ finish_compound_stmt (compound_stmt);
+ finish_function_body (body);
+ fn = current_function_decl;
+ finish_function ();
+ objc_finish_method_definition (fn);
+}
+
+/* The following routine will examine the current @interface for any
+ non-POD C++ ivars requiring non-trivial construction and/or
+ destruction, and then synthesize special '- .cxx_construct' and/or
+ '- .cxx_destruct' methods which will run the appropriate
+ construction or destruction code. Note that ivars inherited from
+ super-classes are _not_ considered. */
+static void
+objc_generate_cxx_cdtors (void)
+{
+ bool need_ctor = false, need_dtor = false;
+ tree ivar;
+
+ /* We do not want to do this for categories, since they do not have
+ their own ivars. */
+
+ if (TREE_CODE (objc_implementation_context) != CLASS_IMPLEMENTATION_TYPE)
+ return;
+
+ /* First, determine if we even need a constructor and/or destructor. */
+
+ for (ivar = CLASS_IVARS (implementation_template); ivar;
+ ivar = TREE_CHAIN (ivar))
+ {
+ if (TREE_CODE (ivar) == FIELD_DECL)
+ {
+ tree type = TREE_TYPE (ivar);
+
+ if (IS_AGGR_TYPE (type))
+ {
+ if (TYPE_NEEDS_CONSTRUCTING (type)
+ && TYPE_HAS_DEFAULT_CONSTRUCTOR (type))
+ /* NB: If a default constructor is not available, we will not
+ be able to initialize this ivar; the add_instance_variable()
+ routine will already have warned about this. */
+ need_ctor = true;
+
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (type)
+ && (!TYPE_NEEDS_CONSTRUCTING (type)
+ || TYPE_HAS_DEFAULT_CONSTRUCTOR (type)))
+ /* NB: If a default constructor is not available, we will not
+ call the destructor either, for symmetry. */
+ need_dtor = true;
+ }
+ }
+ }
+
+ /* Generate '- .cxx_construct' if needed. */
+
+ if (need_ctor)
+ objc_generate_cxx_ctor_or_dtor (false);
+
+ /* Generate '- .cxx_destruct' if needed. */
+
+ if (need_dtor)
+ objc_generate_cxx_ctor_or_dtor (true);
+
+ /* The 'imp_list' variable points at an imp_entry record for the current
+ @implementation. Record the existence of '- .cxx_construct' and/or
+ '- .cxx_destruct' methods therein; it will be included in the
+ metadata for the class. */
+ if (flag_next_runtime)
+ imp_list->has_cxx_cdtors = (need_ctor || need_dtor);
+}
+#endif
+/* APPLE LOCAL end ObjC C++ ivars */
+
/* For each protocol which was referenced either from a @protocol()
expression, or because a class/category implements it (then a
pointer to the protocol is stored in the struct describing the
@@ -4017,7 +4592,10 @@ build_protocol_initializer (tree type, tree protocol_name,
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
else
{
- expr = build_unary_op (ADDR_EXPR, instance_methods, 0);
+ /* APPLE LOCAL begin Objective-C++ */
+ expr = convert (objc_method_proto_list_ptr,
+ build_unary_op (ADDR_EXPR, instance_methods, 0));
+ /* APPLE LOCAL end Objective-C++ */
initlist = tree_cons (NULL_TREE, expr, initlist);
}
@@ -4025,7 +4603,10 @@ build_protocol_initializer (tree type, tree protocol_name,
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
else
{
- expr = build_unary_op (ADDR_EXPR, class_methods, 0);
+ /* APPLE LOCAL begin Objective-C++ */
+ expr = convert (objc_method_proto_list_ptr,
+ build_unary_op (ADDR_EXPR, class_methods, 0));
+ /* APPLE LOCAL end Objective-C++ */
initlist = tree_cons (NULL_TREE, expr, initlist);
}
@@ -4057,18 +4638,14 @@ build_category_template (void)
chainon (field_decl_chain, field_decl);
/* struct _objc_method_list *instance_methods; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- (UTAG_METHOD_LIST))),
+ /* APPLE LOCAL Objective-C++ */
+ field_decl = create_field_decl (objc_method_list_ptr,
"instance_methods");
chainon (field_decl_chain, field_decl);
/* struct _objc_method_list *class_methods; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- (UTAG_METHOD_LIST))),
+ /* APPLE LOCAL Objective-C++ */
+ field_decl = create_field_decl (objc_method_list_ptr,
"class_methods");
chainon (field_decl_chain, field_decl);
@@ -4170,18 +4747,14 @@ build_class_template (void)
chainon (field_decl_chain, field_decl);
/* struct _objc_ivar_list *ivars; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- (UTAG_IVAR_LIST))),
+ /* APPLE LOCAL Objective-C++ */
+ field_decl = create_field_decl (objc_ivar_list_ptr,
"ivars");
chainon (field_decl_chain, field_decl);
/* struct _objc_method_list *methods; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- (UTAG_METHOD_LIST))),
+ /* APPLE LOCAL Objective-C++ */
+ field_decl = create_field_decl (objc_method_list_ptr,
"methods");
chainon (field_decl_chain, field_decl);
@@ -4432,10 +5005,8 @@ build_method_list_template (tree list_type, int size)
objc_ivar_list_record = start_struct (RECORD_TYPE, NULL_TREE);
/* struct _objc__method_prototype_list *method_next; */
- field_decl = create_field_decl (build_pointer_type
- (xref_tag (RECORD_TYPE,
- get_identifier
- (UTAG_METHOD_PROTOTYPE_LIST))),
+ /* APPLE LOCAL Objective-C++ */
+ field_decl = create_field_decl (objc_method_proto_list_ptr,
"method_next");
field_decl_chain = field_decl;
@@ -4834,14 +5405,20 @@ build_category_initializer (tree type, tree cat_name, tree class_name,
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
else
{
- expr = build_unary_op (ADDR_EXPR, instance_methods, 0);
+ /* APPLE LOCAL begin Objective-C++ */
+ expr = convert (objc_method_list_ptr,
+ build_unary_op (ADDR_EXPR, instance_methods, 0));
+ /* APPLE LOCAL end Objective-C++ */
initlist = tree_cons (NULL_TREE, expr, initlist);
}
if (!class_methods)
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
else
{
- expr = build_unary_op (ADDR_EXPR, class_methods, 0);
+ /* APPLE LOCAL begin Objective-C++ */
+ expr = convert (objc_method_list_ptr,
+ build_unary_op (ADDR_EXPR, class_methods, 0));
+ /* APPLE LOCAL end Objective-C++ */
initlist = tree_cons (NULL_TREE, expr, initlist);
}
@@ -4917,7 +5494,10 @@ build_shared_structure_initializer (tree type, tree isa, tree super,
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
else
{
- expr = build_unary_op (ADDR_EXPR, ivar_list, 0);
+ /* APPLE LOCAL begin Objective-C++ */
+ expr = convert (objc_ivar_list_ptr,
+ build_unary_op (ADDR_EXPR, ivar_list, 0));
+ /* APPLE LOCAL end Objective-C++ */
initlist = tree_cons (NULL_TREE, expr, initlist);
}
@@ -4926,7 +5506,10 @@ build_shared_structure_initializer (tree type, tree isa, tree super,
initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 0), initlist);
else
{
- expr = build_unary_op (ADDR_EXPR, dispatch_table, 0);
+ /* APPLE LOCAL begin Objective-C++ */
+ expr = convert (objc_method_list_ptr,
+ build_unary_op (ADDR_EXPR, dispatch_table, 0));
+ /* APPLE LOCAL end Objective-C++ */
initlist = tree_cons (NULL_TREE, expr, initlist);
}
@@ -5021,7 +5604,8 @@ generate_category (tree cat)
static struct objc_class _OBJC_CLASS_Foo={ ... }; */
static void
-generate_shared_structures (void)
+/* APPLE LOCAL ObjC C++ ivars */
+generate_shared_structures (int cls_flags)
{
tree sc_spec, decl_specs, decl;
tree name_expr, super_expr, root_expr;
@@ -5112,7 +5696,8 @@ generate_shared_structures (void)
convert (integer_type_node,
TYPE_SIZE_UNIT (CLASS_STATIC_TEMPLATE
(implementation_template))),
- 1 /*CLS_FACTORY*/,
+ /* APPLE LOCAL ObjC C++ ivars */
+ 1 /*CLS_FACTORY*/ | cls_flags,
UOBJC_INSTANCE_METHODS_decl,
UOBJC_INSTANCE_VARIABLES_decl,
protocol_decl);
@@ -5374,6 +5959,22 @@ check_duplicates (hash hsh, int methods, int is_class)
different types. */
attr loop;
+ /* APPLE LOCAL begin Objective-C */
+ /* But just how different are those types? If
+ -Wno-strict-selector-match is specified, we shall not complain
+ if the differences are solely among types with identical
+ size and alignment. */
+ if (!warn_strict_selector_match)
+ {
+ for (loop = hsh->list; loop; loop = loop->next)
+ if (!comp_proto_with_proto (meth, loop->value, 0))
+ goto issue_warning;
+
+ return meth;
+ }
+
+ issue_warning:
+ /* APPLE LOCAL end Objective-C */
warning ("multiple %s named %<%c%s%> found",
methods ? "methods" : "selectors",
(is_class ? '+' : '-'),
@@ -5584,6 +6185,12 @@ objc_finish_message_expr (tree receiver, tree sel_name, tree method_params)
|| (TREE_CODE (receiver) == COMPOUND_EXPR
&& !IS_SUPER (rtype)));
+ /* APPLE LOCAL begin ObjC super dealloc */
+ /* If we are calling [super dealloc], reset our warning flag. */
+ if (super && !strcmp ("dealloc", IDENTIFIER_POINTER (sel_name)))
+ should_call_super_dealloc = 0;
+ /* APPLE LOCAL end ObjC super dealloc */
+
/* If the receiver is a class object, retrieve the corresponding
@interface, if one exists. */
class_tree = receiver_is_class_object (receiver, self, super);
@@ -5785,7 +6392,11 @@ build_objc_method_call (int super_flag, tree method_prototype,
{
tree sender = (super_flag ? umsg_super_decl :
(!flag_next_runtime || flag_nil_receivers
- ? umsg_decl
+ /* APPLE LOCAL begin ObjC direct dispatch */
+ ? (flag_objc_direct_dispatch
+ ? umsg_fast_decl
+ : umsg_decl)
+ /* APPLE LOCAL end ObjC direct dispatch */
: umsg_nonnil_decl));
tree rcv_p = (super_flag ? objc_super_type : objc_object_type);
@@ -6122,11 +6733,27 @@ lookup_method (tree mchain, tree method)
return NULL_TREE;
}
+/* APPLE LOCAL begin Objective-C */
+/* Look up a class (if OBJC_LOOKUP_CLASS is set in FLAGS) or instance method
+ in INTERFACE, along with any categories and protocols attached thereto.
+ If method is not found, and the OBJC_LOOKUP_NO_SUPER is _not_ set in FLAGS,
+ recursively examine the INTERFACE's superclass. If OBJC_LOOKUP_CLASS is
+ set, OBJC_LOOKUP_NO_SUPER is cleared, and no suitable class method could
+ be found in INTERFACE or any of its superclasses, look for an _instance_
+ method of the same name in the root class as a last resort.
+
+ If a suitable method cannot be found, return NULL_TREE. */
+
static tree
-lookup_method_static (tree interface, tree ident, int is_class)
+lookup_method_static (tree interface, tree ident, int flags)
+/* APPLE LOCAL end Objective-C */
{
tree meth = NULL_TREE, root_inter = NULL_TREE;
tree inter = interface;
+ /* APPLE LOCAL begin Objective-C */
+ int is_class = (flags & OBJC_LOOKUP_CLASS);
+ int no_superclasses = (flags & OBJC_LOOKUP_NO_SUPER);
+ /* APPLE LOCAL end Objective-C */
while (inter)
{
@@ -6163,6 +6790,12 @@ lookup_method_static (tree interface, tree ident, int is_class)
return meth;
}
+ /* APPLE LOCAL begin Objective-C */
+ /* If we were instructed not to look in superclasses, don't. */
+ if (no_superclasses)
+ return NULL_TREE;
+ /* APPLE LOCAL end Objective-C */
+
/* Failing that, climb up the inheritance hierarchy. */
root_inter = inter;
inter = lookup_interface (CLASS_SUPER_NAME (inter));
@@ -6192,9 +6825,11 @@ add_method_to_hash_list (hash *hash_list, tree method)
{
/* Check types against those; if different, add to a list. */
attr loop;
- int already_there = comp_proto_with_proto (method, hsh->key);
+ /* APPLE LOCAL Objective-C */
+ int already_there = comp_proto_with_proto (method, hsh->key, 1);
for (loop = hsh->list; !already_there && loop; loop = loop->next)
- already_there |= comp_proto_with_proto (method, loop->value);
+ /* APPLE LOCAL Objective-C */
+ already_there |= comp_proto_with_proto (method, loop->value, 1);
if (!already_there)
hash_add_attr (hsh, method);
}
@@ -6230,7 +6865,8 @@ objc_add_method (tree class, tree method, int is_class)
definition errors). */
if ((TREE_CODE (class) == CLASS_INTERFACE_TYPE
|| TREE_CODE (class) == CATEGORY_INTERFACE_TYPE)
- && !comp_proto_with_proto (method, mth))
+ /* APPLE LOCAL Objective-C */
+ && !comp_proto_with_proto (method, mth, 1))
error ("duplicate declaration of method %<%c%s%>",
is_class ? '+' : '-',
IDENTIFIER_POINTER (METHOD_SEL_NAME (mth)));
@@ -6260,11 +6896,14 @@ objc_add_method (tree class, tree method, int is_class)
}
static tree
-add_class (tree class)
+/* APPLE LOCAL objc speedup --dpatel */
+add_class (tree class, tree name)
{
/* Put interfaces on list in reverse order. */
TREE_CHAIN (class) = interface_chain;
interface_chain = class;
+ /* APPLE LOCAL objc speedup --dpatel */
+ IDENTIFIER_INTERFACE_VALUE (name) = class;
return interface_chain;
}
@@ -6320,28 +6959,68 @@ add_instance_variable (tree class, int public, tree field_decl)
}
#ifdef OBJCPLUS
- /* zlaski 2001-Apr-24: C++ classes with non-trivial constructors and/or destructors
- cannot be ivars; ditto for classes with vtables. */
- if(IS_AGGR_TYPE (field_type) && (TYPE_NEEDS_CONSTRUCTING (field_type)
- || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type) || TYPE_POLYMORPHIC_P (field_type)))
+/* APPLE LOCAL begin ObjC C++ ivars */
+ /* Check if the ivar being added has a non-POD C++ type. If so, we will
+ need to either (1) warn the user about it or (2) generate suitable
+ constructor/destructor call from '- .cxx_construct' or '- .cxx_destruct'
+ methods (if '-fobjc-call-cxx-cdtors' was specified). */
+ if (IS_AGGR_TYPE (field_type)
+ && (TYPE_NEEDS_CONSTRUCTING (field_type)
+ || TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type)
+ || TYPE_POLYMORPHIC_P (field_type)))
{
const char *type_name = IDENTIFIER_POINTER (OBJC_TYPE_NAME (field_type));
- if(TYPE_POLYMORPHIC_P (field_type)) {
- /* vtable pointers are Real Bad(tm), since Obj-C cannot initialize them */
- error ("type %qs has virtual member functions", type_name);
- error ("illegal aggregate type %qs specified for instance variable %qs",
- type_name, ivar_name);
- /* Return class as is without adding this ivar. */
- return class;
- }
- /* user-defined constructors and destructors are not known to Obj-C and
- hence will not be called. This may or may not be a problem. */
- if (TYPE_NEEDS_CONSTRUCTING (field_type))
- warning ("type %qs has a user-defined constructor", type_name);
- if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type))
- warning ("type %qs has a user-defined destructor", type_name);
- warning ("C++ constructors and destructors will not be invoked for Objective-C fields");
+
+ if (flag_objc_call_cxx_cdtors)
+ {
+ /* Since the ObjC runtime will be calling the constructors and
+ destructors for us, the only thing we can't handle is the lack
+ of a default constructor. */
+ if (TYPE_NEEDS_CONSTRUCTING (field_type)
+ && !TYPE_HAS_DEFAULT_CONSTRUCTOR (field_type))
+ {
+ warning ("type `%s' has no default constructor to call",
+ type_name);
+
+ /* If we cannot call a constructor, we should also avoid
+ calling the destructor, for symmetry. */
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type))
+ warning ("destructor for `%s' shall not be run either",
+ type_name);
+ }
+ }
+ else
+ {
+ static bool warn_cxx_ivars = false;
+
+ if (TYPE_POLYMORPHIC_P (field_type))
+ {
+ /* Vtable pointers are Real Bad(tm), since Obj-C cannot
+ initialize them. */
+ error ("type `%s' has virtual member functions", type_name);
+ error ("illegal aggregate type `%s' specified "
+ "for instance variable `%s'",
+ type_name, ivar_name);
+ /* Return class as is without adding this ivar. */
+ return class;
+ }
+
+ /* User-defined constructors and destructors are not known to Obj-C
+ and hence will not be called. This may or may not be a problem. */
+ if (TYPE_NEEDS_CONSTRUCTING (field_type))
+ warning ("type `%s' has a user-defined constructor", type_name);
+ if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (field_type))
+ warning ("type `%s' has a user-defined destructor", type_name);
+
+ if (!warn_cxx_ivars)
+ {
+ warning ("C++ constructors and destructors will not "
+ "be invoked for Objective-C fields");
+ warn_cxx_ivars = true;
+ }
+ }
}
+/* APPLE LOCAL end ObjC C++ ivars */
#endif
/* Overload the public attribute, it is not used for FIELD_DECLs. */
@@ -6397,21 +7076,24 @@ int
objc_is_public (tree expr, tree identifier)
{
tree basetype = TREE_TYPE (expr);
- enum tree_code code = TREE_CODE (basetype);
+ /* APPLE LOCAL begin Objective-C++ */
tree decl;
- if (code == RECORD_TYPE)
+ if (basetype && TREE_CODE (basetype) == RECORD_TYPE)
{
if (TYPE_HAS_OBJC_INFO (basetype) && TYPE_OBJC_INTERFACE (basetype))
{
- if (TREE_CODE (TYPE_OBJC_INTERFACE (basetype)) == IDENTIFIER_NODE)
+ tree class = lookup_interface (OBJC_TYPE_NAME (basetype));
+
+ if (!class)
{
error ("cannot find interface declaration for %qs",
IDENTIFIER_POINTER (OBJC_TYPE_NAME (basetype)));
return 0;
}
- if ((decl = is_ivar (TYPE_FIELDS (basetype), identifier)))
+ if ((decl = is_ivar (get_class_ivars (class), identifier)))
+ /* APPLE LOCAL end Objective-C++ */
{
if (TREE_PUBLIC (decl))
return 1;
@@ -6452,12 +7134,8 @@ objc_is_public (tree expr, tree identifier)
return 0;
}
}
-
- else if (objc_implementation_context && (basetype == objc_object_reference))
- {
- expr = convert (uprivate_record, expr);
- warning ("static access to object of type %<id%>");
- }
+ /* APPLE LOCAL Objective-C */
+ /* Unneeded code removed. */
}
return 1;
@@ -6734,7 +7412,10 @@ start_class (enum tree_code code, tree class_name, tree super_name,
{
warning ("cannot find interface declaration for %qs",
IDENTIFIER_POINTER (class_name));
- add_class (implementation_template = objc_implementation_context);
+ /* APPLE LOCAL begin objc speedup --dpatel */
+ add_class (implementation_template = objc_implementation_context,
+ class_name);
+ /* APPLE LOCAL end objc speedup --dpatel */
}
/* If a super class has been specified in the implementation,
@@ -6768,7 +7449,8 @@ start_class (enum tree_code code, tree class_name, tree super_name,
#endif
IDENTIFIER_POINTER (class_name));
else
- add_class (class);
+ /* APPLE LOCAL objc speedup --dpatel */
+ add_class (class, class_name);
if (protocol_list)
CLASS_PROTOCOL_LIST (class)
@@ -6825,7 +7507,8 @@ continue_class (tree class)
|| TREE_CODE (class) == CATEGORY_IMPLEMENTATION_TYPE)
{
struct imp_entry *imp_entry;
- tree ivar_context;
+ /* APPLE LOCAL Objective-C++ */
+ /* Delete ivar_context */
/* Check consistency of the instance variables. */
@@ -6840,7 +7523,8 @@ continue_class (tree class)
build_private_template (implementation_template);
uprivate_record = CLASS_STATIC_TEMPLATE (implementation_template);
- ivar_context = TYPE_FIELDS (uprivate_record);
+ /* APPLE LOCAL Objective-C++ */
+ /* Remove assignment of ivar_context. */
objc_instance_type = build_pointer_type (uprivate_record);
imp_entry = (struct imp_entry *) ggc_alloc (sizeof (struct imp_entry));
@@ -6852,6 +7536,8 @@ continue_class (tree class)
synth_forward_declarations ();
imp_entry->class_decl = UOBJC_CLASS_decl;
imp_entry->meta_decl = UOBJC_METACLASS_decl;
+ /* APPLE LOCAL ObjC C++ ivars */
+ imp_entry->has_cxx_cdtors = 0;
/* Append to front and increment count. */
imp_list = imp_entry;
@@ -6864,7 +7550,8 @@ continue_class (tree class)
pop_lang_context ();
#endif /* OBJCPLUS */
- return ivar_context;
+ /* APPLE LOCAL Objective-C++ */
+ return get_class_ivars (implementation_template);
}
else if (TREE_CODE (class) == CLASS_INTERFACE_TYPE)
@@ -7156,12 +7843,15 @@ encode_aggregate_within (tree type, int curtype, int format, int left,
tree name;
/* NB: aggregates that are pointed to have slightly different encoding
rules in that you never encode the names of instance variables. */
- int pointed_to
- = (obstack_object_size (&util_obstack) > 0
- && *(obstack_next_free (&util_obstack) - 1) == '^');
+ /* APPLE LOCAL begin Objective-C */
+ int ob_size = obstack_object_size (&util_obstack);
+ char c1 = ob_size > 1 ? *(obstack_next_free (&util_obstack) - 2) : 0;
+ char c0 = ob_size > 0 ? *(obstack_next_free (&util_obstack) - 1) : 0;
+ int pointed_to = (c0 == '^' || (c1 == '^' && c0 == 'r'));
int inline_contents
= ((format == OBJC_ENCODE_INLINE_DEFS || generating_instance_variables)
- && (!pointed_to || obstack_object_size (&util_obstack) - curtype == 1));
+ && (!pointed_to || ob_size - curtype == (c1 == 'r' ? 2 : 1)));
+ /* APPLE LOCAL end Objective-C */
/* Traverse struct aliases; it is important to get the
original struct and its tag name (if any). */
@@ -7508,6 +8198,16 @@ start_method_def (tree method)
#endif
int have_ellipsis = 0;
+ /* APPLE LOCAL begin ObjC super dealloc */
+ /* If we are defining a "dealloc" method in a non-root class, we will need
+ to check if a [super dealloc] is missing, and warn if it is. */
+ if(CLASS_SUPER_NAME (objc_implementation_context)
+ && !strcmp ("dealloc", IDENTIFIER_POINTER (METHOD_SEL_NAME (method))))
+ should_call_super_dealloc = 1;
+ else
+ should_call_super_dealloc = 0;
+ /* APPLE LOCAL end ObjC super dealloc */
+
/* Required to implement _msgSuper. */
objc_method_context = method;
UOBJC_SUPER_decl = NULL_TREE;
@@ -7586,11 +8286,25 @@ objc_types_are_equivalent (tree type1, tree type2)
return 0;
}
+/* APPLE LOCAL begin Objective-C */
+/* Return 1 if TYPE1 has the same size and alignment as TYPE2. */
+
+static int
+objc_types_share_size_and_alignment (tree type1, tree type2)
+{
+ return (simple_cst_equal (TYPE_SIZE (type1), TYPE_SIZE (type2))
+ && TYPE_ALIGN (type1) == TYPE_ALIGN (type2));
+}
+
/* Return 1 if PROTO1 is equivalent to PROTO2
- for purposes of method overloading. */
+ for purposes of method overloading. Ordinarily, the type signatures
+ should match up exactly, unless STRICT is zero, in which case we
+ shall allow differences in which the size and alignment of a type
+ is the same. */
static int
-comp_proto_with_proto (tree proto1, tree proto2)
+comp_proto_with_proto (tree proto1, tree proto2, int strict)
+/* APPLE LOCAL end Objective-C */
{
tree type1, type2;
@@ -7603,7 +8317,10 @@ comp_proto_with_proto (tree proto1, tree proto2)
type1 = TREE_VALUE (TREE_TYPE (proto1));
type2 = TREE_VALUE (TREE_TYPE (proto2));
- if (!objc_types_are_equivalent (type1, type2))
+ /* APPLE LOCAL begin Objective-C */
+ if (!objc_types_are_equivalent (type1, type2)
+ && (strict || !objc_types_share_size_and_alignment (type1, type2)))
+ /* APPLE LOCAL end Objective-C */
return 0;
/* Compare argument types. */
@@ -7612,7 +8329,12 @@ comp_proto_with_proto (tree proto1, tree proto2)
type1 && type2;
type1 = TREE_CHAIN (type1), type2 = TREE_CHAIN (type2))
{
- if (!objc_types_are_equivalent (TREE_VALUE (type1), TREE_VALUE (type2)))
+ /* APPLE LOCAL begin Objective-C */
+ if (!objc_types_are_equivalent (TREE_VALUE (type1), TREE_VALUE (type2))
+ && (strict
+ || !objc_types_share_size_and_alignment (TREE_VALUE (type1),
+ TREE_VALUE (type2))))
+ /* APPLE LOCAL end Objective-C */
return 0;
}
@@ -7666,6 +8388,11 @@ objc_start_function (tree name, tree type, tree attrs,
cplus_decl_attributes (&fndecl, attrs, 0);
start_preparsed_function (fndecl, attrs, /*flags=*/SF_DEFAULT);
#else
+ /* APPLE LOCAL begin Objective-C */
+ current_function_returns_value = 0; /* Assume, until we see it does. */
+ current_function_returns_null = 0;
+ /* APPLE LOCAL end Objective-C */
+
decl_attributes (&fndecl, attrs, 0);
announce_function (fndecl);
DECL_INITIAL (fndecl) = error_mark_node;
@@ -7756,11 +8483,15 @@ really_start_method (tree method,
tree proto
= lookup_method_static (implementation_template,
METHOD_SEL_NAME (method),
- TREE_CODE (method) == CLASS_METHOD_DECL);
+ /* APPLE LOCAL begin Objective-C */
+ ((TREE_CODE (method) == CLASS_METHOD_DECL)
+ | OBJC_LOOKUP_NO_SUPER));
+ /* APPLE LOCAL end Objective-C */
if (proto)
{
- if (!comp_proto_with_proto (method, proto))
+ /* APPLE LOCAL Objective-C */
+ if (!comp_proto_with_proto (method, proto, 1))
{
char type = (TREE_CODE (method) == INSTANCE_METHOD_DECL ? '-' : '+');
@@ -7932,6 +8663,11 @@ objc_finish_method_definition (tree fndecl)
/* Required to implement _msgSuper. This must be done AFTER finish_function,
since the optimizer may find "may be used before set" errors. */
objc_method_context = NULL_TREE;
+
+ /* APPLE LOCAL begin ObjC super dealloc */
+ if (should_call_super_dealloc)
+ warning ("method possibly missing a [super dealloc] call");
+ /* APPLE LOCAL end ObjC super dealloc */
}
#if 0
@@ -8306,7 +9042,11 @@ finish_objc (void)
/* all of the following reference the string pool... */
generate_ivar_lists ();
generate_dispatch_tables ();
- generate_shared_structures ();
+ /* APPLE LOCAL begin ObjC C++ ivars */
+ generate_shared_structures (impent->has_cxx_cdtors
+ ? CLS_HAS_CXX_STRUCTORS
+ : 0);
+ /* APPLE LOCAL end ObjC C++ ivars */
}
else
{
@@ -8323,7 +9063,8 @@ finish_objc (void)
if (protocol_chain)
generate_protocols ();
- if (flag_replace_objc_classes && imp_list)
+ /* APPLE LOCAL ObjC GC */
+ if ((flag_replace_objc_classes && imp_list) || flag_objc_gc)
generate_objc_image_info ();
/* Arrange for ObjC data structures to be initialized at run time. */
@@ -8505,6 +9246,11 @@ static void
generate_objc_image_info (void)
{
tree decl, initlist;
+ /* APPLE LOCAL begin ObjC GC */
+ int flags
+ = ((flag_replace_objc_classes && imp_list ? 1 : 0)
+ | (flag_objc_gc ? 2 : 0));
+ /* APPLE LOCAL end ObjC GC */
decl = start_var_decl (build_array_type
(integer_type_node,
@@ -8512,7 +9258,8 @@ generate_objc_image_info (void)
"_OBJC_IMAGE_INFO");
initlist = build_tree_list (NULL_TREE, build_int_cst (NULL_TREE, 0));
- initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, 1), initlist);
+ /* APPLE LOCAL ObjC GC */
+ initlist = tree_cons (NULL_TREE, build_int_cst (NULL_TREE, flags), initlist);
initlist = objc_build_constructor (TREE_TYPE (decl), nreverse (initlist));
finish_var_decl (decl, initlist);
@@ -8549,7 +9296,14 @@ objc_lookup_ivar (tree other, tree id)
/* In an instance method, a local variable (or parameter) may hide the
instance variable. */
if (TREE_CODE (objc_method_context) == INSTANCE_METHOD_DECL
- && other && other != error_mark_node && !DECL_FILE_SCOPE_P (other))
+ && other && other != error_mark_node
+ /* APPLE LOCAL begin Objective-C++ */
+#ifdef OBJCPLUS
+ && CP_DECL_CONTEXT (other) != global_namespace)
+#else
+ && !DECL_FILE_SCOPE_P (other))
+#endif
+ /* APPLE LOCAL end Objective-C++ */
{
warning ("local declaration of %qs hides instance variable",
IDENTIFIER_POINTER (id));
@@ -8563,4 +9317,60 @@ objc_lookup_ivar (tree other, tree id)
return build_ivar_reference (id);
}
+/* APPLE LOCAL begin Radar 4015820 FSF candidate */
+/* Look for the special case of OBJC_TYPE_REF with the address of
+ a function in OBJ_TYPE_REF_EXPR (presumably objc_msgSend or one
+ of its cousins). */
+
+enum gimplify_status objc_gimplify_expr (tree *expr_p, tree *pre_p,
+ tree *post_p)
+{
+ enum gimplify_status r0, r1;
+ if (TREE_CODE (*expr_p) == OBJ_TYPE_REF
+ && TREE_CODE (OBJ_TYPE_REF_EXPR (*expr_p)) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (OBJ_TYPE_REF_EXPR (*expr_p), 0))
+ == FUNCTION_DECL)
+ {
+ /* Postincrements in OBJ_TYPE_REF_OBJECT don't affect the
+ value of the OBJ_TYPE_REF, so force them to be emitted
+ during subexpression evaluation rather than after the
+ OBJ_TYPE_REF. This permits objc_msgSend calls in Objective
+ C to use direct rather than indirect calls when the
+ object expression has a postincrement. */
+ r0 = gimplify_expr (&OBJ_TYPE_REF_OBJECT (*expr_p), pre_p, NULL,
+ is_gimple_val, fb_rvalue);
+ r1 = gimplify_expr (&OBJ_TYPE_REF_EXPR (*expr_p), pre_p, post_p,
+ is_gimple_val, fb_rvalue);
+ return MIN (r0, r1);
+ }
+#ifdef OBJCPLUS
+ return cp_gimplify_expr (expr_p, pre_p, post_p);
+#else
+ return c_gimplify_expr (expr_p, pre_p, post_p);
+#endif
+}
+/* APPLE LOCAL end Radar 4015820 FSF candidate */
+/* APPLE LOCAL begin Radar 3926484 FSF candidate */
+/* Given a CALL expression, find the function being called. The ObjC
+ version looks for the OBJ_TYPE_REF_EXPR which is used for objc_msgSend. */
+
+tree
+objc_get_callee_fndecl (tree call_expr)
+{
+ tree addr = TREE_OPERAND (call_expr, 0);
+ if (TREE_CODE (addr) != OBJ_TYPE_REF)
+ return 0;
+
+ addr = OBJ_TYPE_REF_EXPR (addr);
+
+ /* If the address is just `&f' for some function `f', then we know
+ that `f' is being called. */
+ if (TREE_CODE (addr) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (addr, 0)) == FUNCTION_DECL)
+ return TREE_OPERAND (addr, 0);
+
+ return 0;
+}
+/* APPLE LOCAL end Radar 3926484 FSF candidate */
+
#include "gt-objc-objc-act.h"
diff --git a/gcc/objc/objc-act.h b/gcc/objc/objc-act.h
index 9925d96ce6c..5aab65e214b 100644
--- a/gcc/objc/objc-act.h
+++ b/gcc/objc/objc-act.h
@@ -22,13 +22,21 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_OBJC_ACT_H
#define GCC_OBJC_ACT_H
+/* APPLE LOCAL begin Radar 4015820 FSF candidate */
+/* For enum gimplify_status */
+#include "tree-gimple.h"
+/* APPLE LOCAL end Radar 4015820 FSF candidate */
/*** Language hooks ***/
bool objc_init (void);
const char *objc_printable_name (tree, int);
+/* APPLE LOCAL Radar 3926484 FSF candidate */
+tree objc_get_callee_fndecl (tree);
void objc_finish_file (void);
tree objc_fold_obj_type_ref (tree, tree);
int objc_types_compatible_p (tree, tree);
+/* APPLE LOCAL Radar 4015820 FSF candidate */
+enum gimplify_status objc_gimplify_expr (tree *, tree *, tree *);
/* NB: The remaining public functions are prototyped in c-common.h, for the
benefit of stub-objc.c and objc-act.c. */
@@ -71,42 +79,46 @@ int objc_types_compatible_p (tree, tree);
/* ObjC-specific information pertaining to RECORD_TYPEs are stored in
the LANG_SPECIFIC structures, which may itself need allocating first. */
+
+/* APPLE LOCAL begin Objective-C++ */
+/* The following three macros must be overridden (in objcp/objcp-decl.h)
+ for Objective-C++. */
#define TYPE_OBJC_INFO(TYPE) TYPE_LANG_SPECIFIC (TYPE)->objc_info
+#define SIZEOF_OBJC_TYPE_LANG_SPECIFIC sizeof (struct lang_type)
+#define ALLOC_OBJC_TYPE_LANG_SPECIFIC(NODE) \
+ do { \
+ TYPE_LANG_SPECIFIC (NODE) = GGC_CNEW (struct lang_type); \
+ } while (0)
+
#define TYPE_HAS_OBJC_INFO(TYPE) \
- (TYPE_LANG_SPECIFIC (TYPE) \
- && TYPE_LANG_SPECIFIC (TYPE)->objc_info)
+ (TYPE_LANG_SPECIFIC (TYPE) && TYPE_OBJC_INFO (TYPE))
#define TYPE_OBJC_INTERFACE(TYPE) TREE_VEC_ELT (TYPE_OBJC_INFO (TYPE), 0)
#define TYPE_OBJC_PROTOCOL_LIST(TYPE) TREE_VEC_ELT (TYPE_OBJC_INFO (TYPE), 1)
+
#define INIT_TYPE_OBJC_INFO(TYPE) \
do \
{ \
if (!TYPE_LANG_SPECIFIC (TYPE)) \
- TYPE_LANG_SPECIFIC (TYPE) \
- = ALLOC_OBJC_TYPE_LANG_SPECIFIC; \
- if (!TYPE_LANG_SPECIFIC (TYPE)->objc_info) \
- TYPE_LANG_SPECIFIC (TYPE)->objc_info \
+ ALLOC_OBJC_TYPE_LANG_SPECIFIC(TYPE); \
+ if (!TYPE_OBJC_INFO (TYPE)) \
+ TYPE_OBJC_INFO (TYPE) \
= make_tree_vec (OBJC_INFO_SLOT_ELTS); \
} \
while (0)
#define DUP_TYPE_OBJC_INFO(DST, SRC) \
do \
{ \
- TYPE_LANG_SPECIFIC (DST) \
- = ALLOC_OBJC_TYPE_LANG_SPECIFIC; \
+ ALLOC_OBJC_TYPE_LANG_SPECIFIC(DST); \
if (TYPE_LANG_SPECIFIC (SRC)) \
memcpy (TYPE_LANG_SPECIFIC (DST), \
TYPE_LANG_SPECIFIC (SRC), \
SIZEOF_OBJC_TYPE_LANG_SPECIFIC); \
- TYPE_LANG_SPECIFIC (DST)->objc_info \
+ TYPE_OBJC_INFO (DST) \
= make_tree_vec (OBJC_INFO_SLOT_ELTS); \
} \
while (0)
-
-/* The following two macros must be overridden (in objcp/objcp-decl.h)
- for Objective-C++. */
-#define ALLOC_OBJC_TYPE_LANG_SPECIFIC GGC_CNEW (struct lang_type)
-#define SIZEOF_OBJC_TYPE_LANG_SPECIFIC sizeof (struct lang_type)
+/* APPLE LOCAL end Objective-C++ */
#define TYPED_OBJECT(TYPE) \
(TREE_CODE (TYPE) == RECORD_TYPE \
@@ -115,6 +127,11 @@ int objc_types_compatible_p (tree, tree);
#define OBJC_TYPE_NAME(TYPE) TYPE_NAME(TYPE)
#define OBJC_SET_TYPE_NAME(TYPE, NAME) (TYPE_NAME (TYPE) = NAME)
+/* APPLE LOCAL begin objc speedup --dpatel */
+#define IDENTIFIER_INTERFACE_VALUE(NODE) \
+ (((struct lang_identifier *) (NODE))->interface_value)
+/* APPLE LOCAL end objc speedup --dpatel */
+
/* Define the Objective-C or Objective-C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
@@ -164,6 +181,8 @@ struct imp_entry GTY(())
tree imp_template;
tree class_decl; /* _OBJC_CLASS_<my_name>; */
tree meta_decl; /* _OBJC_METACLASS_<my_name>; */
+ /* APPLE LOCAL ObjC C++ ivars */
+ BOOL_BITFIELD has_cxx_cdtors : 1;
};
extern GTY(()) struct imp_entry *imp_list;
@@ -185,6 +204,8 @@ enum objc_tree_index
OCTI_SELF_DECL,
OCTI_UMSG_DECL,
+ /* APPLE LOCAL ObjC direct dispatch */
+ OCTI_UMSG_FAST_DECL,
OCTI_UMSG_SUPER_DECL,
OCTI_UMSG_STRET_DECL,
OCTI_UMSG_SUPER_STRET_DECL,
@@ -235,6 +256,11 @@ enum objc_tree_index
OCTI_UUCLS_SUPER_REF,
OCTI_METH_TEMPL,
OCTI_IVAR_TEMPL,
+ /* APPLE LOCAL begin Objective-C++ */
+ OCTI_METH_LIST_TEMPL,
+ OCTI_METH_PROTO_LIST_TEMPL,
+ OCTI_IVAR_LIST_TEMPL,
+ /* APPLE LOCAL end Objective-C++ */
OCTI_SYMTAB_TEMPL,
OCTI_MODULE_TEMPL,
OCTI_SUPER_TEMPL,
@@ -272,6 +298,13 @@ enum objc_tree_index
OCTI_CATCH_TYPE,
OCTI_EXECCLASS_DECL,
+ /* APPLE LOCAL begin ObjC GC */
+ OCTI_ASSIGN_IVAR_DECL,
+ OCTI_ASSIGN_IVAR_FAST_DECL,
+ OCTI_ASSIGN_GLOBAL_DECL,
+ OCTI_ASSIGN_STRONGCAST_DECL,
+ /* APPLE LOCAL end ObjC GC */
+
OCTI_MAX
};
@@ -291,6 +324,8 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
#define self_decl objc_global_trees[OCTI_SELF_DECL]
#define umsg_decl objc_global_trees[OCTI_UMSG_DECL]
+/* APPLE LOCAL ObjC GC */
+#define umsg_fast_decl objc_global_trees[OCTI_UMSG_FAST_DECL]
#define umsg_super_decl objc_global_trees[OCTI_UMSG_SUPER_DECL]
#define umsg_stret_decl objc_global_trees[OCTI_UMSG_STRET_DECL]
#define umsg_super_stret_decl objc_global_trees[OCTI_UMSG_SUPER_STRET_DECL]
@@ -402,8 +437,23 @@ extern GTY(()) tree objc_global_trees[OCTI_MAX];
#define execclass_decl objc_global_trees[OCTI_EXECCLASS_DECL]
+/* APPLE LOCAL begin ObjC GC */
+#define objc_assign_ivar_decl objc_global_trees[OCTI_ASSIGN_IVAR_DECL]
+#define objc_assign_ivar_fast_decl \
+ objc_global_trees[OCTI_ASSIGN_IVAR_FAST_DECL]
+#define objc_assign_global_decl objc_global_trees[OCTI_ASSIGN_GLOBAL_DECL]
+#define objc_assign_strong_cast_decl \
+ objc_global_trees[OCTI_ASSIGN_STRONGCAST_DECL]
+/* APPLE LOCAL end ObjC GC */
+
#define objc_method_template objc_global_trees[OCTI_METH_TEMPL]
#define objc_ivar_template objc_global_trees[OCTI_IVAR_TEMPL]
+/* APPLE LOCAL begin Objective-C++ */
+#define objc_method_list_ptr objc_global_trees[OCTI_METH_LIST_TEMPL]
+#define objc_method_proto_list_ptr \
+ objc_global_trees[OCTI_METH_PROTO_LIST_TEMPL]
+#define objc_ivar_list_ptr objc_global_trees[OCTI_IVAR_LIST_TEMPL]
+/* APPLE LOCAL end Objective-C++ */
#define objc_symtab_template objc_global_trees[OCTI_SYMTAB_TEMPL]
#define objc_module_template objc_global_trees[OCTI_MODULE_TEMPL]
#define objc_super_template objc_global_trees[OCTI_SUPER_TEMPL]
diff --git a/gcc/objc/objc-lang.c b/gcc/objc/objc-lang.c
index 375bed9356a..4a01ceee759 100644
--- a/gcc/objc/objc-lang.c
+++ b/gcc/objc/objc-lang.c
@@ -47,7 +47,14 @@ enum c_language_kind c_language = clk_objc;
#define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name
#undef LANG_HOOKS_TYPES_COMPATIBLE_P
#define LANG_HOOKS_TYPES_COMPATIBLE_P objc_types_compatible_p
-
+/* APPLE LOCAL begin Radar 4015820 FSF candidate */
+#undef LANG_HOOKS_GIMPLIFY_EXPR
+#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
+/* APPLE LOCAL end Radar 4105820 FSF candidate */
+/* APPLE LOCAL begin Radar 3926484 FSF candidate */
+#undef LANG_HOOKS_GET_CALLEE_FNDECL
+#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl
+/* APPLE LOCAL end Radar 3926484 FSF candidate */
/* Each front end provides its own lang hook initializer. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
diff --git a/gcc/objcp/.cvsignore b/gcc/objcp/.cvsignore
new file mode 100644
index 00000000000..1ae848989fa
--- /dev/null
+++ b/gcc/objcp/.cvsignore
@@ -0,0 +1,4 @@
+# APPLE LOCAL file Objective-C++
+objcp-parse.h
+objcp-parse.c
+g++int.info*
diff --git a/gcc/objcp/ChangeLog.apple-ppc b/gcc/objcp/ChangeLog.apple-ppc
new file mode 100644
index 00000000000..a1a7083c4c4
--- /dev/null
+++ b/gcc/objcp/ChangeLog.apple-ppc
@@ -0,0 +1,7 @@
+2005-02-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3982256
+ * ChangeLog.apple-ppc: New file.
+ * objcp-lang.c (LANG_HOOKS_TYPES_COMPATIBLE_P): Point at
+ objc_types_compatible_p().
+
diff --git a/gcc/objcp/Make-lang.in b/gcc/objcp/Make-lang.in
new file mode 100644
index 00000000000..3925fc2b74b
--- /dev/null
+++ b/gcc/objcp/Make-lang.in
@@ -0,0 +1,154 @@
+# APPLE LOCAL file Objective-C++
+# Top level -*- makefile -*- fragment for GNU Objective-C++
+# Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+# Contributed by Ziemowit Laski <zlaski@apple.com>
+
+#This file is part of GCC.
+
+#GCC is free software; you can redistribute it and/or modify
+#it under the terms of the GNU General Public License as published by
+#the Free Software Foundation; either version 2, or (at your option)
+#any later version.
+
+#GCC is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#GNU General Public License for more details.
+
+#You should have received a copy of the GNU General Public License
+#along with GCC; see the file COPYING. If not, write to
+#the Free Software Foundation, 59 Temple Place - Suite 330,
+#Boston, MA 02111-1307, USA.
+
+# This file provides the language dependent support in the main Makefile.
+# Each language makefile fragment must provide the following targets:
+#
+# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
+# foo.install-normal, foo.install-common, foo.install-man,
+# foo.uninstall,
+# foo.mostlyclean, foo.clean, foo.distclean,
+# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
+#
+# where `foo' is the name of the language.
+#
+# It should also provide rules for:
+#
+# - making any compiler driver (eg: g++)
+# - the compiler proper (eg: cc1plus)
+# - define the names for selecting the language in LANGUAGES.
+
+#
+# Define the names for selecting Objective-C++ in LANGUAGES.
+OBJ-C++ obj-c++: cc1objplus$(exeext)
+
+# Tell GNU make to ignore these if they exist.
+.PHONY: Obj-c++ obj-C++
+
+# Use maximal warnings for this front end. Also, make ObjC and C++
+# headers accessible.
+objcp-warn = $(STRICT_WARN) -DOBJCPLUS -I$(srcdir)/objc -I$(srcdir)/cp
+
+# APPLE LOCAL begin order files --ilr
+ifeq ($(ORDER_FILES),yes)
+CC1OBJPLUS_ORDER_FLAGS = `if [ -f $(srcdir)/../order-files/cc1objplus.order ]; then \
+ echo -sectorder __TEXT __text $(srcdir)/../order-files/cc1objplus.order -e start ; fi`
+else
+CC1OBJPLUS_ORDER_FLAGS =
+endif
+# APPLE LOCAL end order files --ilr
+
+# Language-specific object files for Objective C++.
+OBJCXX_OBJS = objcp/objcp-act.o objcp/objcp-lang.o objcp/objcp-decl.o \
+ $(CXX_AND_OBJCXX_OBJS)
+
+# APPLE LOCAL begin order files --ilr
+cc1objplus$(exeext): $(OBJCXX_OBJS) $(BACKEND) $(LIBDEPS)
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
+ $(OBJCXX_OBJS) $(BACKEND) $(LIBS) $(CC1OBJPLUS_ORDER_FLAGS)
+# APPLE LOCAL end order files --ilr
+
+# Objective C++ language specific files.
+
+# APPLE LOCAL Radar 4015820
+objcp/objcp-lang.o : objcp/objcp-lang.c \
+ $(CXX_TREE_H) $(TM_H) toplev.h debug.h langhooks.h objc/objc-act.h \
+ $(LANGHOOKS_DEF_H) c-common.h gtype-objcp.h $(CXX_PRETTY_PRINT_H) \
+ $(DIAGNOSTIC_H) cp/cp-objcp-common.h tree-gimple.h
+
+# APPLE LOCAL Radar 4015820
+objcp/objcp-decl.o : objcp/objcp-decl.c \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(C_TREE_H) \
+ toplev.h $(GGC_H) c-pragma.h input.h flags.h output.h objc/objc-act.h \
+ objcp/objcp-decl.h tree-gimple.h
+
+# The following must be an explicit rule; please keep in sync with the implicit
+# one in Makefile.in.
+# APPLE LOCAL Radar 4015820
+objcp/objcp-act.o : objc/objc-act.c \
+ $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_H) $(TM_P_H) \
+ $(EXPR_H) $(TARGET_H) $(CXX_TREE_H) diagnostic.h toplev.h flags.h \
+ objc/objc-act.h input.h function.h output.h debug.h langhooks.h \
+ objcp/objcp-decl.h $(LANGHOOKS_DEF_H) $(HASHTAB_H) gt-objc-objc-act.h \
+ tree-gimple.h
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
+
+po-generated:
+
+gtype-objcp.h : s-gtype ; @true
+
+#
+# Build hooks:
+
+obj-c++.all.build:
+obj-c++.all.cross:
+obj-c++.start.encap:
+obj-c++.rest.encap:
+obj-c++.info:
+obj-c++.srcinfo:
+obj-c++.srcextra:
+obj-c++.man:
+
+obj-c++.tags: force
+ cd $(srcdir)/objcp; etags -o TAGS.sub *.y *.c *.h; \
+ etags --include TAGS.sub --include ../TAGS.sub
+
+lang_checks += check-obj-c++
+
+#
+# Install hooks:
+# cc1objplus is installed elsewhere as part of $(COMPILERS).
+
+obj-c++.install-normal:
+
+obj-c++.install-common:
+
+obj-c++.install-man:
+
+obj-c++.uninstall:
+#
+# Clean hooks:
+# A lot of the ancillary files are deleted by the main makefile.
+# We just have to delete files specific to us.
+obj-c++.mostlyclean:
+ -rm -f objcp/*$(objext)
+ -rm -f objcp/*$(coverageexts)
+obj-c++.clean: obj-c++.mostlyclean
+obj-c++.distclean:
+ -rm -f objcp/config.status objcp/Makefile
+obj-c++.maintainer-clean:
+
+#
+# Stage hooks:
+
+obj-c++.stage1: stage1-start
+ -mv objcp/*$(objext) stage1/objcp
+obj-c++.stage2: stage2-start
+ -mv objcp/*$(objext) stage2/objcp
+obj-c++.stage3: stage3-start
+ -mv objcp/*$(objext) stage3/objcp
+obj-c++.stage4: stage4-start
+ -mv objcp/*$(objext) stage4/objcp
+obj-c++.stageprofile: stageprofile-start
+ -mv objcp/*$(objext) stageprofile/objcp
+obj-c++.stagefeedback: stagefeedback-start
+ -mv objcp/*$(objext) stagefeedback/objcp
diff --git a/gcc/objcp/config-lang.in b/gcc/objcp/config-lang.in
new file mode 100644
index 00000000000..3377bc9a6ed
--- /dev/null
+++ b/gcc/objcp/config-lang.in
@@ -0,0 +1,47 @@
+# APPLE LOCAL file Objective-C++
+# Top level configure fragment for GNU Objective-C++.
+# Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+# Contributed by Ziemowit Laski <zlaski@apple.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.
+
+# Configure looks for the existence of this file to auto-config each language.
+# We define several parameters used by configure:
+#
+# language - name of language as it would appear in $(LANGUAGES)
+# compilers - value to add to $(COMPILERS)
+# stagestuff - files to add to $(STAGESTUFF)
+# diff_excludes - files to ignore when building diffs between two versions.
+
+language="obj-c++"
+
+compilers="cc1objplus\$(exeext)"
+
+stagestuff=""
+
+diff_excludes=""
+
+# Per GCC Steering Committee.
+build_by_default="no"
+
+# By building the Objective-C and C++ front-ends, we will get
+# the object files we need, along with the libraries (libstdc++,
+# libobjc).
+lang_requires="objc c++"
+
+gtfiles="\$(srcdir)/objcp/objcp-decl.c \$(srcdir)/objc/objc-act.c \$(srcdir)/objc/objc-act.h \$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/cp/typeck2.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c"
diff --git a/gcc/objcp/lang-specs.h b/gcc/objcp/lang-specs.h
new file mode 100644
index 00000000000..90a58f4b90d
--- /dev/null
+++ b/gcc/objcp/lang-specs.h
@@ -0,0 +1,61 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Definitions for specs for Objective-C++.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+ Contributed by Ziemowit Laski <zlaski@apple.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+/* This is the contribution to the `default_compilers' array in gcc.c for
+ obj-c++. It is based on -- and should be kept in sync with -- the g++
+ spec (found in cp/lang-specs.h). */
+
+#ifndef CPLUSPLUS_CPP_SPEC
+#define CPLUSPLUS_CPP_SPEC 0
+#endif
+
+ {".mm", "@objective-c++", 0, 0, 0},
+ {".M", "@objective-c++", 0, 0, 0},
+ {"@objective-c++-header",
+ "%{E|M|MM:cc1objplus -E %(cpp_options) %2 %(cpp_debug_options)}\
+ %{!E:%{!M:%{!MM:\
+ %{save-temps|no-integrated-cpp:cc1objplus -E\
+ %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\
+ cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+ %(cc1_options) %2 %{+e1*}\
+ -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {"@objective-c++",
+ "%{E|M|MM:cc1objplus -E %(cpp_options) %2 %(cpp_debug_options)}\
+ %{!E:%{!M:%{!MM:\
+ %{save-temps|no-integrated-cpp:cc1objplus -E\
+ %(cpp_options) %2 -o %{save-temps:%b.mii} %{!save-temps:%g.mii} \n}\
+ cc1objplus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.mii} %{!save-temps:%g.mii}}\
+ %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
+ %(cc1_options) %2 %{+e1*}\
+ %{!fsyntax-only:%(invoke_as)}}}}",
+ CPLUSPLUS_CPP_SPEC, 0, 0},
+ {".mii", "@objective-c++-cpp-output", 0, 0, 0},
+ {"@objective-c++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+ cc1objplus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
+ {"@objc++-cpp-output",
+ "%{!M:%{!MM:%{!E:\
+ cc1objplus -fpreprocessed %i %(cc1_options) %2 %{+e*}\
+ %{!fsyntax-only:%(invoke_as)}}}}", 0, 0, 0},
diff --git a/gcc/objcp/objcp-decl.c b/gcc/objcp/objcp-decl.c
new file mode 100644
index 00000000000..c5348eb8453
--- /dev/null
+++ b/gcc/objcp/objcp-decl.c
@@ -0,0 +1,135 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Process the ObjC-specific declarations and variables for
+ the Objective-C++ compiler.
+ Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Contributed by Ziemowit Laski <zlaski@apple.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "rtl.h"
+#include "expr.h"
+#include "cp-tree.h"
+#include "c-common.h"
+#include "flags.h"
+#include "input.h"
+#include "except.h"
+#include "output.h"
+#include "toplev.h"
+#include "cpplib.h"
+#include "debug.h"
+#include "target.h"
+#include "varray.h"
+
+#include "objc-act.h"
+#include "objcp-decl.h"
+
+/* Hacks to simulate start_struct() and finish_struct(). */
+
+tree
+objcp_start_struct (enum tree_code code ATTRIBUTE_UNUSED, tree name)
+{
+ tree s;
+ /* The idea here is to mimic the actions that the C++ parser takes when
+ constructing 'extern "C" struct NAME {'. */
+ push_lang_context (lang_name_c);
+ if (!name)
+ name = make_anon_name ();
+ s = xref_tag (record_type, name, ts_current, 0);
+ CLASSTYPE_DECLARED_CLASS (s) = 0; /* this is a 'struct', not a 'class'. */
+ xref_basetypes (s, NULL_TREE); /* no base classes here! */
+
+ return begin_class_definition (s);
+}
+
+tree
+objcp_finish_struct (tree t, tree fieldlist, tree attributes)
+{
+ tree field, next_field;
+
+ for (field = fieldlist; field; field = next_field)
+ {
+ next_field = TREE_CHAIN (field); /* insert one field at a time; */
+ TREE_CHAIN (field) = NULL_TREE; /* otherwise, grokfield croaks. */
+ finish_member_declaration (field);
+ }
+ t = finish_struct (t, attributes);
+ pop_lang_context ();
+
+ return t;
+}
+
+void
+objcp_finish_function (void)
+{
+ /* The C++ flavor of 'finish_function' does not generate RTL -- one has
+ to call 'expand_or_defer_fn' to do that. */
+ expand_or_defer_fn (finish_function (0));
+}
+
+tree
+objcp_lookup_name (tree name)
+{
+ return lookup_name (name, -1);
+}
+
+tree
+objcp_xref_tag (enum tree_code code ATTRIBUTE_UNUSED, tree name)
+{
+ return xref_tag (record_type, name, true, false);
+}
+
+tree
+objcp_build_component_ref (tree datum, tree component)
+{
+ /* The 'build_component_ref' routine has been removed from the C++
+ front-end, but 'finish_class_member_access_expr' seems to be
+ a worthy substitute. */
+ return finish_class_member_access_expr (datum, component);
+}
+
+int
+objcp_comptypes (tree type1, tree type2)
+{
+ return comptypes (type1, type2, COMPARE_STRICT);
+}
+
+tree
+objcp_begin_compound_stmt (int flags ATTRIBUTE_UNUSED)
+{
+ return begin_compound_stmt (0);
+}
+
+tree
+objcp_end_compound_stmt (tree stmt, int flags ATTRIBUTE_UNUSED)
+{
+ /* The following has been snarfed from
+ cp/semantics.c:finish_compound_stmt(). */
+ if (TREE_CODE (stmt) == BIND_EXPR)
+ BIND_EXPR_BODY (stmt) = do_poplevel (BIND_EXPR_BODY (stmt));
+ else if (STATEMENT_LIST_NO_SCOPE (stmt))
+ stmt = pop_stmt_list (stmt);
+ else
+ stmt = do_poplevel (stmt);
+
+ return stmt;
+}
diff --git a/gcc/objcp/objcp-decl.h b/gcc/objcp/objcp-decl.h
new file mode 100644
index 00000000000..7a27d15ae8d
--- /dev/null
+++ b/gcc/objcp/objcp-decl.h
@@ -0,0 +1,96 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Process the ObjC-specific declarations and variables for
+ the Objective-C++ compiler.
+ Copyright (C) 2001, 2004 Free Software Foundation, Inc.
+ Contributed by Ziemowit Laski <zlaski@apple.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#ifndef GCC_OBJCP_DECL_H
+#define GCC_OBJCP_DECL_H
+
+extern tree objcp_start_struct (enum tree_code, tree);
+extern tree objcp_finish_struct (tree, tree, tree);
+extern void objcp_finish_function (void);
+extern tree objcp_lookup_name (tree);
+extern tree objcp_build_function_call (tree, tree);
+extern tree objcp_xref_tag (enum tree_code, tree);
+extern tree objcp_build_component_ref (tree, tree);
+extern int objcp_comptypes (tree, tree);
+extern tree objcp_builtin_function (const char *, tree, int,
+ enum built_in_class, const char *, tree);
+extern tree objcp_begin_compound_stmt (int);
+extern tree objcp_end_compound_stmt (tree, int);
+
+/* Now "cover up" the corresponding C++ functions if required (NB: the
+ OBJCP_ORIGINAL_FUNCTION macro, shown below, can still be used to
+ invoke the original C++ functions if needed). */
+#ifdef OBJCP_REMAP_FUNCTIONS
+
+#define start_struct(code, name) \
+ objcp_start_struct (code, name)
+#define finish_struct(t, fieldlist, attributes) \
+ objcp_finish_struct (t, fieldlist, attributes)
+#define finish_function() \
+ objcp_finish_function ()
+#define lookup_name(name) \
+ objcp_lookup_name (name)
+#define xref_tag(code, name) \
+ objcp_xref_tag (code, name)
+#define build_component_ref(datum, component) \
+ objcp_build_component_ref (datum, component)
+#define comptypes(type1, type2) \
+ objcp_comptypes (type1, type2)
+#define c_begin_compound_stmt(flags) \
+ objcp_begin_compound_stmt (flags)
+#define c_end_compound_stmt(stmt, flags) \
+ objcp_end_compound_stmt (stmt, flags)
+
+#undef OBJC_TYPE_NAME
+#define OBJC_TYPE_NAME(type) \
+ (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL \
+ ? DECL_NAME (TYPE_NAME (type)) \
+ : TYPE_NAME (type))
+#undef OBJC_SET_TYPE_NAME
+#define OBJC_SET_TYPE_NAME(type, name) \
+ if(TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL) \
+ DECL_NAME (TYPE_NAME (type)) = name; \
+ else \
+ TYPE_NAME (type) = name;
+
+#undef TYPE_OBJC_INFO
+#define TYPE_OBJC_INFO(TYPE) LANG_TYPE_CLASS_CHECK (TYPE)->objc_info
+#undef SIZEOF_OBJC_TYPE_LANG_SPECIFIC
+#define SIZEOF_OBJC_TYPE_LANG_SPECIFIC sizeof (struct lang_type_class)
+#undef ALLOC_OBJC_TYPE_LANG_SPECIFIC
+#define ALLOC_OBJC_TYPE_LANG_SPECIFIC(NODE) \
+ do { \
+ TYPE_LANG_SPECIFIC (NODE) = GGC_CNEWVAR \
+ (struct lang_type, sizeof (struct lang_type_class)); \
+ TYPE_LANG_SPECIFIC (NODE)->u.c.h.is_lang_type_class = 1; \
+ } while (0)
+
+#define OBJCP_ORIGINAL_FUNCTION(name, args) (name)args
+
+/* C++ marks ellipsis-free function parameters differently from C. */
+#undef OBJC_VOID_AT_END
+#define OBJC_VOID_AT_END void_list_node
+
+#endif /* OBJCP_REMAP_FUNCTIONS */
+
+#endif /* ! GCC_OBJCP_DECL_H */
diff --git a/gcc/objcp/objcp-lang.c b/gcc/objcp/objcp-lang.c
new file mode 100644
index 00000000000..00b81285418
--- /dev/null
+++ b/gcc/objcp/objcp-lang.c
@@ -0,0 +1,150 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Language-dependent hooks for Objective-C++.
+ Copyright 2001, 2002, 2004 Free Software Foundation, Inc.
+ Contributed by Ziemowit Laski <zlaski@apple.com>
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GCC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "cp-tree.h"
+#include "c-common.h"
+#include "toplev.h"
+#include "objc-act.h"
+#include "langhooks.h"
+#include "langhooks-def.h"
+#include "diagnostic.h"
+#include "cxx-pretty-print.h"
+#include "debug.h"
+#include "cp-objcp-common.h"
+
+enum c_language_kind c_language = clk_objcxx;
+
+/* Lang hooks common to C++ and ObjC++ are declared in cp/cp-objcp-common.h;
+ consequently, there should be very few hooks below. */
+
+#undef LANG_HOOKS_NAME
+#define LANG_HOOKS_NAME "GNU Objective-C++"
+#undef LANG_HOOKS_INIT
+#define LANG_HOOKS_INIT objc_init
+#undef LANG_HOOKS_DECL_PRINTABLE_NAME
+#define LANG_HOOKS_DECL_PRINTABLE_NAME objc_printable_name
+#undef LANG_HOOKS_TYPES_COMPATIBLE_P
+#define LANG_HOOKS_TYPES_COMPATIBLE_P objc_types_compatible_p
+/* APPLE LOCAL begin Radar 4015820 FSF candidate */
+#undef LANG_HOOKS_GIMPLIFY_EXPR
+#define LANG_HOOKS_GIMPLIFY_EXPR objc_gimplify_expr
+/* APPLE LOCAL end Radar 4105820 FSF candidate */
+/* APPLE LOCAL begin Radar 3926484 FSF candidate */
+#undef LANG_HOOKS_GET_CALLEE_FNDECL
+#define LANG_HOOKS_GET_CALLEE_FNDECL objc_get_callee_fndecl
+/* APPLE LOCAL end Radar 3926484 FSF candidate */
+/* Each front end provides its own lang hook initializer. */
+const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
+
+/* Tree code classes. */
+
+#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) TYPE,
+
+const enum tree_code_class tree_code_type[] = {
+#include "tree.def"
+ tcc_exceptional,
+#include "c-common.def"
+ tcc_exceptional,
+#include "cp-tree.def"
+ tcc_exceptional,
+#include "objc-tree.def"
+};
+#undef DEFTREECODE
+
+/* Table indexed by tree code giving number of expression
+ operands beyond the fixed part of the node structure.
+ Not used for types or decls. */
+
+#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) LENGTH,
+
+const unsigned char tree_code_length[] = {
+#include "tree.def"
+ 0,
+#include "c-common.def"
+ 0,
+#include "cp-tree.def"
+ 0,
+#include "objc-tree.def"
+};
+#undef DEFTREECODE
+
+/* Names of tree components.
+ Used for printing out the tree and error messages. */
+#define DEFTREECODE(SYM, NAME, TYPE, LEN) NAME,
+
+const char *const tree_code_name[] = {
+#include "tree.def"
+ "@@dummy",
+#include "c-common.def"
+ "@@dummy",
+#include "cp-tree.def"
+ "@@dummy",
+#include "objc-tree.def"
+};
+#undef DEFTREECODE
+
+/* Lang hook routines common to C++ and ObjC++ appear in cp/cp-objcp-common.c;
+ there should be very few (if any) routines below. */
+
+tree
+objcp_tsubst_copy_and_build (tree t, tree args, tsubst_flags_t complain,
+ tree in_decl, bool function_p ATTRIBUTE_UNUSED)
+{
+#define RECURSE(NODE) \
+ tsubst_copy_and_build (NODE, args, complain, in_decl, /*function_p=*/false)
+
+ /* The following two can only occur in Objective-C++. */
+
+ switch ((int) TREE_CODE (t))
+ {
+ case MESSAGE_SEND_EXPR:
+ return objc_finish_message_expr
+ (RECURSE (TREE_OPERAND (t, 0)),
+ TREE_OPERAND (t, 1), /* No need to expand the selector. */
+ RECURSE (TREE_OPERAND (t, 2)));
+
+ case CLASS_REFERENCE_EXPR:
+ return objc_get_class_reference
+ (RECURSE (TREE_OPERAND (t, 0)));
+
+ default:
+ break;
+ }
+
+ /* Fall back to C++ processing. */
+ return NULL_TREE;
+
+#undef RECURSE
+}
+
+void
+finish_file (void)
+{
+ objc_finish_file ();
+}
+
+#include "gtype-objcp.h"
diff --git a/gcc/opts.c b/gcc/opts.c
index 8af263a8498..e181d49a1e6 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -471,8 +471,30 @@ decode_options (unsigned int argc, const char **argv)
}
}
}
+ /* APPLE LOCAL begin -fast or -fastf or -fastcp */
+ else if (argv[i][0] == '-' && argv[i][1] == 'f')
+ {
+ const char *p = &argv[i][2];
+ if (!strcmp(p, "ast"))
+ flag_fast = 1;
+ else if (!strcmp(p, "astf"))
+ flag_fastf = 1;
+ else if (!strcmp(p, "astcp"))
+ flag_fastcp = 1;
+ }
}
+ if (flag_fast || flag_fastf || flag_fastcp )
+ {
+ optimize = 3;
+ optimize_size = 0;
+ /* This goes here, rather than in rs6000.c, so that
+ later -fcommon can override it. */
+ if (flag_fast || flag_fastcp)
+ flag_no_common = 1;
+ }
+ /* APPLE LOCAL end -fast or -fastf or -fastcp */
+
if (!optimize)
{
flag_merge_constants = 0;
@@ -496,6 +518,13 @@ decode_options (unsigned int argc, const char **argv)
flag_tree_dce = 1;
flag_tree_dom = 1;
flag_tree_dse = 1;
+ /* APPLE LOCAL begin lno */
+ flag_tree_loop_im = 1;
+ flag_ivopts = 1;
+ flag_tree_vectorize = 0;
+ flag_tree_loop_linear = 0;
+ flag_tree_pre = 1;
+ /* APPLE LOCAL end lno */
flag_tree_ter = 1;
flag_tree_live_range_split = 1;
flag_tree_sra = 1;
@@ -662,6 +691,13 @@ decode_options (unsigned int argc, const char **argv)
flag_reorder_blocks_and_partition = 0;
flag_reorder_blocks = 1;
}
+
+ /* APPLE LOCAL begin AV 3846092 */
+ /* We have apple local patch to disable -fstrict-aliasing when -O2 is used.
+ Do not disable it when -ftree-vectorize is used. */
+ if (optimize >= 2 && flag_tree_vectorize)
+ flag_strict_aliasing = 1;
+ /* APPLE LOCAL end AV 3846092 */
}
/* Handle target- and language-independent options. Return zero to
@@ -676,6 +712,12 @@ common_handle_option (size_t scode, const char *arg, int value)
switch (code)
{
+ /* APPLE LOCAL begin fat builds */
+ case OPT_arch:
+ /* Ignore for now. */
+ break;
+ /* APPLE LOCAL end fat builds */
+
case OPT__help:
print_help ();
exit_after_options = true;
@@ -771,6 +813,26 @@ common_handle_option (size_t scode, const char *arg, int value)
align_loops = value;
break;
+ /* APPLE LOCAL begin predictive compilation */
+ case OPT_fpredictive_compilation:
+ predictive_compilation = 0;
+ break;
+
+ case OPT_fpredictive_compilation_:
+ {
+ char* buf = xmalloc (strlen(arg) + 1);
+ sprintf (buf, "%d", value);
+ if (strcmp(buf, arg))
+ {
+ error ("argument to \"-fpredictive-compilation=\" should be a valid non-negative integer instead of \"%s\"", arg);
+ value = 0;
+ }
+ free(buf);
+ predictive_compilation = value;
+ break;
+ }
+ /* APPLE LOCAL end predictive compilation */
+
case OPT_fbranch_probabilities:
flag_branch_probabilities_set = true;
break;
@@ -834,6 +896,9 @@ common_handle_option (size_t scode, const char *arg, int value)
profile_arc_flag_set = true;
break;
+ /* APPLE LOCAL begin add fuse-profile */
+ case OPT_fuse_profile:
+ /* APPLE LOCAL end add fuse-profile */
case OPT_fprofile_use:
if (!flag_branch_probabilities_set)
flag_branch_probabilities = value;
@@ -853,6 +918,9 @@ common_handle_option (size_t scode, const char *arg, int value)
#endif
break;
+ /* APPLE LOCAL begin add fcreate-profile */
+ case OPT_fcreate_profile:
+ /* APPLE LOCAL end add fcreate-profile */
case OPT_fprofile_generate:
if (!profile_arc_flag_set)
profile_arc_flag = value;
@@ -970,6 +1038,12 @@ common_handle_option (size_t scode, const char *arg, int value)
flag_unroll_loops_set = true;
break;
+ /* APPLE LOCAL begin fwritable strings */
+ case OPT_fwritable_strings:
+ flag_writable_strings = value;
+ break;
+ /* APPLE LOCAL end fwritable strings */
+
case OPT_g:
set_debug_level (NO_DEBUG, DEFAULT_GDB_EXTENSIONS, arg);
break;
@@ -1132,6 +1206,12 @@ set_debug_level (enum debug_info_type type, int extended, const char *arg)
#elif defined DBX_DEBUGGING_INFO
write_symbols = DBX_DEBUG;
#endif
+/* APPLE LOCAL begin dwarf */
+/* Even though DWARF2_DEBUGGING_INFO is defined, use stabs for
+ debugging symbols with -ggdb. Remove this local patch when we
+ switch to dwarf. */
+ write_symbols = DBX_DEBUG;
+/* APPLE LOCAL end dwarf */
}
if (write_symbols == NO_DEBUG)
diff --git a/gcc/params.def b/gcc/params.def
index c424ad59f10..e1169be3149 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -245,6 +245,16 @@ DEFPARAM(PARAM_MAX_UNSWITCH_LEVEL,
"The maximum number of unswitchings in a single loop",
3, 0, 0)
+/* APPLE LOCAL begin lno */
+/* This parameter limits the size of loop for that we attempt to
+ do doloop optimalization. We set this quite high so that we do
+ not punish unrolled loops. */
+DEFPARAM(PARAM_MAX_DOLOOP_INSNS,
+ "max-doloop-insns",
+ "The maximum number of instructions of loop processed by doloop optimization",
+ 1000, 0, -1)
+/* APPLE LOCAL end lno */
+
/* The maximum number of iterations of a loop the brute force algorithm
for analysis of # of iterations of the loop tries to evaluate. */
DEFPARAM(PARAM_MAX_ITERATIONS_TO_TRACK,
@@ -377,8 +387,10 @@ DEFPARAM(PARAM_MAX_CSELIB_MEMORY_LOCATIONS,
# define GGC_MIN_EXPAND_DEFAULT 0
# define GGC_MIN_HEAPSIZE_DEFAULT 0
#else
-# define GGC_MIN_EXPAND_DEFAULT 30
-# define GGC_MIN_HEAPSIZE_DEFAULT 4096
+/* APPLE LOCAL begin try to improve ggc */
+# define GGC_MIN_EXPAND_DEFAULT 100
+# define GGC_MIN_HEAPSIZE_DEFAULT 8192
+/* APPLE LOCAL end try to improve ggc*/
#endif
DEFPARAM(GGC_MIN_EXPAND,
diff --git a/gcc/predict.c b/gcc/predict.c
index 30ad0fe17c9..6d04d5e77c2 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -145,7 +145,8 @@ bool
probably_never_executed_bb_p (basic_block bb)
{
if (profile_info && flag_branch_probabilities)
- return ((bb->count + profile_info->runs / 2) / profile_info->runs) == 0;
+ /* APPLE LOCAL hot/cold partitioning */
+ return (bb->count == 0);
return false;
}
@@ -696,6 +697,11 @@ predict_loops (struct loops *loops_info, bool rtlsimpleloops)
/* Free basic blocks from get_loop_body. */
free (bbs);
}
+
+ /* APPLE LOCAL begin lno */
+ if (rtlsimpleloops)
+ iv_analysis_done ();
+ /* APPLE LOCAL end lno */
if (!rtlsimpleloops)
scev_finalize ();
diff --git a/gcc/print-tree.c b/gcc/print-tree.c
index 8d8cbffc389..d60bb768760 100644
--- a/gcc/print-tree.c
+++ b/gcc/print-tree.c
@@ -274,6 +274,10 @@ print_node (FILE *file, const char *prefix, tree node, int indent)
fputs (" static", file);
if (TREE_DEPRECATED (node))
fputs (" deprecated", file);
+ /* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) */
+ if (TREE_UNAVAILABLE (node))
+ fputs (" unavailable", file);
+ /* APPLE LOCAL end "unavailable" attribute (Radar 2809697) */
if (TREE_VISITED (node))
fputs (" visited", file);
if (TREE_LANG_FLAG_0 (node))
diff --git a/gcc/reg-notes.def b/gcc/reg-notes.def
index 85a122f6532..3f130cce992 100644
--- a/gcc/reg-notes.def
+++ b/gcc/reg-notes.def
@@ -170,3 +170,8 @@ REG_NOTE (SETJMP)
/* Indicate calls that always returns. */
REG_NOTE (ALWAYS_RETURN)
+
+/* APPLE LOCAL begin ObjC direct dispatch */
+/* Indicate calls to a hard-coded address in memory. */
+REG_NOTE (ABSCALL)
+/* APPLE LOCAL end ObjC direct dispatch */
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 744f181bd18..e81f334f676 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -1283,6 +1283,14 @@ static bool
mode_change_ok (enum machine_mode orig_mode, enum machine_mode new_mode,
unsigned int regno ATTRIBUTE_UNUSED)
{
+ /* APPLE LOCAL begin add mode change case */
+#ifdef TARGET_POWERPC
+ /* This arises from FLOAT_EXTEND which is really a NOP. */
+ if (orig_mode == SFmode && new_mode == DFmode)
+ return true;
+#endif
+ /* APPLE LOCAL end add mode change case */
+
if (GET_MODE_SIZE (orig_mode) < GET_MODE_SIZE (new_mode))
return false;
@@ -1733,6 +1741,15 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
/* Notice copies. */
if (set && REG_P (SET_DEST (set)) && REG_P (SET_SRC (set)))
copy_value (SET_DEST (set), SET_SRC (set), vd);
+ /* APPLE LOCAL begin record that float extend is a copy */
+#ifdef TARGET_POWERPC
+ /* FLOAT_EXTEND is actually a copy; record that too. */
+ if (set && REG_P (SET_DEST (set))
+ && GET_CODE (SET_SRC (set)) == FLOAT_EXTEND
+ && REG_P (XEXP (SET_SRC (set), 0)))
+ copy_value (SET_DEST (set), XEXP (SET_SRC (set), 0), vd);
+#endif
+ /* APPLE LOCAL end record that float extend is a copy */
if (insn == BB_END (bb))
break;
diff --git a/gcc/reload.c b/gcc/reload.c
index 015637e47aa..2b770581271 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -1310,18 +1310,34 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
and IN or CLASS and OUT. Get the icode and push any required reloads
needed for each of them if so. */
+ /* APPLE LOCAL begin restoration of inmode/outmode */
#ifdef SECONDARY_INPUT_RELOAD_CLASS
if (in != 0)
- secondary_in_reload
- = push_secondary_reload (1, in, opnum, optional, class, inmode, type,
- &secondary_in_icode);
+ {
+ secondary_in_reload
+ = push_secondary_reload (1, in, opnum, optional, class, inmode, type,
+ &secondary_in_icode);
+#ifdef TARGET_POWERPC
+ if ( secondary_in_reload != -1 && in_subreg_loc )
+ inmode = GET_MODE (*in_subreg_loc);
+#endif
+ }
+ /* APPLE LOCAL end restoration of inmode/outmode */
#endif
#ifdef SECONDARY_OUTPUT_RELOAD_CLASS
+ /* APPLE LOCAL begin restoration of inmode/outmode */
if (out != 0 && GET_CODE (out) != SCRATCH)
- secondary_out_reload
- = push_secondary_reload (0, out, opnum, optional, class, outmode,
- type, &secondary_out_icode);
+ {
+ secondary_out_reload
+ = push_secondary_reload (0, out, opnum, optional, class, outmode,
+ type, &secondary_out_icode);
+#ifdef TARGET_POWERPC
+ if ( secondary_out_reload != -1 && out_subreg_loc )
+ outmode = GET_MODE (*out_subreg_loc);
+#endif
+ }
+ /* APPLE LOCAL end restoration of inmode/outmode */
#endif
/* We found no existing reload suitable for re-use.
@@ -1729,7 +1745,13 @@ combine_reloads (void)
if ((rld[i].when_needed == RELOAD_FOR_OUTPUT_ADDRESS
|| rld[i].when_needed == RELOAD_FOR_OUTADDR_ADDRESS)
&& rld[i].opnum == rld[output_reload].opnum)
+ /* APPLE LOCAL begin try destroyed input */
+#ifdef TARGET_POWERPC
+ goto try_destroyed_input;
+#else
return;
+#endif
+ /* APPLE LOCAL end try destroyed input */
/* Check each input reload; can we combine it? */
@@ -1826,6 +1848,11 @@ combine_reloads (void)
that it does not occur in the output (we already know it isn't an
earlyclobber. If this is an asm insn, give up. */
+ /* APPLE LOCAL begin try destroyed input */
+#ifdef TARGET_POWERPC
+ try_destroyed_input:
+#endif
+ /* APPLE LOCAL end try destroyed input */
if (INSN_CODE (this_insn) == -1)
return;
@@ -2159,15 +2186,20 @@ operands_match_p (rtx x, rtx y)
else
j = REGNO (y);
+ /* APPLE LOCAL begin mainline 2005-03-04 */
/* On a WORDS_BIG_ENDIAN machine, point to the last register of a
- multiple hard register group, so that for example (reg:DI 0) and
- (reg:SI 1) will be considered the same register. */
+ multiple hard register group of scalar integer registers, so that
+ for example (reg:DI 0) and (reg:SI 1) will be considered the same
+ register. */
if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD
+ && SCALAR_INT_MODE_P (GET_MODE (x))
&& i < FIRST_PSEUDO_REGISTER)
i += hard_regno_nregs[i][GET_MODE (x)] - 1;
if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (y)) > UNITS_PER_WORD
+ && SCALAR_INT_MODE_P (GET_MODE (y))
&& j < FIRST_PSEUDO_REGISTER)
j += hard_regno_nregs[j][GET_MODE (y)] - 1;
+ /* APPLE LOCAL end mainline 2005-03-04 */
return i == j;
}
diff --git a/gcc/reload1.c b/gcc/reload1.c
index d4141be5aee..2e7c33df4f9 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -5605,23 +5605,18 @@ choose_reload_regs (struct insn_chain *chain)
and of the desired class. */
if (equiv != 0)
{
- int regs_used = 0;
+ /* APPLE LOCAL begin don't reload unavailable hard regs. PR/16028 */
int bad_for_class = 0;
int max_regno = regno + rld[r].nregs;
for (i = regno; i < max_regno; i++)
- {
- regs_used |= TEST_HARD_REG_BIT (reload_reg_used_at_all,
- i);
bad_for_class |= ! TEST_HARD_REG_BIT (reg_class_contents[(int) rld[r].class],
i);
- }
-
- if ((regs_used
- && ! free_for_value_p (regno, rld[r].mode,
- rld[r].opnum, rld[r].when_needed,
- rld[r].in, rld[r].out, r, 1))
- || bad_for_class)
+ if (bad_for_class
+ || ! free_for_value_p (regno, rld[r].mode,
+ rld[r].opnum, rld[r].when_needed,
+ rld[r].in, rld[r].out, r, 1))
+ /* APPLE LOCAL end don't reload unavailable hard regs. PR/16028 */
equiv = 0;
}
diff --git a/gcc/rtl.h b/gcc/rtl.h
index b0d839a5337..51117ccc01e 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1424,6 +1424,10 @@ extern rtx simplify_subtraction (rtx);
/* In function.c */
extern rtx assign_stack_local (enum machine_mode, HOST_WIDE_INT, int);
+/* APPLE LOCAL begin next declaration */
+extern rtx assign_stack_local_with_alias (enum machine_mode,
+ HOST_WIDE_INT, int);
+/* APPLE LOCAL end next declaration */
extern rtx assign_stack_temp (enum machine_mode, HOST_WIDE_INT, int);
extern rtx assign_stack_temp_for_type (enum machine_mode,
HOST_WIDE_INT, int, tree);
@@ -2122,6 +2126,8 @@ extern int read_rtx_lineno;
extern void clear_reg_alias_info (rtx);
extern rtx canon_rtx (rtx);
extern int true_dependence (rtx, enum machine_mode, rtx, int (*)(rtx, int));
+/* APPLE LOCAL nop on true-dependence. */
+extern int must_true_dependence (rtx, rtx);
extern rtx get_addr (rtx);
extern int canon_true_dependence (rtx, enum machine_mode, rtx, rtx,
int (*)(rtx, int));
diff --git a/gcc/scan-decls.c b/gcc/scan-decls.c
index 7beaa24f0cf..d7dd0a621d4 100644
--- a/gcc/scan-decls.c
+++ b/gcc/scan-decls.c
@@ -39,6 +39,13 @@ int extern_C_braces_length = 0;
char extern_C_braces[MAX_EXTERN_C_BRACES];
#define in_extern_C_brace (extern_C_braces_length>0)
+/* APPLE LOCAL begin CW asm blocks */
+/* Dummies needed because we use them in cpplib, yuck. */
+int flag_cw_asm_blocks;
+int cw_asm_state;
+int cw_asm_in_operands;
+/* APPLE LOCAL end CW asm blocks */
+
/* True if the function declaration currently being scanned is
prefixed by extern "C". */
int current_extern_C = 0;
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index d5004e4e032..271810d6335 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -994,6 +994,11 @@ compute_trg_info (int trg)
edge_iterator ei;
edge e;
+ /* APPLE LOCAL begin lno */
+ el.nr_members = 0;
+ el.first_member = 0;
+ /* APPLE LOCAL end lno */
+
/* Define some of the fields for the target bb as well. */
sp = candidate_table + trg;
sp->is_valid = 1;
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index dc452dbdc26..5d16778a2ee 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -955,7 +955,10 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
/* (neg (plus X 1)) can become (not X). */
if (GET_CODE (op) == PLUS
- && XEXP (op, 1) == const1_rtx)
+ /* APPLE LOCAL begin disallow generating (not (SYM)) */
+ && XEXP (op, 1) == const1_rtx
+ && GET_CODE (XEXP (op, 0)) != SYMBOL_REF)
+ /* APPLE LOCAL end disallow generating (not (SYM)) */
return simplify_gen_unary (NOT, mode, XEXP (op, 0), mode);
/* Similarly, (neg (not X)) is (plus X 1). */
@@ -973,9 +976,12 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
return simplify_gen_binary (MINUS, mode, XEXP (op, 1),
XEXP (op, 0));
+ /* APPLE LOCAL begin don't allow subtraction of symbol address */
if (GET_CODE (op) == PLUS
&& !HONOR_SIGNED_ZEROS (mode)
- && !HONOR_SIGN_DEPENDENT_ROUNDING (mode))
+ && !HONOR_SIGN_DEPENDENT_ROUNDING (mode)
+ && GET_CODE (XEXP (op, 0)) != SYMBOL_REF)
+ /* APPLE LOCAL end don't allow subtraction of symbol address */
{
/* (neg (plus A C)) is simplified to (minus -C A). */
if (GET_CODE (XEXP (op, 1)) == CONST_INT
@@ -1681,7 +1687,12 @@ simplify_binary_operation (enum rtx_code code, enum machine_mode mode,
return simplify_gen_unary (NEG, mode, op1, mode);
/* (-1 - a) is ~a. */
- if (trueop0 == constm1_rtx)
+ /* APPLE LOCAL begin disallow generating (not (SYM))
+ But not when a is relocatable (this arises temporarily when
+ pulling 386 global addresses out of a loop). */
+ if (trueop0 == constm1_rtx
+ && GET_CODE (op1) != SYMBOL_REF )
+ /* APPLE LOCAL end disallow generating (not (SYM)) */
return simplify_gen_unary (NOT, mode, op1, mode);
/* Subtracting 0 has no effect unless the mode has signed zeros
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index ac7fb744f66..ed952ce84ee 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -72,6 +72,15 @@ static GTY(()) tree pending_sizes;
/* Show that REFERENCE_TYPES are internal and should be Pmode. Called only
by front end. */
+/* APPLE LOCAL begin Macintosh alignment 2002-5-24 --ff */
+/* Keep track of whether we are laying out the first declared member
+ of a C++ class. We need this flag to handle the case of classes
+ with v-tables where the test to see if the offset in the record
+ is zero is not sufficient to determine if we are dealing with the
+ first declared member. */
+int darwin_align_is_first_member_of_class = 0;
+/* APPLE LOCAL end Macintosh alignment 2002-5-24 --ff */
+
void
internal_reference_types (void)
{
@@ -415,6 +424,12 @@ layout_decl (tree decl, unsigned int known_align)
|| DECL_SIZE_UNIT (decl) == 0
|| TREE_CODE (DECL_SIZE_UNIT (decl)) == INTEGER_CST))
DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT);
+/* APPLE LOCAL begin Macintosh alignment 2002-2-12 --ff */
+#ifdef PEG_ALIGN_FOR_MAC68K
+ else if (TARGET_ALIGN_MAC68K)
+ DECL_ALIGN (decl) = PEG_ALIGN_FOR_MAC68K (DECL_ALIGN (decl));
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-12 --ff */
if (! DECL_USER_ALIGN (decl) && ! DECL_PACKED (decl))
{
@@ -426,7 +441,10 @@ layout_decl (tree decl, unsigned int known_align)
= MIN (DECL_ALIGN (decl), (unsigned) BIGGEST_FIELD_ALIGNMENT);
#endif
#ifdef ADJUST_FIELD_ALIGN
- DECL_ALIGN (decl) = ADJUST_FIELD_ALIGN (decl, DECL_ALIGN (decl));
+ /* APPLE LOCAL begin Macintosh alignment 2002-5-24 --ff */
+ DECL_ALIGN (decl) = ADJUST_FIELD_ALIGN (decl, DECL_ALIGN (decl),
+ known_align == 0);
+ /* APPLE LOCAL end Macintosh alignment 2002-5-24 --ff */
#endif
}
@@ -663,6 +681,23 @@ update_alignment_for_field (record_layout_info rli, tree field,
&& DECL_BIT_FIELD_TYPE (field)
&& ! integer_zerop (TYPE_SIZE (type)));
+ /* APPLE LOCAL begin Macintosh alignment 2002-5-24 --ff */
+#ifdef ADJUST_FIELD_ALIGN
+ if (! user_align && TREE_CODE (rli->t) == RECORD_TYPE)
+ /* The third argument to ADJUST_FIELD_ALIGN indicates whether
+ we are dealing with the first field of the structure.
+ Only adjust the alignment for structs. For unions, every
+ field is the 'first' field and thus holds to its
+ natural alignment. Alignment of union is later deterimined
+ by the maximum alignment among all its fields. */
+ desired_align =
+ ADJUST_FIELD_ALIGN (field, desired_align,
+ (darwin_align_is_first_member_of_class
+ || (integer_zerop (rli->offset)
+ && integer_zerop (rli->bitpos))));
+#endif
+ /* APPLE LOCAL end Macintosh alignment 2002-5-24 --ff */
+
/* Record must have at least as much alignment as any field.
Otherwise, the alignment of the field within the record is
meaningless. */
@@ -701,13 +736,24 @@ update_alignment_for_field (record_layout_info rli, tree field,
#ifdef ADJUST_FIELD_ALIGN
if (! TYPE_USER_ALIGN (type))
- type_align = ADJUST_FIELD_ALIGN (field, type_align);
+ /* APPLE LOCAL begin Macintosh alignment */
+ type_align = ADJUST_FIELD_ALIGN (field, type_align,
+ (darwin_align_is_first_member_of_class
+ || (integer_zerop (rli->offset)
+ && integer_zerop (rli->bitpos))));
+ /* APPLE LOCAL end Macintosh alignment */
#endif
if (maximum_field_alignment != 0)
type_align = MIN (type_align, maximum_field_alignment);
else if (DECL_PACKED (field))
type_align = MIN (type_align, BITS_PER_UNIT);
+/* APPLE LOCAL begin Macintosh alignment 2002-2-12 --ff */
+#ifdef PEG_ALIGN_FOR_MAC68K
+ else if (TARGET_ALIGN_MAC68K)
+ type_align = PEG_ALIGN_FOR_MAC68K (type_align);
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-12 --ff */
/* The alignment of the record is increased to the maximum
of the current alignment, the alignment indicated on the
@@ -894,6 +940,11 @@ place_field (record_layout_info rli, tree field)
&& DECL_BIT_FIELD (field)
&& ! DECL_PACKED (field)
&& maximum_field_alignment == 0
+/* APPLE LOCAL begin Macintosh alignment 2002-2-12 --ff */
+#ifdef PEG_ALIGN_FOR_MAC68K
+ && ! TARGET_ALIGN_MAC68K
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-12 --ff */
&& ! integer_zerop (DECL_SIZE (field))
&& host_integerp (DECL_SIZE (field), 1)
&& host_integerp (rli->offset, 1)
@@ -907,7 +958,12 @@ place_field (record_layout_info rli, tree field)
#ifdef ADJUST_FIELD_ALIGN
if (! TYPE_USER_ALIGN (type))
- type_align = ADJUST_FIELD_ALIGN (field, type_align);
+ /* APPLE LOCAL begin Macintosh alignment */
+ type_align = ADJUST_FIELD_ALIGN (field, type_align,
+ (darwin_align_is_first_member_of_class
+ || (integer_zerop (rli->offset)
+ && integer_zerop (rli->bitpos))));
+ /* APPLE LOCAL end Macintosh alignment */
#endif
/* A bit field may not span more units of alignment of its type
@@ -939,7 +995,12 @@ place_field (record_layout_info rli, tree field)
#ifdef ADJUST_FIELD_ALIGN
if (! TYPE_USER_ALIGN (type))
- type_align = ADJUST_FIELD_ALIGN (field, type_align);
+ /* APPLE LOCAL begin Macintosh alignment */
+ type_align = ADJUST_FIELD_ALIGN (field, type_align,
+ (darwin_align_is_first_member_of_class
+ || (integer_zerop (rli->offset)
+ && integer_zerop (rli->bitpos))));
+ /* APPLE LOCAL end Macintosh alignment */
#endif
if (maximum_field_alignment != 0)
@@ -948,6 +1009,12 @@ place_field (record_layout_info rli, tree field)
statement, so this code is unreachable currently. */
else if (DECL_PACKED (field))
type_align = MIN (type_align, BITS_PER_UNIT);
+/* APPLE LOCAL begin Macintosh alignment 2002-2-12 --ff */
+#ifdef PEG_ALIGN_FOR_MAC68K
+ else if (TARGET_ALIGN_MAC68K)
+ type_align = PEG_ALIGN_FOR_MAC68K (type_align);
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-12 --ff */
/* A bit field may not span the unit of alignment of its type.
Advance to next boundary if necessary. */
@@ -1298,6 +1365,16 @@ compute_record_mode (tree type)
#endif /* MEMBER_TYPE_FORCES_BLK */
}
+ /* APPLE LOCAL begin 8-byte-struct hack */
+#if defined RS6000_VARARGS_AREA
+ /* Make 8-byte structs BLKmode instead of DImode, which fixes both
+ struct-return methods and attempts to use floats in kernel code.
+ This should probably become a generic macro similar to
+ MEMBER_TYPE_FORCES_BLK above. */
+ if (! (mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1) == DImode
+ && flag_pic))
+#endif
+ /* APPLE LOCAL end */
TYPE_MODE (type) = mode_for_size_tree (TYPE_SIZE (type), MODE_INT, 1);
/* If we only have one real field; use its mode if that mode's size
diff --git a/gcc/stub-objc.c b/gcc/stub-objc.c
index f01fd9b4249..2901860041b 100644
--- a/gcc/stub-objc.c
+++ b/gcc/stub-objc.c
@@ -230,6 +230,14 @@ objc_get_class_reference (tree ARG_UNUSED (name))
return 0;
}
+/* APPLE LOCAL begin Objective-C++ */
+tree
+objc_get_class_ivars (tree ARG_UNUSED (name))
+{
+ return 0;
+}
+/* APPLE LOCAL end Objective-C++ */
+
tree
objc_get_protocol_qualified_type (tree ARG_UNUSED (name),
tree ARG_UNUSED (protos))
@@ -254,3 +262,54 @@ objc_is_public (tree ARG_UNUSED (expr), tree ARG_UNUSED (identifier))
{
return 1;
}
+
+/* APPLE LOCAL begin Objective-C++ */
+tree
+objc_build_throw_stmt (tree ARG_UNUSED (expr))
+{
+ return 0;
+}
+
+void
+objc_begin_try_stmt (location_t ARG_UNUSED (loc), tree ARG_UNUSED (stmt))
+{
+}
+
+tree
+objc_finish_try_stmt (void)
+{
+ return 0;
+}
+
+void
+objc_begin_catch_clause (tree ARG_UNUSED (parm))
+{
+}
+
+void
+objc_finish_catch_clause (void) {
+}
+
+void
+objc_build_finally_clause (location_t ARG_UNUSED (location),
+ tree ARG_UNUSED (stmt))
+{
+}
+
+tree
+objc_build_synchronized (location_t ARG_UNUSED (location),
+ tree ARG_UNUSED (lock), tree ARG_UNUSED (stmt))
+{
+ return 0;
+}
+/* APPLE LOCAL end Objective-C++ */
+
+/* APPLE LOCAL begin ObjC GC */
+tree
+objc_generate_write_barrier (tree ARG_UNUSED (lhs),
+ enum tree_code ARG_UNUSED (modifycode),
+ tree ARG_UNUSED (rhs))
+{
+ return 0;
+}
+/* APPLE LOCAL end ObjC GC */
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 499d37fb9f2..e8f2ba9a306 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -294,6 +294,16 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_EXPAND_BUILTIN default_expand_builtin
#define TARGET_FOLD_BUILTIN hook_tree_tree_bool_null
+/* APPLE LOCAL begin constant cfstrings */
+/* In c-common.c. */
+#ifndef TARGET_EXPAND_TREE_BUILTIN
+#define TARGET_EXPAND_TREE_BUILTIN hook_tree_tree_tree_tree_null
+#endif
+#ifndef TARGET_CONSTRUCT_OBJC_STRING
+#define TARGET_CONSTRUCT_OBJC_STRING hook_tree_tree_null
+#endif
+/* APPLE LOCAL end constant cfstrings */
+
/* In varasm.c. */
#ifndef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS default_section_type_flags
@@ -356,6 +366,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_ENCODE_SECTION_INFO default_encode_section_info
#endif
+/* APPLE LOCAL begin AltiVec */
+#define TARGET_CAST_EXPR_AS_VECTOR_INIT false
+/* APPLE LOCAL end AltiVec */
+
#define TARGET_FIXED_CONDITION_CODE_REGS hook_bool_uintp_uintp_false
#define TARGET_CC_MODES_COMPATIBLE default_cc_modes_compatible
@@ -390,6 +404,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_STRICT_ARGUMENT_NAMING hook_bool_CUMULATIVE_ARGS_false
#define TARGET_PRETEND_OUTGOING_VARARGS_NAMED \
default_pretend_outgoing_varargs_named
+/* APPLE LOCAL begin Altivec */
+#define TARGET_SKIP_VEC_ARGS default_skip_vec_args
+/* APPLE LOCAL end Altivec */
+
#define TARGET_SPLIT_COMPLEX_ARG NULL
#define TARGET_GIMPLIFY_VA_ARG_EXPR std_gimplify_va_arg_expr
@@ -414,6 +432,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_STRICT_ARGUMENT_NAMING, \
TARGET_PRETEND_OUTGOING_VARARGS_NAMED, \
TARGET_SPLIT_COMPLEX_ARG, \
+ /* APPLE LOCAL begin Altivec */ \
+ TARGET_SKIP_VEC_ARGS, \
+ /* APPLE LOCAL end Altivec */ \
TARGET_MUST_PASS_IN_STACK, \
TARGET_CALLEE_COPIES, \
TARGET_ARG_PARTIAL_BYTES \
@@ -492,6 +513,10 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ALIGN_ANON_BITFIELD, \
TARGET_INIT_BUILTINS, \
TARGET_EXPAND_BUILTIN, \
+ /* APPLE LOCAL begin constant cfstrings */ \
+ TARGET_EXPAND_TREE_BUILTIN, \
+ TARGET_CONSTRUCT_OBJC_STRING, \
+ /* APPLE LOCAL end constant cfstrings */ \
TARGET_FOLD_BUILTIN, \
TARGET_MANGLE_FUNDAMENTAL_TYPE, \
TARGET_INIT_LIBFUNCS, \
@@ -536,6 +561,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_TERMINATE_DW2_EH_FRAME_INFO, \
TARGET_ASM_FILE_START_APP_OFF, \
TARGET_ASM_FILE_START_FILE_DIRECTIVE, \
+ /* APPLE LOCAL AltiVec */ \
+ TARGET_CAST_EXPR_AS_VECTOR_INIT, \
TARGET_HANDLE_PRAGMA_REDEFINE_EXTNAME, \
TARGET_HANDLE_PRAGMA_EXTERN_PREFIX, \
TARGET_RELAXED_ORDERING, \
diff --git a/gcc/target.h b/gcc/target.h
index 0a54c6f7bb4..5524d88e40d 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -333,6 +333,18 @@ struct gcc_target
rtx (* expand_builtin) (tree exp, rtx target, rtx subtarget,
enum machine_mode mode, int ignore);
+ /* APPLE LOCAL begin constant cfstrings */
+ /* Expand a platform-specific (but machine-independent) builtin. */
+ tree (* expand_tree_builtin) (tree function, tree params,
+ tree coerced_params);
+
+ /* Construct a target-specific Objective-C string object based on the
+ STRING_CST passed in STR, or NULL if the default Objective-C objects
+ (based on NSConstantString or NXConstantString) should be used
+ instead. */
+ tree (* construct_objc_string) (tree str);
+ /* APPLE LOCAL end constant cfstrings */
+
/* Fold a target-specific builtin. */
tree (* fold_builtin) (tree exp, bool ignore);
@@ -454,7 +466,6 @@ struct gcc_target
/* Create the __builtin_va_list type. */
tree (* build_builtin_va_list) (void);
- /* Gimplifies a VA_ARG_EXPR. */
tree (* gimplify_va_arg_expr) (tree valist, tree type, tree *pre_p,
tree *post_p);
@@ -525,6 +536,9 @@ struct gcc_target
/* Given a complex type T, return true if a parameter of type T
should be passed as two scalars. */
bool (* split_complex_arg) (tree type);
+ /* APPLE LOCAL begin Altivec */
+ bool (*skip_vec_args) (tree, int, int*);
+ /* APPLE LOCAL end Altivec */
/* Return true if type T, mode MODE, may not be passed in registers,
but must be passed on the stack. */
@@ -598,6 +612,17 @@ struct gcc_target
at the beginning of assembly output. */
bool file_start_file_directive;
+ /* APPLE LOCAL begin AltiVec */
+ /* True if it is permissible to use cast expressions as
+ vector initializers, e.g.:
+
+ (vector unsigned int)(3, 4, 5, 6)
+ (vector float)(2.5)
+
+ This is required for the Motorola AltiVec syntax on the PowerPC. */
+ bool cast_expr_as_vector_init;
+ /* APPLE LOCAL end AltiVec */
+
/* True if #pragma redefine_extname is to be supported. */
bool handle_pragma_redefine_extname;
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 56070931e01..b93ee63539b 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -129,6 +129,16 @@ default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
!= default_setup_incoming_varargs);
}
+/* APPLE LOCAL begin Altivec */
+bool
+default_skip_vec_args(tree type ATTRIBUTE_UNUSED,
+ int pass ATTRIBUTE_UNUSED,
+ int* last_pass ATTRIBUTE_UNUSED)
+{
+ return false;
+}
+/* APPLE LOCAL end Altivec */
+
enum machine_mode
default_eh_return_filter_mode (void)
{
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 1965bbdb60c..d03cc445291 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -29,6 +29,9 @@ extern rtx default_expand_builtin_saveregs (void);
extern void default_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
extern rtx default_builtin_setjmp_frame_value (void);
extern bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
+/* APPLE LOCAL begin Altivec */
+extern bool default_skip_vec_args (tree, int, int*);
+/* APPLE LOCAL end Altivec */
extern enum machine_mode default_eh_return_filter_mode (void);
extern unsigned HOST_WIDE_INT default_shift_truncation_mask
diff --git a/gcc/testsuite/ChangeLog.apple-ppc b/gcc/testsuite/ChangeLog.apple-ppc
new file mode 100644
index 00000000000..13e4ba881c1
--- /dev/null
+++ b/gcc/testsuite/ChangeLog.apple-ppc
@@ -0,0 +1,999 @@
+2005-03-09 Ziemowit Laski <zlaski@apple.com>
+
+ * objc.dg/selector-2.m: Move dg-warning to correct line.
+
+2005-03-08 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/vect/vect-none.c: One test that uses condition
+ is now vectorized.
+
+2005-03-03 Dale Johannesen <dalej@apple.com>
+
+ Radar 3897244
+ * gcc.apple/align-test-1.c: Adjust for x86.
+ * gcc.apple/align-test-2.c: Adjust for x86.
+ * gcc.apple/align-test-3.c: Adjust for x86.
+ * gcc.apple/align-test-4.c: Adjust for x86.
+ * gcc.apple/align-test-5a.c: Adjust for x86.
+ * gcc.apple/align-test-5d.c: New.
+ * g++.dg/align-test-1.C: Adjust for x86.
+ * g++.old-deja/g++.abi/align.C: Enable for darwin x86.
+
+2005-03-02 Robert Bowdidge <bowdidge@apple.com>
+ Radar 4025923
+ * g++.dg/kext11.C: add new test for ptmf casts in kexts
+
+2005-03-02 Stan Shebs <shebs@apple.com>
+
+ Radar 3951637
+ * gcc.dg/ppc_intrinsics-2.c: New.
+ * gcc.dg/ppc_intrinsics-1.c: Is ppc-only.
+
+2005-03-01 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4015382 (Part II)
+ * g++.dg/ext/new-delete-1.C: Replace confusing '$'
+ with '.' in search string.
+ * g++.dg/ext/new-delete-2.C: Likewise.
+
+2005-02-28 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4015382
+ * g++.dg/ext/new-delete-1.C: New.
+ * g++.dg/ext/new-delete-2.C: New.
+
+2005-02-25 Stan Shebs <shebs@apple.com>
+
+ Radar 4020219
+ * gcc.dg/pragma-darwin.c: Avoid mac68k align stuff if 64-bit.
+ * g++.dg/expr/align68k-1.C: Stub out for 64-bit.
+ * g++.dg/expr/align68k-2.C: Stub out for 64-bit.
+
+2005-02-23 Devang Patel <dpatel@apple.com>
+
+ Radar 4021019
+ * gcc.apple/ppc-ignored-options.c: New test.
+ * gcc.apple/x86-ignored-options.c: New test.
+
+2005-02-23 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3809189 (additional test cases)
+ * obj-c++.dg/pascal-strings-1.mm: New.
+ * obj-c++.dg/pascal-strings-2.mm: New.
+ * objc.dg/pascal-strings-1.m: New.
+
+2005-02-22 Devang Patel <dpatel@apple.com>
+
+ Radar 3844827
+ Backport from Mainline.
+
+ 2005-01-18 Michael Matz <matz@suse.de>
+
+ * gcc.dg/Wno-pointer-sign.c: New test for -Wno-pointer-sign.
+
+2005-02-22 Dale Johannesen <dalej@apple.com>
+
+ Radar 4015820
+ * obj-c++.dg/objc-fast-4.mm: New.
+
+2005-02-22 Dale Johannesen <dalej@apple.com>
+
+ Radar 4015820
+ * objc.dg/objc-fast-4.m: New.
+
+2005-02-21 Stan Shebs <shebs@apple.com>
+
+ Radar 3939071
+ * gcc.dg/mac68k-pragma-unsup-1.c: New.
+
+2005-02-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3809189
+ * g++.dg/pascal-strings-3.C: New.
+ * g++.dg/pascal-strings-4.C: New.
+ * gcc.apple/pascal-strings-3.c: New.
+
+2005-02-21 Devang Patel <dpatel@apple.com>
+
+ Radar 4007432
+ * gcc.dg/cpp/mac-eol-at-eof.c: New test.
+
+2005-02-19 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4014879
+ * obj-c++.dg/objc-fast-3.mm: New.
+ * objc.dg/objc-fast-3.m: New.
+
+2005-02-18 Devang Patel <dpatel@apple.com>
+
+ Radar 3984893
+ * gcc.dg/vect/vect-dv-1.c: New.
+
+2005-02-18 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4011192
+ * obj-c++.dg/try-catch-7.mm: New.
+ * obj-c++.dg/try-catch-8.mm: New.
+ * objc.dg/try-catch-6.m: New.
+ * objc.dg/try-catch-7.m: New.
+
+2005-02-17 Devang Patel <dpatel@apple.com>
+
+ Radar 3958387
+ * gcc.apple/Wno-newline-1.c: New.
+ * gcc.apple/Wno-newline-2.c: New.
+
+2005-02-17 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3971074
+
+ * gcc.apple/asm-function-14.c: New.
+
+2005-02-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 4006978
+ * obj-c++.dg/isa-field-1.mm: New.
+ * objc.dg/isa-field-1.m: New.
+
+2005-02-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3635843, 3922342
+ * obj-c++.dg/objc-fast-1.mm: New.
+ * obj-c++.dg/objc-fast-2.mm: New.
+ * obj-c++.dg/objc-gc-1.mm: New.
+ * obj-c++.dg/objc-gc-2.mm: New.
+ * objc.dg/next-runtime-1.m: New.
+ * objc.dg/objc-fast-1.m: New.
+ * objc.dg/objc-fast-2.m: New.
+ * objc.dg/objc-gc-1.m: New.
+ * objc.dg/objc-gc-2.m: New.
+ * objc.dg/objc-gc-3.m: New.
+
+2005-02-16 Dale Johannesen <dalej@apple.com>
+
+ Radar 4006687
+ * gcc.dg/i386-mmx-6.c: New (from mainline).
+
+2005-02-16 Dale Johannesen <dalej@apple.com>
+
+ Radar 3991611
+ * gcc.c-torture/execute/20050111-1.c: New (from mainline).
+
+2005-02-16 Fariborz Jahanian <fjahanian@apple.com>
+
+ Radar 3970655
+
+ * g++.dg/asm-function-13.C: New.
+ * gcc.apple/asm-function-13.c: New.
+
+2005-02-11 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3962013 (Part 2)
+ * obj-c++.dg/method-5.mm: New.
+ * objc.dg/method-18.m: New.
+ * objc.dg/method-6.m: Add '-Wstrict-selector-match' flag.
+ * objc.dg/method-9.m: Likewise.
+
+2005-02-11 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3978619
+ * obj-c++.dg/super-dealloc-1.mm: New.
+ * obj-c++.dg/super-dealloc-2.mm: New.
+ * objc.dg/super-dealloc-1.m: New.
+ * objc.dg/super-dealloc-2.m: New.
+
+2005-02-11 Devang Patel <dpatel@apple.com>
+
+ Radar 3996800
+ * gcc.dg/pch/pch.exp: Test MACOSX_DEPLOYMENT_TARGET and -save-temps.
+
+2005-02-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3993052
+ * obj-c++.dg/pragma-2.mm: New.
+ * objc.dg/pragma-1.m: New.
+
+2005-02-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3982256
+ * objc.dg/comp-types-7.m: Sync with FSF mainline.
+ * objc.dg/comp-types-8.m: New.
+
+2005-02-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3987972
+ * objc.dg/method-17.m: New.
+
+2005-02-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3987120
+ * obj-c++.dg/encode-2.mm: New.
+
+2005-02-06 Dale Johannesen <dalej@apple.com>
+
+ * g++.dg/kext10.C: new.
+
+2005-02-02 Stan Shebs <shebs@apple.com>
+
+ * gcc.apple/align-test-5b.c: Xfail for 64-bit.
+ * gcc.apple/align-test-5c.c: Xfail for 64-bit.
+ * gcc.apple/mac68k-align-unsup.c: New.
+
+2005-02-02 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3984534
+ * g++.dg/ext/lvalue-cast-1.cpp: Rename to
+ g++.dg/ext/lvalue-cast-1.C.
+ * g++.dg/ext/lvalue-cast-2.cpp: Rename to
+ g++.dg/ext/lvalue-cast-2.C.
+ * g++.dg/ext/lvalue-cond-1.cpp: Remove duplicated
+ lines; rename to g++.dg/ext/lvalue-cond-1.C; mark
+ warnings as bogus.
+
+2005-02-02 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3978104
+ * obj-c++.dg/extra-semi.mm: New.
+ * objc.dg/extra-semi.m: New.
+
+2005-02-01 Devang Patel <dpatel@apple.com>
+
+ Radar 3983593
+ * gcc.dg/pch/faltivec-1.hs: New.
+ * gcc.dg/pch/faltivec-1.c: New.
+
+2005-01-31 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3978168
+ * g++.dg/ext/lvalue-cast-2.cpp: New.
+ * gcc.dg/lvalue-cast-2.c: New.
+
+2004-01-31 Devang Patel <dpatel@apple.com>
+
+ Radar 3978580
+ * gcc.apple/const-cfstring-4.c: New test.
+
+2005-01-31 Dale Johannesen <dalej@apple.com>
+
+ Radar 3974393
+ * g++.dg/pr19650.C: Modify, move to opt subdirectory.
+
+2005-01-30 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3962013
+ * obj-c++.dg/method-3.mm: New.
+ * obj-c++.dg/method-4.mm: New.
+ * objc.dg/method-16.m: New.
+ * objc.dg/method-7.m: Add '-Wstrict-selector-match'.
+
+2005-01-27 Dale Johannesen <dalej@apple.com>
+
+ Radar 3974393
+ PR 19650
+ * g++.dg/pr19650.C: New.
+
+2005-01-27 Mike Stump <mrs@apple.com>
+
+ Radar 3978098
+ * g++.old-deja/g++.mike/pascal.C: Add.
+
+2005-01-27 Matt Austern <austern@apple.com>
+
+ Radar 3971445
+ * obj-c++.dg/template-5.mm: New.
+ * obj-c++.dg/template-6.mm: New.
+
+2005-01-27 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3971244
+ * obj-c++.dg/comp-types-1.mm: New.
+
+2005-01-26 Matt Austern <austern@apple.com>
+
+ Radar 3972840
+ * g++.dg/kext9.C: New.
+
+2005-01-26 Devang Patel <dpatel@apple.com>
+
+ Radar 3971329
+ * obj-c++.dg/extern-c-1.mm: New test case.
+
+2005-01-26 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3970884
+ * g++.dg/ext/apple-altivec-5.C: New.
+ * g++.dg/ext/apple-altivec-6.C: New.
+
+2005-01-25 Stan Shebs <shebs@apple.com>
+
+ Radar 3220997
+ * g++.dg/align-test-1.C: Fix old problems, add 64-bit cases.
+
+2005-01-25 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3961973 (Part 3)
+ * gcc.dg/cast-lvalue-2.c: Add '-fno-non-lvalue-assign'.
+ * gcc.dg/lvalue1.c: Likewise.
+ * gcc.dg/lvalue-cond-1.c: Remove duplicated lines.
+
+2005-01-24 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3968938
+ * obj-c++.dg/lookup-2.mm: New.
+ * objc.dg/lookup-1.m: New.
+
+2005-01-24 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3961973 (Part 2)
+ * obj-c++.dg/lvalue-cast-1.mm: New.
+ * objc.dg/lvalue-cast-1.m: New.
+
+2005-01-23 Ziemowit Laski <zlaskI@apple.com>
+
+ Radar 3961973
+ * gcc.dg/cond-lvalue-1.c: Add '-fno-non-lvalue-assign';
+ adjust expected line number for error message.
+ * g++.dg/ext/lvalue-cast-1.cpp: Rename -flvalue-cast-assign
+ to -fnon-lvalue-assign; adjust wording of warning message.
+ * gcc.dg/lvalue-cast-1.c: Likewise.
+ * g++.dg/ext/lvalue-cond-1.cpp: New.
+ * gcc.dg/lvalue-cond-1.c: New.
+
+2005-01-21 Stan Shebs <shebs@apple.com>
+
+ Radar 3952527
+ * gcc.apple/align-test-1.c: Add 64-bit alignment values.
+ * gcc.apple/align-test-2.c: Add 64-bit alignment values.
+ * gcc.apple/align-test-3.c: Skip over if compiling 64-bit.
+ * gcc.apple/align-test-4.c: Add 64-bit alignment values.
+
+2005-01-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3951887
+ * objc.dg/comp-types-7.m: New.
+
+2005-01-20 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3958413
+ * gcc.dg/cpp/cpp.exp: Copy headermap test files into '.'.
+ * gcc.dg/cpp/headermap-1.c: New.
+ * gcc.dg/cpp/headermap-2.c: New.
+ * gcc.dg/cpp/headermap.hmap: New.
+ * gcc.dg/cpp/inc/A.h: New.
+ * gcc.dg/cpp/inc/bA.h: New.
+ * gcc.dg/cpp/inc/c.h: New.
+ * gcc.dg/cpp/inc/d/d.h: New.
+
+2005-01-20 Robert Bowdidge <bowdidge@apple.com>
+ Radar 3962986
+ * g++.dg/kext8.C: new check for no coalesced sections in .o's.
+
+2005-01-19 Matt Austern <austern@apple.com>
+
+ Radar 3960754
+ * obj-c++.dg/overload-1.mm: New.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3955336
+ * obj-c++.dg/cxx-scope-1.mm: New.
+ * obj-c++.dg/cxx-scope-2.mm: New.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3953044 (PR objc/19321)
+ * objc.dg/func-ptr-2.m: New.
+ * objc.dg/volatile-1.m: New.
+
+2005-01-17 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3951689
+ * obj-c++.dg/try-catch-1.mm: New.
+ * obj-c++.dg/try-catch-2.mm: New.
+ * obj-c++.dg/try-catch-3.mm: New.
+ * obj-c++.dg/try-catch-4.mm: New.
+ * obj-c++.dg/try-catch-5.mm: New.
+ * obj-c++.dg/try-catch-6.mm: New.
+
+2005-01-14 Stuart Hastings <stuart@apple.com>
+
+ Radar 3943021
+ * gcc.apple/fenv-minmax-1.c: New.
+
+2005-01-11 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3918079
+ * obj-c++.dg/method-2.mm: New.
+ * objc.dg/method-15.m: New.
+
+2005-01-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3943452
+ * g++.dg/ext/apple-altivec-4.C: New.
+ * gcc.apple/apple-altivec-14.c: New.
+
+2005-01-08 Dale Johannesen <dalej@apple.com>
+
+ Radar 3941146
+ * gcc.dg/pr17133.c: New test.
+
+2005-01-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3913725
+ * g++.dg/ext/lvalue-cast-1.cpp: New.
+ * gcc.dg/lvalue-cast-1.c.
+
+2005-01-07 Devang Patel <dpatel@apple.com>
+
+ Radar 3943502
+ * obj-c++.dg/defs.mm: New test.
+
+2005-01-07 Stuart Hastings <stuart@apple.com>
+
+ * gcc.apple/notailcall-1.c: Now tests PPC in addition to x86.
+
+2005-01-06 Andrew Pinski <pinskia@physics.uc.edu>
+ Stuart Hastings <stuart@apple.com>
+
+ Radar 3830232
+ * gcc/testsuite/gcc.apple/notailcall-1.c: New testcase (also recorded in gcc/ChangeLog.apple-ppc).
+
+2005-01-06 Robert Bowdidge <bowdidge@apple.com>
+
+ * g++.dg/kext7.C: New.
+
+2005-01-06 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3925982
+ * obj-c++.dg/encode-1.mm: New.
+ * objc.dg/encode-6.m: New.
+
+2005-01-06 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3926755
+ * g++.dg/ext/apple-altivec-1.C: New.
+ * g++.dg/ext/apple-altivec-2.C: New.
+ * gcc.apple/apple-altivec-12.c: New.
+ * gcc.apple/apple-altivec-13.c: New.
+
+2005-01-06 Devang Patel <dpatel@apple.com>
+
+ Radar 3941766
+ * obj-c++.dg/empty-private-1.mm: New test.
+
+2005-01-05 Mark Mitchell <mark@codesourcery.com>
+ Matt Austern <austern@apple.com>
+
+ Radar 3934803
+ PR c++/18369
+ * g++.dg/init/new12.C: New test.
+
+2005-01-03 Alexander Malmberg <alexander@malmberg.org>
+ Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3926282 (PR objc/18971)
+ * objc.dg/encode-5.m: New test.
+
+2004-12-22 Devang Patel <dpatel@apple.com>
+
+ * gcc.apple/Wextra-tokens-2.c: Remove.
+
+2004-12-22 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/vect/vect-ifcvt-9.c: New.
+
+2004-12-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3866407
+ * g++.dg/ext/apple-altivec-3.C: New.
+
+2004-12-20 Dale Johannesen <dalej@apple.com>
+
+ Radar 3926484
+ * objc.dg/no-extra-load.m: New.
+ * obj-c++.dg/no-extra-load.mm: New.
+
+2004-12-20 Matt Austern <austern@apple.com>
+
+ Radar 3845716
+ PR c++/19044
+ * g++.dg/ext/builtin6.C: New
+
+2004-12-16 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3921172 (from mainline)
+ * objc.dg/stabs-1.m: New.
+
+2004-12-15 Dale Johannesen <dalej@apple.com>
+
+ Radar 3619824
+ * gcc.apple/no-math-errno.c: New.
+
+2004-12-15 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3918376
+ * gcc.apple/apple-altivec-4.c: New.
+
+2004-12-15 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3913672
+ * gcc.apple/apple-altivec-3.c: New.
+
+2004-12-13 Mike Stump <mrs@apple.com>
+
+ Radar 3865314
+ * gcc.apple/shorten.c: New.
+
+2004-12-10 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/vect/vect-ifcvt-2.c: Update.
+ * gcc.dg/vect/vect-ifcvt-3.c: Update.
+ * gcc.dg/vect/vect-ifcvt-4.c: Update.
+ * gcc.dg/vect/vect-ifcvt-5.c: Update.
+ * gcc.dg/vect/vect-ifcvt-6.c: Update.
+ * gcc.dg/vect/vect-ifcvt-7.c: Update.
+ * gcc.dg/vect/vect-ifcvt-8.c: New.
+
+2004-12-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3640156, 3877958
+ * gcc.apple/apple-altivec-1.c, gcc.apple/apple-altivec-2.c: New.
+
+2004-12-10 Devang Patel <dpatel@apple.com>
+
+ Radar 3909961
+ * gcc.apple/Wextra-tokens-2.c: New test.
+
+2004-12-07 Dale Johannesen <dalej@apple.com>
+
+ Radar 3907006
+ * gcc.dg/tree-ssa/20040308-4.c: Remove.
+
+2004-11-24 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/cpp/isysroot-1.c: cosmetic changes to match mainline.
+ * gcc.dg/cpp/usr/include/stdio.h: Same.
+ * gcc.dg/cpp/isysroot-2.c: Same.
+ * gcc.dg/cpp/System/Library/Framwork/Carbon.framework/Headers/Carbon.h: Same.
+
+2004-11-23 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/cpp/isysroot-1.c: New test.
+ * gcc.dg/cpp/usr/include/stdio.h: New file.
+ * gcc.dg/cpp/isysroot-2.c: New test.
+ * gcc.dg/cpp/System/Library/Framework/Carbon.framework/Headers/Carbon.h:
+ New file.
+
+2004-11-23 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3883557
+ * obj-c++.dg/cxx-class-1.mm: New test.
+
+2004-11-17 Devang Patel <dpatel@apple.com>
+
+ * gcc.apple/altivec-use.c: Remove.
+
+2004-11-17 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/vect/vect-none.c: Now 2 loops are vectorized.
+
+2004-11-16 Devang Patel <dpatel@apple.com>
+
+ From autovect-branch.
+
+ * gcc.dg/vect/vect-ifcvt-1.c: New test.
+ * gcc.dg/vect/vect-ifcvt-2.c: New test.
+ * gcc.dg/vect/vect-ifcvt-3.c: New test.
+ * gcc.dg/vect/vect-ifcvt-4.c: New test.
+ * gcc.dg/vect/vect-ifcvt-5.c: New test.
+ * gcc.dg/vect/vect-ifcvt-6.c: New test.
+ * gcc.dg/vect/vect-ifcvt-7.c: New test.
+
+2004-11-14 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3877761
+ * obj-c++.dg/ivar-list-semi.mm: New test.
+
+2004-11-10 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3761423
+ * obj-c++.dg/cxx-ivars-2.mm, obj-c++.dg/template-3.mm:
+ Make ivars @public to squash new warnings/errors.
+ * obj-c++.dg/private-1.mm, obj-c++.dg/private-2.mm:
+ New tests.
+
+2004-11-10 Devang Patel <dpatel@apple.com>
+
+ Partial Radar 3846472 fix
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-01.c: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-02.c: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-03.c: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-04.c: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-05.c: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-06.c: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-10.c: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-15.c: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-27.c: Adjust.
+
+2004-11-10 Devang Patel <dpatel@apple.com>
+
+ Radar 384609
+ More FSF merge cleanup.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-13.c: Remove test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-34.c: Remove test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-36.c: Remove test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-44.c: Remove test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-48.c: Remove test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-60.c: Remove test.
+
+2004-11-08 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3853429
+ * objc.dg/const-str-8.m, objc.dg/const-str-9.m,
+ objc.dg/const-cfstring-3.m, objc.dg/const-cfstring-4.m:
+ New tests.
+
+2004-11-08 Devang Patel <dpatel@apple.com>
+
+ Radar 3869007
+ * gcc.dg/tree-ssa/ivcanon-1.c: Do not use -fscalar-evolutions.
+
+2004-11-05 Devang Patel <dpatel@apple.com>
+
+ Radar 3853509.
+ * obj-c++.dg/lookup-1.mm: New test.
+ * obj-c++.dg/pragma-1.mm: New test.
+
+2004-11-04 Devang Patel <dpatel@apple.com>
+
+ Radar 3837835
+ * gcc.apple/altivec-use.c: New test.
+
+2004-11-01 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 2810013 (includes fix from mainline)
+ * obj-c++.dg/local-decl-1.mm: New test.
+ * objc.dg/local-decl-2.m: New test.
+
+2004-10-29 Stuart Hastings <stuart@apple.com>
+
+ * gcc.apple/special/liblongcall.c: Add #include <stdio.h>.
+ * gcc.apple/special/longcall-prog.c: Add #include <stdlib.h>.
+
+2004-10-29 Devang Patel <dpatel@apple.com>
+
+ FSF merge cleanup.
+ * gcc.dg/tree-ssa-vect/ifc-03.c: Remove test.
+ * gcc.dg/tree-ssa-vect/ifc-03.c: Remove.test.
+ * gcc.dg/tree-ssa-vect/tree-vect.h (exit): Add extern decl.
+ (abort): Same.
+ * gcc.dg/tree-ssa-vect/ifc-01.c: XFAIL.
+ * gcc.dg/tree-ssa-vect/ifc-02.c: XFAIL.
+
+2004-10-29 Devang Patel <dpatel@apple.com>
+
+ FSF merge cleanup. These tests now live in gcc.dg/vect directory.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-1.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-10.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-11.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-12.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-14.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-15.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-16.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-17.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-18.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-19.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-2.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-20.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-22.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-23.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-24.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-25.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-26.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-27.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-28.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-29.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-3.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-30.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-32.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-33.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-4.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-40.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-41.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-42.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-43.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-45.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-46.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-47.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-49.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-5.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-50.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-51.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-52.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-53.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-54.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-55.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-56.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-57.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-58.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-59.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-6.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-61.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-7.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-8.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-9.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-all.c: Remove.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-none.c: Remove.
+
+2004-10-27 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3854155
+ * obj-c++.dg/cxx-ivars-3.mm: New test.
+
+2004-10-26 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3840704
+ * gcc.apple/altivec-5.c: New.
+
+2004-10-26 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3833116 (fix from mainline)
+ * objc.dg/super-class-3.m: New test.
+
+2004-10-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ Radar 3845826 (PR objc/17923)
+ * objc.dg/const-str-7.m: New test.
+
+2004-10-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3540965
+ * obj-c++.dg/cxx-ivars-1.mm: New.
+ * obj-c++.dg/cxx-ivars-2.mm: New.
+
+2004-10-18 Robert Bowdidge <bowdidge@apple.com>
+
+ Radar 3843618
+ * Add g++.dg/lookup/koenig4.C: Bring the fix for PR/17829 over
+ from mainline so that Finder_FE will build again.
+
+2004-10-18 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3832999 (fix from mainline)
+ * objc.dg/method-14.m: New test.
+
+2004-10-18 Devang Patel <dpatel@apple.com>
+
+ Radar 3753408
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-21.c: Remove test.
+
+2004-10-13 Geoffrey Keating <geoffk@apple.com>
+
+ Radar 3476357
+ * gcc.apple/inttypes-4.c: New test.
+
+2004-10-11 Devang Patel <dpatel@apple.com>
+
+ * gcc.apple/ppc_intrinsics-1.c: New test.
+
+2004-09-14 Andrew Pinski <apinski@apple.com>
+
+ Rest of Radar 3753405
+ * g++.dg/asm-block-[12].C: Mark abort as extern "C".
+ * g++.dg/asm-function-[1-5].C: Likewise.
+ * g++.dg/asm-function-5.C (foo): Fix inline asm so that we load the right
+ saved link register.
+
+2004-09-13 Andrew Pinski <apinski@apple.com>
+
+ Part of radar 3753405 and all of 3767339
+ * gcc.apple/asm-block-[1-2].c: Add prototype for abort.
+ * gcc.apple/asm-function-[1-6].c: Likewise.
+
+2004-08-19 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.apple/inttypes-3.c: New file.
+
+2004-08-22 Andrew Pinski <apinski@apple.com>
+
+ * g++.dg/opt/pr14029.C: New test.
+ * gcc.c-torture/execute/pr15262.c: New test.
+
+2004-08-19 Ziemowit Laski <zlaski@apple.com>
+
+ * objc.dg/const-cfstring-1.m: Include stdlib.h.
+
+2004-08-16 Devang Patel <dpatel@apple.com>
+
+ Merge from mainlne.
+ 2004-08-16 Devang Patel <dpatel@apple.com>
+ * gcc.dg/darwin-20040809-1.c: New test.
+
+2004-08-13 Matt Austern <austern@apple.com>
+
+ Radar 2872232
+ * gcc.dg/testsuite/c99-tgmath-1.c: New test.
+ * gcc.dg/testsuite/c99-tgmath-2.c: New test.
+ * gcc.dg/testsuite/c99-tgmath-3.c: New test.
+ * gcc.dg/testsuite/c99-tgmath-4.c: New test.
+
+2004-08-13 Devang Patel <dpatel@apple.com>
+
+ Radar 3729261. Reviewed by Dale.
+ * gcc.dg/20040813-1.c: New test.
+
+2004-08-13 Devang Patel <dpatel@apple.com>
+
+ Merge from mainline. Radar 3739309.
+ 2004-08-11 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/darwin-20040809-2.c: New test.
+
+2004-08-13 Devang Patel <dpatel@apple.com>
+
+ Merge from mainline. Radar 3739302.
+ 2004-08-10 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/darwin-ld--20040809-1.c: New test.
+ * gcc.dg/darwin-ld-20040809-2.c: New test.
+
+2004-08-12 Jon Ziegler <jonz@apple.com>
+
+ Get rid of another APPLE LOCAL (to match Geoff's
+ change to gcc/ginclude/varargs.h).
+ * gcc.dg/va-arg-2.c
+
+2004-08-10 Devang Patel <dpatel@apple.com>
+
+ Remove Symbol Separation.
+ Radar 3555440. Reviewed by Mike Stump.
+ * gcc.dg/ss/README: Remove.
+ * gcc.dg/ss/ss.exp: Remove.
+ * gcc.dg/ss/one.c: Remove.
+ * gcc.dg/ss/one.ssh: Remove.
+ * gcc.dg/ss/ss-cmd1.c: Remove.
+
+2004-08-03 Stan Shebs <shebs@apple.com>
+
+ Support for CodeWarrior-style assembly language blocks and
+ functions. Radar 3368707.
+ * testsuite/gcc.apple/asm-block-[12].c: New tests.
+ * testsuite/gcc.apple/asm-function-[1-6].c: New tests.
+ * testsuite/g++.dg/asm-block-[12].C: New tests.
+ * testsuite/g+.dg/asm-function-[1-6].C: New tests.
+
+2004-07-30 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.dg/darwin-longdouble.c: New file.
+
+2004-07-30 Devang Patel <dpatel@apple.com>
+
+ Re-implement -fwritable-strings support.
+ Radar : 3699482
+
+ * gcc.apple/fwritable-strings.c: New test.
+
+2004-07-14 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/tree-ssa-vect/ifc-04.c: New test.
+
+2004-07-13 Matt Austern <austern@apple.com>
+
+ Radar 3278745, 3419910, 3432773
+ * gcc.apple/inttypes-2.c: New test.
+ * gcc.apple/inttypes-wchar-1.c: New test.
+ * gcc.apple/inttypes-wchar-2.c: New test.
+
+2006-06-29 Andrew Pinski <apinski@apple.com>
+
+ Radar #: 3717673
+ * gcc.dg/pch/struct-1.c: Fix typo of adding a "+".
+
+2006-06-29 Andrew Pinski <apinski@apple.com>
+
+ * testsuite/gcc.apple/loop-transpose-1.c: New test.
+
+2004-06-29 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-4*.c: Abort instead of print.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-5*.c: Likewise.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-61.c: Likewise.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-62.c: Likewise.
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-40.c: Move call to bar.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-42.c: Likewise.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-60.c: Likewise.
+
+2006-06-28 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/tree-ssa-vect/ifc-02.c: New test.
+ * gcc.dg/tree-ssa-vect/ifc-03.c: New test.
+
+2006-06-22 Andrew Pinski <apinski@apple.com>
+
+ * gcc.dg/pch/struct-1.c: New.
+ * gcc.dg/pch/struct-1.hs: New.
+
+2004-06-22 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/tree-ssa-vect/pr16105.c: New test.
+
+2004-06-15 Dorit Naishlos <DORIT@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-30.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-40.c: New test
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-41.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-42.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-43.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-44.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-45.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-46.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-47.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-48.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-49.c: New test
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-50.c: New test
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-51.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-52.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-53.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-54.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-55.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-56.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-57.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-58.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-59.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-60.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-61.c: New test.
+
+
+2004-06-12 Dorit Naishlos <DORIT@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-27.c: Do not xfail.
+2004-06-09 Jon Ziegler <jonz@apple.com>
+
+ Radar 3667992
+ * gcc.apple/Wlong-double.c: Delete file.
+
+2004-06-08 Jon Ziegler <jonz@apple.com>
+
+ Radar 3667992
+ * g++.dg/altivec-4.C: Remove '-Wno-long-double' flag.
+ * g++.dg/abi/layout2.C: Likewise.
+ * gcc.apple/altivec-1.c: Likewise.
+ * gcc.apple/dg.exp: Likewise.
+ * gcc.dg/20020416-1.c: Likewise.
+ * gcc.dg/builtin-inf-1.c: Likewise.
+ * gcc.dg/c99-complex-1.c: Likewise.
+ * gcc.dg/dg.exp: Likewise.
+ * gcc.dg/typespec-1.c: Likewise.
+ * gcc.dg/wtr-conversion-1.c: Likewise.
+ * gcc.dg/cpp/sysmac2.c: Likewise.
+ * gcc.dg/debug/20020220-1.c: Likewise.
+ * gcc.dg/format/c90-printf-1.c: Likewise.
+ * gcc.dg/format/c90-scanf-1.c: Likewise.
+ * gcc.dg/format/strfmon-1.c: Likewise.
+ * gcc.dg/pch/apple-altivec-1.c: Likewise.
+ * gcc.dg/pch/apple-altivec-1.hs: Likewise.
+ * lib/g++.exp: Likewise.
+
+2004-05-28 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3665286
+ * gcc.apple/altivec-2.c: New test case.
+ * gcc.apple/altivec-3.c: New test case.
+
+2004-05-21 Ziemowit Laski <zlaski@apple.com>
+
+ Radar 3621323
+ * g++.dg/ext/altivec-11.C: New test case.
+ * gcc.dg/altivec-15.c: New test case.
+
+2004-05-10 Ziemowit Laski <zlaski@apple.com>
+
+ * g++.dg/ext/altivec-8.C: Brought over from mainline.
+ * gcc.apple/altivec-2.c: Remove, superceded by...
+ * gcc.dg/altivec-13.c: ...this, brought over from mainline.
+
+2004-04-29 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/tree-ssa/copy-headers.c : Merge from lno-branch as of
+ 2004:04:19 00:00.
diff --git a/gcc/testsuite/ChangeLog.lno b/gcc/testsuite/ChangeLog.lno
new file mode 100644
index 00000000000..35bfc1ccb01
--- /dev/null
+++ b/gcc/testsuite/ChangeLog.lno
@@ -0,0 +1,203 @@
+2004-07-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-31.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-32.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-33.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-34.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-35.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-36.c: New test.
+
+2004-07-04 Andi Kleen <ak@muc.de>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-*.c: Add support for i?86-*-*
+ and x86_64-*-*.
+ * gcc.dg/tree-ssa-vect/tree-vect.h: New file.
+
+2004-07-04 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-4*.c: Abort instead of print, and
+ remove redundant check loop in main.
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-40.c: Move call to bar from main1
+ to main.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-42.c: Likewise.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-46.c: Likewise.
+
+2004-06-22 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-54.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-55.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-56.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-57.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-58.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-59.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-60.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-61.c: New test.
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-50.c: Abort instead of print, and
+ remove redundant check loop in main.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-51.c: Likewise.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-52.c: Likewise.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-53.c: Likewise.
+
+2004-06-22 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/tree-ssa-vect/pr16105.c: New test.
+
+2004-06-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-46.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-47.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-48.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-49.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-50.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-51.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-52.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-53.c: New test.
+
+2004-06-14 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-40.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-41.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-42.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-43.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-44.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-45.c: New test.
+
+2004-06-09 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-30.c: New test.
+
+2004-05-20 Olga Golovanevsky <olga@il.ibm.com>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-8.c: Tests with
+ unknown loop bounds should now be vectorized.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-none.c: Likewise.
+
+2004-05-06 Sebastian Pop <pop@cri.ensmp.fr>
+
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-{10, 30-36, 52, 59, 60}.c.ddall: Adjust.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-36.c: Remove comment.
+
+2004-04-15 Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-26.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-27.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-28.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-29.c: New test.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-*.c: Use -msse2 instead of -msse.
+ * gcc.dg/tree-ssa-vect/tree-ssa-vect-*.c: Temporarily change i*86 'run'
+ tests to 'compile' tests.
+
+2004-03-25 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * ssa-chrec-10.c.ddall: Classify more access tuples as
+ independent.
+ * ssa-chrec-36.c.ddall: Same.
+
+2004-03-11 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * gcc.dg/tree-ssa/20040308-2.c: UnXFAIL.
+
+2004-03-11 Andrew Pinski <apinski@apple.com>
+
+ * gcc.dg/tree-ssa/20040308-2.c: Fix dg-final.
+ * gcc.dg/tree-ssa/20040308-1.c: XFAIL as the
+ optimizer for this testcase is disabled.
+
+2004-03-08 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * gcc.dg/tree-ssa/20040308-1.c: New test.
+ * gcc.dg/tree-ssa/20040308-2.c: New test.
+ * gcc.dg/tree-ssa/20040308-3.c: New test.
+ * gcc.dg/tree-ssa/20040308-4.c: New test.
+
+2004-03-03 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * ssa-chrec-*.c.scev: Removed.
+ * ssa-chrec-[54..60].c: New.
+ * ssa-chrec-{59, 60}.c.ddall: New.
+ * ssa-chrec-*.c.ddall: The analyzer don't print the array
+ discovery information, and this information has to go away
+ from the ddall files. This was one of the most varying part
+ of the ddall files. Maybe the base_name of the arrays has to
+ be removed in the same way.
+ * ssa-chrec-*.c: Don't scan the output for scev. Some cases
+ are adapted for using the elimination of checks.
+
+2004-02-20 Devang Patel <dpatel@apple.com>
+
+ * testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-3.c: New test.
+
+2004-02-16 Devang Patel <dpatel@apple.com>
+
+ * gcc.dg/tree-ssa-chrec/20040216-1.c: New test.
+
+2004-01-29 Sebastian Pop <sebastian.pop@ensmp.fr>
+
+ * ssa-chrec-{01, 10, 30, 31, 32, 33, 34, 35, 36, 52, 53}.c: Update
+ comments.
+ * ssa-chrec-{13, 14}.c: Use call functions for avoid optimisations
+ touching the condition.
+ * ssa-chrec-{01, 06, 09, 10, 13, 14, 17, 24, 25, 26, 27, 28, 30, 33,
+ 36, 38, 39, 41, 43, 46, 47, 51, 52, 53}.c.scev: Adjusted.
+
+ * ssa-chrec-10.c.ddall ssa-chrec-30.c.ddall
+ ssa-chrec-31.c.ddall ssa-chrec-32.c.ddall ssa-chrec-33.c.ddall
+ ssa-chrec-34.c.ddall ssa-chrec-35.c.ddall ssa-chrec-36.c.ddall
+ ssa-chrec-52.c.ddall: New files.
+ * ssa-chrec-10.c.alldd ssa-chrec-30.c.alldd
+ ssa-chrec-31.c.alldd ssa-chrec-32.c.alldd ssa-chrec-33.c.alldd
+ ssa-chrec-34.c.alldd ssa-chrec-35.c.alldd ssa-chrec-36.c.alldd
+ ssa-chrec-52.c.alldd ssa-chrec-53.c.alldd: Removed.
+
+2004-01-21 Sebastian Pop <s.pop@laposte.net>
+
+ * ssa-chrec-*: Replace -fdump-scalar-evolutions with
+ -fdump-tree-scev. Replace -fdump-all-data-deps with
+ -fdump-tree-alldd.
+ * tree-ssa-vect-*: Use -fdump-tree-vect instead of
+ -fdump-tree-vect-stats.
+
+2004-01-15 Sebastian Pop <s.pop@laposte.net>
+
+ * ssa-chrec-{06, 38, 42, 43}.c: Modify comments.
+ * ssa-chrec-{06, 07, 08, 09, 11, 12, 13, 14, 16, 18, 20,
+ 21, 37, 38, 39, 42, 43, 44, 45, 53}.c.scev: Adjusted.
+ * ssa-chrec-53.c.alldd: Adjusted.
+
+2004-01-12 Sebastian Pop <s.pop@laposte.net>
+
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-51.c.scev: Adjusted.
+
+2004-01-12 Sebastian Pop <s.pop@laposte.net>
+ Dorit Naishlos <dorit@il.ibm.com>
+
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-53.c: New test.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-53.c.scev: New.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-53.c.alldd: New.
+
+2004-01-09 Sebastian Pop <s.pop@laposte.net>
+
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-{01, 04, 06, 07, 09, 10, 17,
+ 18, 27, 28, 32, 33, 34, 35, 39, 41, 45, 47, 48}.c: Update comments.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-{01, 02, 03, 04, 05, 06, 09,
+ 10, 11, 17, 18, 27, 28, 30, 32, 33, 34, 35, 36, 37, 38, 39, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50}.c.scev: Adjusted.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-{10, 30, 31, 32, 33, 34, 35,
+ 36}.c.alldd: Adjusted.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-{51, 52}.c: New files.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-{51, 52}.c.scev: New.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-52.alldd: New.
+ * ChangeLog.lno: New file.
+
+2003-12-27 Sebastian Pop <s.pop@laposte.net>
+
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-[01..50].c : New testcases.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-[01..50].c.scev: Expected
+ outputs for the scalar evolution analyzer.
+ * gcc.dg/tree-ssa-chrec/ssa-chrec-{10, 30, 31, 32, 33, 34,
+ 35, 36}.c.alldd: Expected outputs for the data dependence analyzer.
+ * gcc.dg/tree-ssa-chrec/tree-ssa-scev.exp: New file.
+ * lib/scantree.exp (diff-tree-dumps): New procedure.
diff --git a/gcc/testsuite/UNTESTABLE b/gcc/testsuite/UNTESTABLE
new file mode 100644
index 00000000000..97683ff5b17
--- /dev/null
+++ b/gcc/testsuite/UNTESTABLE
@@ -0,0 +1,57 @@
+APPLE LOCAL file testsuite
+
+This file lists the markers for local changes that are by their nature
+not testable, such as source code tweaks that don't directly affect
+compiler behavior. Every other local change must have at least one
+test case.
+
+Note that if a local change fixes a bug that is exposed by an existing
+test, then by definition the local change should go into FSF GCC
+instead of being listed here.
+
+MW compatibility
+Mach time
+OS pragma hook
+RTX_COST for multiply
+Stripped encodings ('!T_' and '!t_') should match.
+branch cost
+code size reduction / performance enhancement
+combine hoisted consts
+compare >= 0, not > 0.
+darwin host
+darwin mmap bug workaround
+darwin_set_section_for_var_p
+debugging
+default to ppro
+do not extern fp save/restore
+don't define SAVE_FP_PREFIX and friends
+fat builds readability
+finish file hook
+fix prototypes
+fix redundant add?
+flag_objc
+include guard for darwin.h
+interrupt signal handler (radar 2941633)
+keep tables in sync comment
+make easy_vector_constant globally visible (rs6000-protos.h)
+manual
+more orphaned code
+move is_class_name to stub-objc.c
+move lookup_interface to stub-objc.c
+move lookup_objc_ivar to stub-objc.c
+multiply cost pulled into function
+objc finish file
+order files
+parsedir
+prototypes
+prune man page
+reduce code size
+remove a stub tweak
+remove machopic_output_possible_stub_label
+rename for HFS
+separate outputdir
+setrlimit
+time formatting
+try to improve ggc
+work around a makeinfo complaint
+cp_binding_level
diff --git a/gcc/testsuite/bugs/powerpc/g++.xfail b/gcc/testsuite/bugs/powerpc/g++.xfail
new file mode 100644
index 00000000000..16c3eac95d3
--- /dev/null
+++ b/gcc/testsuite/bugs/powerpc/g++.xfail
@@ -0,0 +1,285 @@
+# APPLE LOCAL file testsuite
+###
+### List of failing tests with Radar bug numbers
+### <radarNum>: <test name>
+### test name should be exactly as it appears html summary reports
+### including any trailing #<number>
+###
+### When the bug is fixed and the test passes, it will be an
+### analyzed non-fail. You should then comment out the test in this
+### file and make sure the Radar is closed.
+###
+###------------------------------------------------------------------
+3220997: g++.dg/align-test-1.C execution test
+#3665086: g++.dg/apple-altivec-1.C (test for excess errors)
+#3665086: g++.dg/altivec-3.C (test for excess errors)
+#3665127: g++.dg/altivec-5.C (test for excess errors)
+#3665098: g++.dg/eh/simd-2.C (test for excess errors)
+#3665086: g++.dg/ext/altivec-2.C (test for excess errors)
+#3665086: g++.dg/ext/altivec-4.C (test for excess errors)
+#3665086: g++.dg/ext/altivec-5.C (test for excess errors)
+#3665086: g++.dg/ext/altivec-6.C (test for excess errors)
+#3665086: g++.dg/ext/altivec-8.C (test for excess errors)
+#3665096: g++.dg/template/instantiate6.C (test for excess errors)
+#3665130: g++.dg/template/static3.C (test for excess errors)
+3222046: g++.dg/warn/weak1.C (test for excess errors)
+3665098: 258: expected branch percentages not found: 25
+3665098: g++.dg/gcov/gcov-1.C gcov: 0 failures in line counts, 1 in branch percentages, 0 in return percentages
+3665098: 23:is 2:should be 1
+3665098: g++.dg/gcov/gcov-2.C gcov: 1 failures in line counts, 0 in branch percentages, 0 in return percentages
+3223598: g++.dg/special/conpr-3.C execution test
+#3665098: g++.old-deja/g++.abi/cxa_vec.C execution test
+#3665098: g++.old-deja/g++.brendan/crash13.C (test for errors, line 34)
+#3665098: g++.old-deja/g++.brendan/new3.C execution test
+3222135: g++.old-deja/g++.bugs/900404_02.C (test for warnings, line 25)
+3222698: g++.old-deja/g++.ext/pretty4.C execution test
+#3665098: g++.old-deja/g++.law/friend5.C (test for errors, line 19)
+#3665098: g++.old-deja/g++.law/friend5.C (test for errors, line 24)
+#3665144: g++.old-deja/g++.mike/p4750.C (test for excess errors)
+#3665148: g++.old-deja/g++.other/inline7.C (test for excess errors)
+#3665098: g++.old-deja/g++.other/inline8.C (test for excess errors)
+#3665144: g++.old-deja/g++.other/local-alloc1.C (test for excess errors)
+3224899: g++.old-deja/g++.other/string2.C execution test
+#3665162: g++.old-deja/g++.pt/static3.C (test for excess errors)
+#3665162: g++.old-deja/g++.pt/static6.C (test for excess errors)
+#3665148: g++.old-deja/g++.pt/ttp19.C (test for excess errors)
+#3665148: g++.old-deja/g++.pt/ttp40.C (test for excess errors)
+#3665148: g++.old-deja/g++.robertl/eb21.C (test for excess errors)
+#3665148: g++.old-deja/g++.robertl/eb59.C (test for excess errors)
+#3665098: g++.old-deja/g++.robertl/eb73.C (test for excess errors)
+#3681923: g++.old-deja/g++.other/warn7.C (test for warnings, line 38)
+#3689471: g++.old-deja/g++.mike/p646.C (test for warnings, line 104)
+#3689471: g++.old-deja/g++.mike/p646.C (test for warnings, line 112)
+#3689471: g++.old-deja/g++.mike/p646.C (test for warnings, line 120)
+#3689471: g++.old-deja/g++.mike/p646.C (test for warnings, line 127)
+#3689471: g++.old-deja/g++.mike/p646.C (test for warnings, line 133)
+#3689471: g++.old-deja/g++.bugs/900205_03.C (test for errors, line 21)
+#3689471: g++.old-deja/g++.bugs/900205_03.C (test for errors, line 24)
+#3689471: g++.old-deja/g++.bugs/900205_03.C (test for errors, line 44)
+#3689471: g++.old-deja/g++.bugs/900205_03.C (test for errors, line 47)
+#3753405: g++.dg/asm-block-1.C (test for excess errors)
+#3753405: g++.dg/asm-block-2.C (test for excess errors)
+#3753405: g++.dg/asm-function-1.C (test for excess errors)
+#3753405: g++.dg/asm-function-2.C (test for excess errors)
+#3753405: g++.dg/asm-function-3.C (test for excess errors)
+#3753405: g++.dg/asm-function-4.C (test for excess errors)
+#3753405: g++.dg/asm-function-5.C (test for excess errors)
+#3753405: g++.dg/asm-function-6.C (test for excess errors)
+#3753413: g++.dg/const-cfstring-1.C (test for excess errors)
+#3751847: g++.dg/abi/enum1.C (test for excess errors)
+#3751847: g++.dg/eh/elide2.C (test for excess errors)
+#3751847: g++.dg/init/array4.C (test for excess errors)
+#3751847: g++.dg/parse/lookup1.C (test for excess errors)
+#3751847: g++.dg/parse/parse5.C (test for excess errors)
+#3751847: g++.dg/template/friend10.C (test for excess errors)
+#3751847: g++.old-deja/g++.abi/arraynew.C (test for excess errors)
+#3751847: g++.old-deja/g++.benjamin/15071.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/copy9.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/crash15.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/crash20.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/crash30.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/crash38.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/crash49.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/crash62.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/cvt1.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/err-msg3.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/nest21.C (test for excess errors)
+#3751847: g++.old-deja/g++.brendan/ptolemy2.C (test for excess errors)
+#3751847: g++.old-deja/g++.eh/new1.C (test for excess errors)
+#3751847: g++.old-deja/g++.eh/new2.C (test for excess errors)
+#3751847: g++.old-deja/g++.eh/terminate1.C (test for excess errors)
+#3751847: g++.old-deja/g++.eh/terminate2.C (test for excess errors)
+#3751847: g++.old-deja/g++.jason/template24.C (test for excess errors)
+#3751847: g++.old-deja/g++.jason/template31.C (test for excess errors)
+#3751847: g++.old-deja/g++.jason/typeid1.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/arg1.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/arg8.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/arm12.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/arm9.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/bad-error7.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/code-gen5.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/ctors10.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/ctors12.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/ctors13.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/ctors17.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/ctors6.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/cvt16.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/cvt2.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/missed-error2.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/nest3.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/operators32.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/operators4.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/vbase1.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/virtual3.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/visibility1.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/visibility10.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/visibility13.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/visibility17.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/visibility2.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/visibility22.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/visibility25.C (test for excess errors)
+#3751847: g++.old-deja/g++.law/visibility7.C (test for excess errors)
+#3751847: g++.old-deja/g++.martin/bitset1.C (test for excess errors)
+#3751847: g++.old-deja/g++.martin/new1.C (test for excess errors)
+#3751847: g++.old-deja/g++.mike/net46.C (test for excess errors)
+#3751847: g++.old-deja/g++.mike/p658.C (test for excess errors)
+#3751847: g++.old-deja/g++.mike/rtti1.C (test for excess errors)
+#3751847: g++.old-deja/g++.ns/koenig9.C (test for excess errors)
+#3751847: g++.old-deja/g++.ns/using4.C (test for excess errors)
+#3751847: g++.old-deja/g++.ns/using6.C (test for excess errors)
+#3751847: g++.old-deja/g++.oliva/thunk1.C (test for excess errors)
+#3751847: g++.old-deja/g++.other/defarg6.C (test for excess errors)
+#3751847: g++.old-deja/g++.other/headers1.C (test for excess errors)
+#3751847: g++.old-deja/g++.other/init9.C (test for excess errors)
+#3751847: g++.old-deja/g++.other/inline14.C (test for excess errors)
+#3751847: g++.old-deja/g++.pt/crash68.C (test for excess errors)
+#3751847: g++.old-deja/g++.pt/instantiate10.C (test for excess errors)
+#3751847: g++.old-deja/g++.pt/ttp19.C (test for excess errors)
+#3751847: g++.old-deja/g++.pt/ttp40.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb109.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb113.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb124.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb127.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb129.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb129a.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb15.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb21.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb24.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb28.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb29.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb3.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb30.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb31.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb33.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb36.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb39.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb4.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb41.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb43.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb44.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb46.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb54.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb55.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb59.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb60.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb62.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb65.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb66.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb7.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb77.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb79.C (test for excess errors)
+#3751847: g++.old-deja/g++.robertl/eb91.C (test for excess errors)
+#3796204: g++.dg/kext2.C (test for excess errors)
+#3796204: g++.dg/kext3.C (test for errors, line 17)
+#3796204: g++.dg/kext3.C (test for errors, line 18)
+#3796204: g++.dg/kext3.C (test for excess errors)
+3843119: g++.dg/abi/local1.C execution test
+#3843135: g++.dg/kext2.C (test for excess errors)
+#3843135: g++.dg/kext4.C (test for excess errors)
+3843157: g++.dg/pascal-strings-2.C (test for warnings, line 7)
+3843157: g++.dg/pascal-strings-2.C (test for warnings, line 8)
+3843157: g++.dg/pascal-strings-2.C (test for warnings, line 22)
+3843157: g++.dg/pascal-strings-2.C (test for warnings, line 24)
+3843157: g++.dg/pascal-strings-2.C (test for warnings, line 25)
+3843157: g++.dg/pascal-strings-2.C (test for excess errors)
+3845961: 102:is -:should be 1
+3845961: g++.dg/gcov/gcov-1.C gcov: 1 failures in line counts, 0 in branch percentages, 0 in return percentages
+3878577: g++.dg/expr/cast2.C (test for errors, line 4)
+#3878578: g++.old-deja/g++.other/comdat4.C (test for excess errors)
+#3878580: g++.dg/parse/parse3.C (test for excess errors)
+#
+# The following tests fail only when the c++ suite is run through Obj-C++.
+3904139: g++.dg/ext/fnname3.C execution test
+3904139: g++.old-deja/g++.ext/pretty2.C execution test
+3904139: g++.old-deja/g++.ext/pretty3.C execution test
+3904139: g++.old-deja/g++.pt/memtemp77.C execution test
+3904139: g++.dg/ext/pretty1.C scan-assembler int bar\\(T\\).*with T = int
+3904139: g++.dg/ext/pretty1.C scan-assembler int main\\(\\)
+3904173: g++.old-deja/g++.jason/cleanup2.C (test for excess errors)
+3904173: g++.old-deja/g++.jason/hmc1.C (test for excess errors)
+3904173: g++.old-deja/g++.law/ctors10.C (test for errors, line 21)
+3904173: g++.old-deja/g++.law/ctors10.C (test for excess errors)
+3904173: g++.old-deja/g++.law/shadow1.C (test for excess errors)
+3904178: g++.dg/opt/devirt1.C scan-assembler xyzzy
+3904184: g++.old-deja/g++.mike/p11144.C (test for excess errors)
+3904186: g++.dg/pch/system-1.C -g assembly comparison
+3904186: g++.dg/pch/system-1.C -O2 -g assembly comparison
+3904186: g++.dg/pch/system-1.C -O2 assembly comparison
+3904186: g++.dg/pch/system-2.C -g assembly comparison
+3904186: g++.dg/pch/system-2.C -O2 -g assembly comparison
+3904186: g++.dg/pch/system-2.C -O2 assembly comparison
+3904186: g++.dg/pch/uninst.C -g assembly comparison
+3904186: g++.dg/pch/uninst.C -O2 -g assembly comparison
+3904186: g++.dg/pch/uninst.C -O2 assembly comparison
+3973957: g++.dg/ext/visibility/fvisibility-inlines-hidden.C (test for excess errors)
+3973957: g++.dg/ext/visibility/fvisibility-inlines-hidden.C scan-hidden private_extern[ \t_]*_ZN3Foo6methodEv
+#
+3961370: g++.dg/ext/visibility/fvisibility-override1.C (test for excess errors)
+3961370: g++.dg/ext/visibility/fvisibility-override1.C scan-assembler \\.internal.*Foo.methodEv
+3961370: g++.dg/ext/visibility/fvisibility-override2.C (test for excess errors)
+3961370: g++.dg/ext/visibility/fvisibility-override2.C scan-assembler \\.internal.*Foo.methodEv
+3961370: g++.dg/ext/visibility/pragma-override1.C (test for excess errors)
+3961370: g++.dg/ext/visibility/pragma-override1.C scan-assembler \\.internal.*Foo.methodEv
+3961370: g++.dg/ext/visibility/pragma-override2.C (test for excess errors)
+3961370: g++.dg/ext/visibility/pragma-override2.C scan-assembler \\.internal.*Foo.methodEv
+#
+# The following tests fail only when the c++ suite is run with -m64
+3965017: g++.dg/template/repo1.C (test for excess errors)
+3965017: g++.dg/template/repo3.C (test for excess errors)
+3964999: g++.old-deja/g++.pt/const2.C (test for excess errors)
+3965017: g++.old-deja/g++.pt/instantiate4.C (test for excess errors)
+3965017: g++.old-deja/g++.pt/instantiate6.C (test for excess errors)
+3965017: g++.old-deja/g++.pt/repo1.C (test for excess errors)
+3965017: g++.old-deja/g++.pt/repo2.C (test for excess errors)
+3965017: g++.old-deja/g++.pt/repo3.C (test for excess errors)
+3965017: g++.old-deja/g++.pt/repo4.C (test for excess errors)
+3953569: g++.old-deja/g++.law/profile1.C execution test
+3941491: g++.dg/debug/const1.C -gdwarf-21 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-21 -O2 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-21 -O3 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-21 -fastcp (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-2 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-2 -O2 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-2 -O3 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-2 -fastcp (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-23 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-23 -O2 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-23 -O3 (test for excess errors)
+3941491: g++.dg/debug/const1.C -gdwarf-23 -fastcp (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-21 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-21 -O2 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-21 -O3 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-21 -fastcp (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-2 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-2 -O2 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-2 -O3 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-2 -fastcp (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-23 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-23 -O2 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-23 -O3 (test for excess errors)
+3941491: g++.dg/debug/debug4.C -gdwarf-23 -fastcp (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-21 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-21 -O2 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-21 -O3 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-21 -fastcp (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-2 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-2 -O2 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-2 -O3 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-2 -fastcp (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-23 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-23 -O2 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-23 -O3 (test for excess errors)
+3941491: g++.dg/debug/trivial.C -gdwarf-23 -fastcp (test for excess errors)
+3939381: g++.dg/asm-block-2.C execution test
+#3966342: g++.dg/asm-function-6.C execution test
+#3939078: g++.dg/bprob/g++-bprob-1.C compilation, -g -fprofile-arcs
+#3939078: g++.dg/bprob/g++-bprob-1.C compilation, -O3 -g -fprofile-arcs
+#3939078: g++.dg/bprob/g++-bprob-1.C execution, -fastcp -fprofile-arcs
+#3939078: g++.dg/bprob/g++-bprob-1.C compilation, -g -ftree-based-profiling -fprofile-arcs
+#3939078: g++.dg/bprob/g++-bprob-1.C compilation, -O3 -g -ftree-based-profiling -fprofile-arcs
+#3939078: g++.dg/bprob/g++-bprob-1.C execution, -fastcp -ftree-based-profiling -fprofile-arcs
+3967626: g++.dg/eh/forced1.C execution test
+3967626: g++.old-deja/g++.eh/terminate2.C execution test
+#3968560: g++.dg/ext/label3.C (test for excess errors)
+3968612: g++.old-deja/g++.brendan/new3.C execution test
+#
diff --git a/gcc/testsuite/bugs/powerpc/gcc.xfail b/gcc/testsuite/bugs/powerpc/gcc.xfail
new file mode 100644
index 00000000000..75f8fd01d3a
--- /dev/null
+++ b/gcc/testsuite/bugs/powerpc/gcc.xfail
@@ -0,0 +1,860 @@
+# APPLE LOCAL file testsuite
+###
+### List of failing tests with Radar bug numbers
+### <radarNum>: <test name>
+### test name should be exactly as it appears html summary reports
+### including any trailing #<number>
+###
+### When the bug is fixed and the test passes, it will be an
+### analyzed non-fail. You should then comment out the test in this
+### file and make sure the Radar is closed.
+###
+###------------------------------------------------------------------
+#3665098: gcc.c-torture/compile/20021108-1.c -O1 (test for excess errors)
+#3665098: gcc.c-torture/compile/20021108-1.c -O2 (test for excess errors)
+#3665098: gcc.c-torture/compile/20021108-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665098: gcc.c-torture/compile/20021108-1.c -O3 -g (test for excess errors)
+#3665098: gcc.c-torture/compile/20021108-1.c -Os (test for excess errors)
+#3665098: gcc.c-torture/compile/20021108-1.c -fast (test for excess errors)
+#3665180: gcc.c-torture/compile/20010605-1.c -O0 (test for excess errors)
+#3665180: gcc.c-torture/compile/20010605-1.c -O1 (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-2.c -O1 (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-2.c -O2 (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-2.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-2.c -O3 -g (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-2.c -Os (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-2.c -fast (test for excess errors)
+#3665227: gcc.dg/builtins-1.c (test for excess errors)
+#3665227: gcc.dg/builtins-2.c (test for excess errors)
+#3665227: gcc.dg/builtins-7.c (test for excess errors)
+#3665227: gcc.dg/builtins-9.c (test for excess errors)
+#3652019: gcc.dg/builtins-10.c (test for excess errors)
+#3665227: gcc.dg/builtins-16.c (test for excess errors)
+#3665227: gcc.dg/builtins-18.c (test for excess errors)
+#3665227: gcc.dg/builtins-19.c (test for excess errors)
+#3665227: gcc.dg/builtins-20.c (test for excess errors)
+#3665227: gcc.dg/builtins-21.c (test for excess errors)
+#3665227: gcc.dg/builtins-25.c (test for excess errors)
+#3665227: gcc.dg/builtins-26.c (test for excess errors)
+#3665227: gcc.dg/builtins-28.c (test for excess errors)
+#3665227: gcc.dg/builtins-29.c (test for excess errors)
+#3665227: gcc.dg/builtins-30.c (test for excess errors)
+#3665227: gcc.dg/builtins-31.c (test for excess errors)
+#3665227: gcc.dg/builtins-33.c (test for excess errors)
+#3665227: gcc.dg/builtins-34.c (test for excess errors)
+#3665233: gcc.dg/builtins-35.c (test for excess errors)
+#3665227: gcc.dg/builtins-36.c (test for excess errors)
+#3665227: gcc.dg/builtins-37.c (test for excess errors)
+#3665227: gcc.dg/torture/builtin-attr-1.c -O0 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-attr-1.c -O1 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-attr-1.c -O2 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-attr-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665227: gcc.dg/torture/builtin-attr-1.c -O3 -g (test for excess errors)
+#3665227: gcc.dg/torture/builtin-attr-1.c -Os (test for excess errors)
+#3665227: gcc.dg/torture/builtin-convert-1.c -O0 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-convert-1.c -O1 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-convert-1.c -O2 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-convert-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665227: gcc.dg/torture/builtin-convert-1.c -O3 -g (test for excess errors)
+#3665227: gcc.dg/torture/builtin-convert-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-1.c -O1 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-1.c -O2 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-1.c -O3 -g (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-1.c -fast (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-2.c -O1 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-2.c -O2 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-2.c -O3 -fomit-frame-pointer (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-2.c -O3 -g (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-2.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-ctype-2.c -fast (test for excess errors)
+#3665227: gcc.dg/torture/builtin-explog-1.c -O0 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-explog-1.c -O1 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-explog-1.c -O2 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-explog-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665227: gcc.dg/torture/builtin-explog-1.c -O3 -g (test for excess errors)
+#3665227: gcc.dg/torture/builtin-explog-1.c -Os (test for excess errors)
+#3665227: gcc.dg/torture/builtin-integral-1.c -O0 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-integral-1.c -O1 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-integral-1.c -O2 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-integral-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665227: gcc.dg/torture/builtin-integral-1.c -O3 -g (test for excess errors)
+#3665227: gcc.dg/torture/builtin-integral-1.c -Os (test for excess errors)
+#3665227: gcc.dg/torture/builtin-math-1.c -O0 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-math-1.c -O1 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-math-1.c -O2 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-math-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665227: gcc.dg/torture/builtin-math-1.c -O3 -g (test for excess errors)
+#3665227: gcc.dg/torture/builtin-math-1.c -Os (test for excess errors)
+#3665227: gcc.dg/torture/builtin-nonneg-1.c -O0 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-nonneg-1.c -O1 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-nonneg-1.c -O2 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-nonneg-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665227: gcc.dg/torture/builtin-nonneg-1.c -O3 -g (test for excess errors)
+#3665227: gcc.dg/torture/builtin-nonneg-1.c -Os (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-1.c -O0 (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-1.c -O1 (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-1.c -O2 (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-1.c -O3 -g (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-1.c -Os (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-1.c -fast (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-2.c -O0 (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-2.c -O1 (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-2.c -O2 (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-2.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-2.c -O3 -g (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-2.c -Os (test for excess errors)
+#3665098: gcc.dg/torture/builtin-noret-2.c -fast (test for excess errors)
+#3665227: gcc.dg/torture/builtin-power-1.c -O0 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-power-1.c -O1 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-power-1.c -O2 (test for excess errors)
+#3665227: gcc.dg/torture/builtin-power-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665227: gcc.dg/torture/builtin-power-1.c -O3 -g (test for excess errors)
+#3665227: gcc.dg/torture/builtin-power-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-wctype-1.c -O1 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-wctype-1.c -O2 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-wctype-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3652019: gcc.dg/torture/builtin-wctype-1.c -O3 -g (test for excess errors)
+#3652019: gcc.dg/torture/builtin-wctype-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-wctype-1.c -fast (test for excess errors)
+#3665238: gcc.c-torture/execute/builtins/abs-1.c execution, -O3 -fomit-frame-pointer
+#3665238: gcc.c-torture/execute/builtins/abs-1.c execution, -O3 -g
+#3665238: gcc.c-torture/execute/builtins/abs-1.c execution, -fast
+#3665238: gcc.c-torture/execute/builtins/string-1.c execution, -O3 -fomit-frame-pointer
+#3665238: gcc.c-torture/execute/builtins/string-1.c execution, -O3 -g
+#3665238: gcc.c-torture/execute/builtins/string-1.c execution, -fast
+#3665238: gcc.c-torture/execute/builtins/string-3.c execution, -O3 -fomit-frame-pointer
+#3665238: gcc.c-torture/execute/builtins/string-3.c execution, -O3 -g
+#3665238: gcc.c-torture/execute/builtins/string-3.c execution, -fast
+#3665238: gcc.c-torture/execute/builtins/string-4.c execution, -O3 -fomit-frame-pointer
+#3665238: gcc.c-torture/execute/builtins/string-4.c execution, -O3 -g
+#3665238: gcc.c-torture/execute/builtins/string-4.c execution, -fast
+#3665238: gcc.c-torture/execute/builtins/string-5.c execution, -O3 -fomit-frame-pointer
+#3665238: gcc.c-torture/execute/builtins/string-5.c execution, -O3 -g
+#3665238: gcc.c-torture/execute/builtins/string-5.c execution, -fast
+#3665238: gcc.c-torture/execute/builtins/string-8.c execution, -O3 -fomit-frame-pointer
+#3665238: gcc.c-torture/execute/builtins/string-8.c execution, -O3 -g
+#3665238: gcc.c-torture/execute/builtins/string-8.c execution, -fast
+#3648882: gcc.c-torture/execute/20030811-1.c compilation, -O0
+#3648882: gcc.c-torture/execute/20030811-1.c compilation, -O1
+#3648882: gcc.c-torture/execute/20030811-1.c compilation, -O2
+#3648882: gcc.c-torture/execute/20030811-1.c compilation, -O3 -fomit-frame-pointer
+#3648882: gcc.c-torture/execute/20030811-1.c compilation, -O3 -g
+#3648882: gcc.c-torture/execute/20030811-1.c compilation, -Os
+#3665098: gcc.dg/compat/struct-by-value-1 c_compat_x_tst.o-c_compat_y_tst.o link
+#3665098: gcc.dg/compat/struct-by-value-2 c_compat_x_tst.o-c_compat_y_tst.o link
+#3665098: gcc.dg/compat/struct-by-value-4 c_compat_x_tst.o-c_compat_y_tst.o link
+#3665098: gcc.dg/compat/struct-by-value-8 c_compat_x_tst.o-c_compat_y_tst.o link
+#3665098: gcc.dg/compat/struct-by-value-9 c_compat_x_tst.o-c_compat_y_tst.o link
+#3665098: gcc.dg/compat/struct-return-2 c_compat_x_tst.o-c_compat_y_tst.o link
+#3665240: gcc.c-torture/execute/simd-2.c execution, -O3 -fomit-frame-pointer
+#3665240: gcc.c-torture/execute/simd-2.c execution, -O3 -g
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 5)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 6)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 7)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 10)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 11)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 12)
+#3648907: gcc.dg/pch/valid-2.c -O0 -g (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-2.c -O0 -g (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-2.c -O0 (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-2.c -O0 (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-2.c -O1 (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-2.c -O1 (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-2.c -O2 (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-2.c -O2 (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-2.c -O3 -fomit-frame-pointer (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-2.c -O3 -fomit-frame-pointer (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-2.c -O3 -g (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-2.c -O3 -g (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-2.c -Os (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-2.c -Os (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-2.c -fast (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-2.c -fast (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-3.c -O0 -g (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-3.c -O0 -g (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-3.c -O0 (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-3.c -O0 (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-3.c -O1 (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-3.c -O1 (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-3.c -O2 (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-3.c -O2 (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-3.c -O3 -fomit-frame-pointer (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-3.c -O3 -fomit-frame-pointer (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-3.c -O3 -g (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-3.c -O3 -g (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-3.c -Os (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-3.c -Os (test for errors, line 3) #1
+#3648907: gcc.dg/pch/valid-3.c -fast (test for errors, line 3)
+#3648907: gcc.dg/pch/valid-3.c -fast (test for errors, line 3) #1
+#3665227: gcc.dg/compat/scalar-by-value-1 c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/scalar-by-value-1 c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/scalar-by-value-3 c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/scalar-by-value-3 c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/scalar-return-1 c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/scalar-return-1 c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/scalar-return-3 c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/scalar-return-3 c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-10 c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-10 c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-18 c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-18 c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-7 c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-7 c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-7a c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-7a c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-7b c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/struct-by-value-7b c_compat_y_tst.o compile
+#3665227: gcc.dg/compat/struct-return-10 c_compat_x_tst.o compile
+#3665227: gcc.dg/compat/struct-return-10 c_compat_y_tst.o compile
+#3665279: gcc.dg/compat/vector-1 c_compat_x_tst.o compile
+#3665279: gcc.dg/compat/vector-1 c_compat_y_tst.o compile
+#3665279: gcc.dg/compat/vector-2 c_compat_x_tst.o compile
+#3665279: gcc.dg/compat/vector-2 c_compat_y_tst.o compile
+#3665284: gcc.dg/compat/struct-by-value-21 c_compat_x_tst.o compile
+#3665284: gcc.dg/compat/struct-by-value-21 c_compat_y_tst.o compile
+#3665284: gcc.dg/compat/struct-return-21 c_compat_x_tst.o compile
+#3665284: gcc.dg/compat/struct-return-21 c_compat_y_tst.o compile
+#3649368: gcc.dg/20040322-1.c (test for excess errors)
+#3649525: gcc.dg/Wshadow-2.c (test for bogus messages, line 9)
+#3649525: gcc.dg/Wshadow-2.c (test for excess errors)
+#3649550: gcc.dg/alias-2.c (test for warnings, line 14)
+#3636386: gcc.dg/altivec-varargs-1.c (test for excess errors)
+#3644051: gcc.dg/array-5.c (test for excess errors)
+#3665098: gcc.dg/array-quals-1.c scan-assembler-not \\.data(?!\\.rel\\.ro)
+#3191432: gcc.dg/asm-fs-1.c scan-assembler-not \\*_bar
+#3191432: gcc.dg/asm-fs-1.c scan-assembler-not \\*_baz
+3191500: gcc.dg/c99-func-3.c execution test
+#3649563: gcc.dg/compare8.c (test for bogus messages, line 7)
+#3649563: gcc.dg/compare8.c (test for bogus messages, line 13)
+#3649563: gcc.dg/compare8.c (test for bogus messages, line 19)
+#3645905: gcc.dg/doloop-1.c scan-assembler bdnz
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 5)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 6)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 7)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 10)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 11)
+#3649581: gcc.dg/gnu89-dupqual-1.c (test for bogus messages, line 12)
+#3649603: gcc.dg/gnu89-init-3.c (test for excess errors)
+#3649639: gcc.dg/reg-vol-struct-1.c explicit address (test for warnings, line 16)
+#3649639: gcc.dg/reg-vol-struct-1.c (test for excess errors)
+#3665227: gcc.dg/rs6000-ldouble-1.c (test for excess errors)
+#3665098: gcc.dg/struct-by-value-1.c (test for excess errors)
+3666921: gcc.dg/uninit-H.c (test for bogus messages, line 18)
+#3665227: gcc.dg/format/asm_fprintf-1.c (test for excess errors)
+#3665227: gcc.dg/format/asm_fprintf-1.c -DWIDE (test for excess errors)
+#3665227: gcc.dg/format/c99-printf-1.c (test for excess errors)
+#3665227: gcc.dg/format/c99-printf-1.c -DWIDE (test for excess errors)
+#3665227: gcc.dg/format/c99-scanf-1.c (test for excess errors)
+#3665227: gcc.dg/format/c99-scanf-1.c -DWIDE (test for excess errors)
+#3665227: gcc.dg/format/gcc_diag-1.c (test for excess errors)
+#3665227: gcc.dg/format/gcc_diag-1.c -DWIDE (test for excess errors)
+#3649672: gcc.dg/noncompile/undeclared-1.c -O0 (test for excess errors)
+#3649672: gcc.dg/noncompile/undeclared-1.c -O1 (test for excess errors)
+#3649672: gcc.dg/noncompile/undeclared-1.c -O2 (test for excess errors)
+#3649672: gcc.dg/noncompile/undeclared-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3649672: gcc.dg/noncompile/undeclared-1.c -O3 -g (test for excess errors)
+#3649672: gcc.dg/noncompile/undeclared-1.c -Os (test for excess errors)
+#3649672: gcc.dg/noncompile/undeclared-1.c -fast (test for excess errors)
+#3640156: gcc.dg/pch/apple-altivec-1.c -O0 -g (test for excess errors)
+#3640156: gcc.dg/pch/apple-altivec-1.c -O0 (test for excess errors)
+#3640156: gcc.dg/pch/apple-altivec-1.c -O1 (test for excess errors)
+#3640156: gcc.dg/pch/apple-altivec-1.c -O2 (test for excess errors)
+#3640156: gcc.dg/pch/apple-altivec-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3640156: gcc.dg/pch/apple-altivec-1.c -O3 -g (test for excess errors)
+#3640156: gcc.dg/pch/apple-altivec-1.c -Os (test for excess errors)
+#3266222: gcc.dg/pch/apple-altivec-1.c -O0 -g assembly comparison
+#3266222: gcc.dg/pch/apple-altivec-1.c -O3 -g assembly comparison
+#3640156: gcc.dg/pch/apple-altivec-1.c -fast (test for excess errors)
+3555440: gcc.dg/ss/one.c -O0 Make repository
+3555440: gcc.dg/ss/one.c -O1 Make repository
+3555440: gcc.dg/ss/one.c -O2 Make repository
+3555440: gcc.dg/ss/one.c -O3 -fomit-frame-pointer Make repository
+3555440: gcc.dg/ss/one.c -O3 -g Make repository
+3555440: gcc.dg/ss/one.c -Os Make repository
+3555440: gcc.dg/ss/one.c -fast Make repository
+#3666982: gcc.dg/tree-ssa-chrec/ssa-chrec-04.c scan-tree-dump-times remove_me 0
+#3666982: gcc.dg/tree-ssa-chrec/ssa-chrec-06.c scan-tree-dump-times remove_me 0
+#3666982: gcc.dg/tree-ssa-chrec/ssa-chrec-07.c scan-tree-dump-times remove_me 0
+#3666982: gcc.dg/tree-ssa-chrec/ssa-chrec-08.c scan-tree-dump-times remove_me 0
+#3666982: /Volumes/SandBox/TestResults/tmp/Darwin/gcc-1753/gcc3/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c diff-tree-dumps ddall
+#3666982: gcc.dg/tree-ssa-chrec/ssa-chrec-56.c scan-tree-dump-times remove_me 0
+#3666982: gcc.dg/tree-ssa-chrec/ssa-chrec-57.c scan-tree-dump-times remove_me 0
+#3666982: gcc.dg/tree-ssa-chrec/ssa-chrec-58.c scan-tree-dump-times remove_me 0
+#3666982: gcc.dg/tree-ssa/20030711-1.c scan-tree-dump-times vec.length 4
+#3666982: gcc.dg/tree-ssa/20030807-6.c scan-tree-dump-times ABS_EXPR 0
+#3666982: gcc.dg/tree-ssa/20030807-7.c scan-tree-dump-times if 1
+#3666982: gcc.dg/tree-ssa/20031216-1.c scan-tree-dump-times link_error 0
+3665098: 209: expected branch percentages not found: 25
+3665098: gcc.misc-tests/gcov-4b.c gcov: 0 failures in line counts, 1 in branch percentages, 0 in return percentages
+#3644687: gcc.misc-tests/mg.c
+3667992: gcc.apple/Wlong-double.c (test for warnings, line 8)
+3667992: gcc.apple/Wlong-double.c (test for warnings, line 8) #1
+3667992: gcc.apple/Wlong-double.c (test for warnings, line 8) #2
+#3672145: gcc.dg/compat/scalar-by-value-1 c_compat_x_tst.o compile
+#3672145: gcc.dg/compat/scalar-by-value-1 c_compat_y_tst.o compile
+#3672145: gcc.dg/compat/scalar-return-1 c_compat_x_tst.o compile
+#3672145: gcc.dg/compat/scalar-return-1 c_compat_y_tst.o compile
+#3672145: gcc.dg/compat/struct-by-value-7 c_compat_x_tst.o compile
+#3672145: gcc.dg/compat/struct-by-value-7 c_compat_y_tst.o compile
+#3672145: gcc.dg/compat/struct-by-value-7a c_compat_x_tst.o compile
+#3672145: gcc.dg/compat/struct-by-value-7a c_compat_y_tst.o compile
+#3672145: gcc.dg/compat/struct-by-value-7b c_compat_x_tst.o compile
+#3672145: gcc.dg/compat/struct-by-value-7b c_compat_y_tst.o compile
+#3672145: gcc.dg/torture/builtin-explog-1.c -O0 (test for excess errors)
+#3672145: gcc.dg/torture/builtin-math-1.c -O0 (test for excess errors)
+#3672145: gcc.dg/torture/builtin-power-1.c -O0 (test for excess errors)
+#3672145: gcc.c-torture/compile/20010421-1.c -O0 (test for excess errors)
+#3672145: gcc.c-torture/execute/20020413-1.c compilation, -O0
+#3672145: gcc.c-torture/execute/20040208-1.c compilation, -O0
+#3672145: gcc.c-torture/execute/930622-2.c compilation, -O0
+#3672145: gcc.c-torture/execute/960215-1.c compilation, -O0
+#3672145: gcc.c-torture/execute/960513-1.c compilation, -O0
+#3672145: gcc.c-torture/execute/conversion.c compilation, -O0
+#3672145: gcc.c-torture/execute/regstack-1.c compilation, -O0
+#3672145: gcc.c-torture/execute/ieee/20010226-1.c compilation, -O0
+#3672161: gcc.c-torture/execute/conversion.c compilation, -O1
+#3672161: gcc.c-torture/execute/conversion.c compilation, -O2
+#3672161: gcc.c-torture/execute/conversion.c compilation, -Os
+#3672161: gcc.c-torture/execute/ieee/inf-2.c compilation, -O1
+#3672161: gcc.c-torture/execute/ieee/inf-2.c compilation, -O2
+#3672161: gcc.c-torture/execute/ieee/inf-2.c compilation, -O3 -fomit-frame-pointer
+#3672161: gcc.c-torture/execute/ieee/inf-2.c compilation, -O3 -g
+#3672161: gcc.c-torture/execute/ieee/inf-2.c compilation, -Os
+#3525705: gcc.c-torture/execute/va-arg-5.c execution, -O0
+#3525705: gcc.c-torture/execute/va-arg-5.c execution, -O1
+#3525705: gcc.c-torture/execute/va-arg-5.c execution, -O2
+#3525705: gcc.c-torture/execute/va-arg-5.c execution, -O3 -fomit-frame-pointer
+#3525705: gcc.c-torture/execute/va-arg-5.c execution, -O3 -g
+#3525705: gcc.c-torture/execute/va-arg-5.c execution, -Os
+#3525705: gcc.c-torture/execute/va-arg-5.c execution, -fast
+#3525705: gcc.c-torture/execute/va-arg-6.c execution, -O0
+#3525705: gcc.c-torture/execute/va-arg-6.c execution, -O1
+#3525705: gcc.c-torture/execute/va-arg-6.c execution, -O2
+#3525705: gcc.c-torture/execute/va-arg-6.c execution, -O3 -fomit-frame-pointer
+#3525705: gcc.c-torture/execute/va-arg-6.c execution, -O3 -g
+#3525705: gcc.c-torture/execute/va-arg-6.c execution, -Os
+#3652019: gcc.dg/builtins-7.c (test for excess errors)
+#3652019: gcc.dg/builtins-18.c (test for excess errors)
+#3652019: gcc.dg/builtins-20.c (test for excess errors)
+#3652019: gcc.dg/builtins-26.c (test for excess errors)
+#3652019: gcc.dg/torture/builtin-convert-1.c -O1 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-convert-1.c -O2 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-convert-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3652019: gcc.dg/torture/builtin-convert-1.c -O3 -g (test for excess errors)
+#3652019: gcc.dg/torture/builtin-convert-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-convert-1.c -fast (test for excess errors)
+#3652019: gcc.dg/torture/builtin-explog-1.c -O1 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-explog-1.c -O2 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-explog-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3652019: gcc.dg/torture/builtin-explog-1.c -O3 -g (test for excess errors)
+#3652019: gcc.dg/torture/builtin-explog-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-explog-1.c -fast (test for excess errors)
+#3652019: gcc.dg/torture/builtin-integral-1.c -O0 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-integral-1.c -O1 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-integral-1.c -O2 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-integral-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3652019: gcc.dg/torture/builtin-integral-1.c -O3 -g (test for excess errors)
+#3652019: gcc.dg/torture/builtin-integral-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-integral-1.c -fast (test for excess errors)
+#3652019: gcc.dg/torture/builtin-nonneg-1.c -O0 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-nonneg-1.c -O1 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-nonneg-1.c -O2 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-nonneg-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3652019: gcc.dg/torture/builtin-nonneg-1.c -O3 -g (test for excess errors)
+#3652019: gcc.dg/torture/builtin-nonneg-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-nonneg-1.c -fast (test for excess errors)
+#3652019: gcc.dg/torture/builtin-power-1.c -O1 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-power-1.c -O2 (test for excess errors)
+#3652019: gcc.dg/torture/builtin-power-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3652019: gcc.dg/torture/builtin-power-1.c -O3 -g (test for excess errors)
+#3652019: gcc.dg/torture/builtin-power-1.c -Os (test for excess errors)
+#3652019: gcc.dg/torture/builtin-power-1.c -fast (test for excess errors)
+#3665286: gcc.apple/altivec-1.c (test for excess errors)
+#3665286: gcc.dg/altivec-1.c (test for excess errors)
+#3665286: gcc.dg/altivec-12.c (test for excess errors)
+#3665286: gcc.dg/altivec-13.c (test for excess errors)
+#3665286: gcc.dg/altivec-6.c (test for excess errors)
+#3665286: gcc.dg/altivec-7.c (test for excess errors)
+#3673607: gcc.c-torture/execute/950915-1.c execution, -fast
+#3673610: gcc.c-torture/execute/va-arg-17.c execution, -fast
+#3673612: gcc.c-torture/execute/va-arg-22.c compilation, -fast
+#3673612: gcc.c-torture/compile/zero-strct-1.c -fast (test for excess errors)
+3673618: gcc.c-torture/execute/ieee/fp-cmp-1.c execution, -fast
+3673618: gcc.c-torture/execute/ieee/fp-cmp-2.c execution, -fast
+3673618: gcc.c-torture/execute/ieee/fp-cmp-3.c execution, -fast
+3673618: gcc.c-torture/execute/ieee/fp-cmp-4.c execution, -fast
+3673630: gcc.c-torture/execute/ieee/fp-cmp-5.c compilation, -fast
+3673630: gcc.c-torture/execute/ieee/fp-cmp-6.c compilation, -fast
+3673618: gcc.c-torture/execute/ieee/fp-cmp-8.c execution, -fast
+3673638: gcc.dg/noncompile/920507-1.c -fast (test for excess errors)
+#3666982: gcc.dg/tree-ssa-chrec/ssa-chrec-27.c scan-tree-dump-times nb_iterations 26 1
+#3525705: gcc.dg/format/c99-printf-1.c (test for excess errors)
+#3525705: gcc.dg/format/c99-printf-1.c -DWIDE (test for excess errors)
+#3681611: gcc.dg/cpp/trad/builtins.c (test for excess errors)
+#3681611: gcc.dg/cpp/trad/funlike-4.c (test for excess errors)
+#3681611: gcc.dg/cpp/trad/literals-1.c (test for excess errors)
+#3681611: gcc.dg/cpp/trad/macroargs.c (test for excess errors)
+#3681611: gcc.dg/cpp/trad/strify.c (test for excess errors)
+#3681923: gcc.c-torture/execute/20040307-1.c execution, -O1
+#3681923: gcc.c-torture/execute/20040307-1.c execution, -O2
+#3681923: gcc.c-torture/execute/20040307-1.c execution, -O3 -fomit-frame-pointer
+#3681923: gcc.c-torture/execute/20040307-1.c execution, -O3 -fomit-frame-pointer -funroll-loops
+#3681923: gcc.c-torture/execute/20040307-1.c execution, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
+#3681923: gcc.c-torture/execute/20040307-1.c execution, -O3 -g
+#3681923: gcc.c-torture/execute/20040307-1.c execution, -Os
+#3681923: gcc.c-torture/execute/20040307-1.c execution, -fast
+#3681923: gcc.c-torture/execute/931004-12.c execution, -O0
+#3681923: gcc.c-torture/execute/931004-12.c execution, -O1
+#3681923: gcc.c-torture/execute/931004-12.c execution, -O2
+#3681923: gcc.c-torture/execute/931004-12.c execution, -O3 -fomit-frame-pointer
+#3681923: gcc.c-torture/execute/931004-12.c execution, -O3 -fomit-frame-pointer -funroll-loops
+#3681923: gcc.c-torture/execute/931004-12.c execution, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
+#3681923: gcc.c-torture/execute/931004-12.c execution, -O3 -g
+#3681923: gcc.c-torture/execute/931004-12.c execution, -Os
+#3681923: gcc.c-torture/execute/va-arg-22.c execution, -O0
+#3681923: gcc.c-torture/execute/va-arg-22.c execution, -O1
+#3681923: gcc.c-torture/execute/va-arg-22.c execution, -O2
+#3681923: gcc.c-torture/execute/va-arg-22.c execution, -O3 -fomit-frame-pointer
+#3681923: gcc.c-torture/execute/va-arg-22.c execution, -O3 -fomit-frame-pointer -funroll-loops
+#3681923: gcc.c-torture/execute/va-arg-22.c execution, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
+#3681923: gcc.c-torture/execute/va-arg-22.c execution, -O3 -g
+#3681923: gcc.c-torture/execute/va-arg-22.c execution, -Os
+#3681923: gcc.dg/c90-const-expr-3.c (test for excess errors)
+#3681923: gcc.dg/c99-const-expr-3.c (test for excess errors)
+3907496: gcc.dg/rs6000-power2-2.c scan-assembler-not lfd
+#3691367: gcc.dg/rs6000-power2-2.c scan-assembler sfq
+#3672145: gcc.dg/torture/builtin-convert-2.c -O0 (test for excess errors)
+#3666982: gcc.dg/tree-ssa-vect/tree-ssa-vect-8.c scan-tree-dump-times vectorized 1 loops 1
+#3666982: gcc.dg/tree-ssa-vect/tree-ssa-vect-none.c scan-tree-dump-times vectorized 0 loops 2
+#3666982: gcc.dg/tree-ssa-vect/tree-ssa-vect-none.c scan-tree-dump-times vectorized 1 loops 1
+3691624: gcc.dg/debug/dwarf2/dwarf-die7.c scan-assembler 1.*DW_AT_inline
+3717694: gcc.dg/pch/valid-3.c -fast (test for errors, line 3)
+3717694: gcc.dg/pch/valid-3.c -fast (test for errors, line 3) #1
+#3753405: gcc.apple/asm-block-1.c (test for excess errors)
+#3753405: gcc.apple/asm-block-2.c (test for excess errors)
+#3753413: gcc.apple/const-cfstring-1.c (test for excess errors)
+#3753413: gcc.apple/const-cfstring-3.c (test for excess errors)
+#3753408: gcc.dg/tree-ssa-vect/ifc-01.c (test for excess errors)
+#3753408: gcc.dg/tree-ssa-vect/ifc-01.c scan-tree-dump-times Applying if-conversion 1
+#3753408: gcc.dg/tree-ssa-vect/ifc-01.c scan-tree-dump-times vectorized 1 loops 1
+#3753408: gcc.dg/tree-ssa-vect/ifc-02.c (test for excess errors)
+#3753408: gcc.dg/tree-ssa-vect/ifc-02.c scan-tree-dump-times Applying if-conversion 1
+#3753408: gcc.dg/tree-ssa-vect/ifc-03.c (test for excess errors)
+#3753408: gcc.dg/tree-ssa-vect/ifc-03.c scan-tree-dump-times Applying if-conversion 1
+#3753408: gcc.dg/tree-ssa-vect/ifc-04.c (test for excess errors)
+#3753408: gcc.dg/tree-ssa-vect/ifc-04.c scan-tree-dump-times Applying if-conversion 1
+#3753408: gcc.dg/tree-ssa-vect/ifc-04.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa-vect/pr16105.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-1.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-10.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-11.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-12.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-13.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-14.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-15.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-16.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-17.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-18.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-19.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-2.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-20.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-21.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-22.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-23.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-24.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-25.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-26.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-27.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-27.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-28.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-29.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-29.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-3.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-30.c scan-tree-dump-times vectorized 1 loops 2
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-4.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-40.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-41.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-42.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-43.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-44.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-45.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-46.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-48.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-48.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-49.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-5.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-52.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-54.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-55.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-56.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-57.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-6.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-7.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-8.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-9.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-all.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-none.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-none.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa/ivcanon-1.c (test for excess errors)
+3907144: gcc.dg/tree-ssa/sra-1.c scan-tree-dump-times link_error 0
+#3753410: gcc.dg/tree-ssa/ssa-dce-3.c scan-tree-dump-times PHI 1
+#3753410: gcc.dg/tree-ssa/ssa-dce-3.c scan-tree-dump-times if 1
+3907144: gcc.dg/tree-ssa-chrec/20040216-1.c scan-tree-dump-times Dependence Node 4
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-31.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-32.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-33.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-33.c scan-tree-dump-times vectorized 1 loops 1
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-34.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-35.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa-vect/tree-ssa-vect-36.c (test for excess errors)
+#3753410: gcc.dg/tree-ssa/20040615-1.c scan-tree-dump-times bar2 0
+3761751: gcc.c-torture/execute/builtins/fputs.c execution, -fast
+3761751: gcc.c-torture/execute/builtins/memmove.c execution, -fast
+3761751: gcc.c-torture/execute/builtins/memops-asm.c compilation, -fast
+3761751: gcc.c-torture/execute/builtins/mempcpy.c execution, -fast
+3761751: gcc.c-torture/execute/builtins/memset.c execution, -fast
+3761751: gcc.c-torture/execute/builtins/strlen-2.c execution, -fast
+3761751: gcc.c-torture/execute/builtins/strpcpy.c execution, -fast
+3761751: gcc.c-torture/execute/builtins/strstr-asm.c compilation, -fast
+#3665098: gcc.c-torture/compile/labels-1.c -O0 (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-1.c -O1 (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-1.c -O2 (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-1.c -O3 -fomit-frame-pointer (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-1.c -O3 -g (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-1.c -Os (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-1.c -fast (test for excess errors)
+#3665098: gcc.c-torture/compile/labels-2.c -O0 (test for excess errors)
+3665098: gcc.c-torture/compile/20021108-1.c (test for excess errors)
+3765162: gcc.c-torture/execute/20040709-2.c compilation, -fast
+#3765528: gcc.apple/pascal-strings-2.c (test for excess errors)
+#3765575: gcc.c-torture/execute/930718-1.c execution, -fast
+#3765610: gcc.c-torture/execute/va-arg-5.c execution, -fast
+#3765610: gcc.c-torture/execute/va-arg-6.c execution, -fast
+3765630: gcc.c-torture/execute/ieee/compare-fp-1.c compilation, -fast
+3765630: gcc.c-torture/execute/ieee/compare-fp-4.c execution, -fast
+3765630: gcc.c-torture/execute/ieee/fp-cmp-4f.c execution, -fast
+3765630: gcc.c-torture/execute/ieee/fp-cmp-4l.c execution, -fast
+3765630: gcc.c-torture/execute/ieee/fp-cmp-8f.c execution, -fast
+3765630: gcc.c-torture/execute/ieee/fp-cmp-8l.c execution, -fast
+#3765772: gcc.dg/compat/scalar-by-value-1 c_compat_x_tst.o-c_compat_y_tst.o execute
+#3765772: gcc.dg/compat/struct-by-value-7a c_compat_x_tst.o-c_compat_y_tst.o execute
+#3801739: gcc.dg/verbose-asm-2.c (test for excess errors)
+#3801739: gcc.dg/verbose-asm.c (test for excess errors)
+#3846069: gcc.dg/cpp/trigraphs.c (test for excess errors)
+#3846069: gcc.dg/cpp/19990407-1.c (test for excess errors)
+#3846069: gcc.dg/cpp/strp1.c (test for excess errors)
+#3846069: gcc.dg/cpp/strp2.c (test for excess errors)
+#3846069: gcc.dg/darwin-abi-2.c (test for excess errors)
+#3846069: gcc.dg/struct-ret-libc.c (test for excess errors)
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-01.c scan-tree-dump-times nb_iterations 4 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-01.c scan-tree-dump-times nb_iterations 6 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-02.c scan-tree-dump-times nb_iterations 3 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-02.c scan-tree-dump-times nb_iterations 9 1
+3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-03.c scan-tree-dump-times set_nb_iterations_in_loop = 5 1
+3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-03.c scan-tree-dump-times set_nb_iterations_in_loop = 7 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-04.c scan-tree-dump-times nb_iterations 28 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-05.c scan-tree-dump-times nb_iterations 28 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-05.c scan-tree-dump-times nb_iterations 6 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-06.c scan-tree-dump-times nb_iterations 2 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-06.c scan-tree-dump-times nb_iterations 6 1
+3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-10.c scan-tree-dump-times set_nb_iterations_in_loop = 39 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-15.c scan-tree-dump-times nb_iterations 50 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-27.c scan-tree-dump-times nb_iterations 100 1
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-27.c scan-tree-dump-times nb_iterations 26 1
+#3846092: gcc.dg/tree-ssa-vect/tree-ssa-vect-48.c execution test
+#3846092: gcc.dg/vect/vect-75.c scan-tree-dump-times vectorized 1 loops 1
+#3846092: gcc.dg/vect/vect-76.c scan-tree-dump-times vectorized 3 loops 1
+#3846092: gcc.dg/vect/vect-77.c scan-tree-dump-times vectorized 1 loops 1
+#3846092: gcc.dg/vect/vect-77a.c scan-tree-dump-times vectorized 1 loops 1
+3846097: gcc.c-torture/execute/builtins/memmove-2.c execution, -fast
+3846097: gcc.c-torture/execute/builtins/strcpy-2.c execution, -fast
+3846097: gcc.c-torture/execute/builtins/strlen-3.c execution, -fast
+3846100: gcc.dg/pr17055-1.c (test for excess errors)
+#3846109: gcc.apple/altivec-2.c execution test
+3846117: gcc.dg/verbose-asm-2.c scan-assembler fpeephole=0
+#3851502: ./apple-altivec-1.h -O1 (test for excess errors)
+#3851502: ./apple-altivec-1.h -O2 (test for excess errors)
+#3851502: ./apple-altivec-1.h -O3 -fomit-frame-pointer (test for excess errors)
+#3851502: ./apple-altivec-1.h -O3 -g (test for excess errors)
+#3851502: ./apple-altivec-1.h -Os (test for excess errors)
+#3851502: ./apple-altivec-1.h -fast (test for excess errors)
+#3869007: gcc.dg/tree-ssa/ivcanon-1.c (test for excess errors)
+3869017: gcc.dg/tree-ssa-chrec/ssa-chrec-04.c scan-tree-dump-times remove_me 0
+3869017: gcc.dg/tree-ssa-chrec/ssa-chrec-07.c scan-tree-dump-times remove_me 0
+3869017: gcc.dg/tree-ssa-chrec/ssa-chrec-08.c scan-tree-dump-times remove_me 0
+3869017: gcc.dg/tree-ssa-chrec/ssa-chrec-57.c scan-tree-dump-times remove_me 0
+3869017: gcc.dg/tree-ssa-chrec/ssa-chrec-58.c scan-tree-dump-times remove_me 0
+3869017: gcc.dg/tree-ssa/20030807-7.c scan-tree-dump-times if 1
+3869017: gcc.dg/tree-ssa/20031216-1.c scan-tree-dump-times link_error 0
+#3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-53.c (test for excess errors)
+3846472: gcc.dg/tree-ssa-chrec/ssa-chrec-55.c (test for excess errors)
+#3903960: gcc.dg/20030626-1.c (test for bogus messages, line 17)
+#3904017: gcc.apple/test-local-static-longlong.c (test for excess errors)
+3673618: gcc.c-torture/execute/ieee/unsafe-fp-assoc.c execution, -fast
+#
+# the following failures occur only when the tests are being run through ObjC
+3904213: gcc.dg/20040813-1.c scan-assembler .stabs.*100,0,2
+3904216: gcc.dg/cast-function-1.c (test for warnings, line 25)
+3904216: gcc.dg/cast-function-1.c (test for warnings, line 26)
+3904216: gcc.dg/cast-function-1.c (test for warnings, line 27)
+3904216: gcc.dg/cast-function-1.c (test for warnings, line 28)
+3904216: gcc.dg/cast-function-1.c (test for warnings, line 32)
+3904216: gcc.dg/cast-function-1.c (test for warnings, line 34)
+3904216: gcc.dg/cast-function-1.c (test for warnings, line 35)
+3904224: gcc.dg/gnu89-init-1.c (test for excess errors)
+3904224: gcc.dg/gnu99-init-1.c (test for excess errors)
+3904228: gcc.dg/uninit-A.c (test for excess errors)
+3904235: gcc.dg/wtr-unary-plus-1.c unary plus operator (test for warnings, line 12)
+3904235: gcc.dg/wtr-unary-plus-1.c unary plus operator (test for warnings, line 13)
+#
+3907496: gcc.dg/rs6000-power2-2.c scan-assembler lfq
+3907496: gcc.dg/rs6000-power2-2.c scan-assembler stfq
+3906375: gcc.dg/debug/debug-1.c -gstabs -fast scan-assembler xyzzy
+3906375: gcc.dg/debug/debug-1.c -gstabs3 -fast scan-assembler xyzzy
+3906375: gcc.dg/debug/debug-1.c -gstabs+ -fast scan-assembler xyzzy
+3906375: gcc.dg/debug/debug-1.c -gstabs+3 -fast scan-assembler xyzzy
+3906375: gcc.dg/debug/debug-2.c -gstabs -fast scan-assembler xyzzy
+3906375: gcc.dg/debug/debug-2.c -gstabs3 -fast scan-assembler xyzzy
+3906375: gcc.dg/debug/debug-2.c -gstabs+ -fast scan-assembler xyzzy
+3906375: gcc.dg/debug/debug-2.c -gstabs+3 -fast scan-assembler xyzzy
+#3906388: gcc.dg/vmx/1b-06.c -O0 (test for excess errors)
+#3906388: gcc.dg/vmx/1b-06.c -O1 (test for excess errors)
+#3906388: gcc.dg/vmx/1b-06.c -O2 (test for excess errors)
+#3906388: gcc.dg/vmx/1b-06.c -O3 -fomit-frame-pointer (test for excess errors)
+#3906388: gcc.dg/vmx/1b-06.c -O3 -g (test for excess errors)
+#3906388: gcc.dg/vmx/1b-06.c -Os (test for excess errors)
+#3906388: gcc.dg/vmx/1b-06.c -fast (test for excess errors)
+#3906388: gcc.dg/vmx/1b-07.c -O0 (test for excess errors)
+#3906388: gcc.dg/vmx/1b-07.c -O1 (test for excess errors)
+#3906388: gcc.dg/vmx/1b-07.c -O2 (test for excess errors)
+#3906388: gcc.dg/vmx/1b-07.c -O3 -fomit-frame-pointer (test for excess errors)
+#3906388: gcc.dg/vmx/1b-07.c -O3 -g (test for excess errors)
+#
+# the following failures are for -m64
+#3952527: gcc.apple/align-test-1.c execution test
+#3952527: gcc.apple/align-test-2.c execution test
+#3952527: gcc.apple/align-test-3.c execution test
+3966342: gcc.apple/altivec-1.c (test for excess errors)
+3966342: gcc.apple/apple-altivec-13.c (test for excess errors)
+3966342: gcc.apple/const-cfstring-3.c scan-assembler \\.long[ \\t]+___CFConstantStringClassReference\n[ \\t]*\\.long[ \\t]+1992\n[ \\t]*\\.long[ \\t]+LC.*\n[ \\t]*\\.long[ \\t]+4\n
+3966342: gcc.apple/const-cfstring-3.c scan-assembler \\.long[ \\t]+___CFConstantStringClassReference\n[ \\t]*\\.long[ \\t]+1992\n[ \\t]*\\.long[ \\t]+LC.*\n[ \\t]*\\.long[ \\t]+10\n
+3966342: gcc.dg/20020919-1.c (test for errors, line 105)
+3966342: gcc.dg/20020919-1.c (test for errors, line 123)
+3966342: gcc.dg/20020919-1.c (test for errors, line 132)
+3966342: gcc.dg/20020919-1.c (test for errors, line 159)
+3966342: gcc.dg/20020919-1.c (test for errors, line 177)
+3966342: gcc.dg/20020919-1.c (test for errors, line 231)
+3966342: gcc.dg/darwin-bool-1.c (test for excess errors)
+3966342: gcc.dg/uninit-H.c (test for bogus messages, line 20)
+3966342: gcc.dg/uninit-H.c (test for excess errors)
+3966342: gcc.dg/pr17133.c (test for excess errors)
+3966342: gcc.dg/lvalue-cast-1.c (test for excess errors)
+3939205: gcc.apple/altivec-faltivec-1.c (test for excess errors)
+3939205: gcc.apple/altivec-faltivec-1.c scan-tree-dump-times callee has AltiVec 2
+3939205: gcc.apple/altivec-faltivec-2.c (test for excess errors)
+3939205: gcc.apple/altivec-maltivec-1.c (test for excess errors)
+3939205: gcc.dg/framework-1.c (test for excess errors)
+3939381: gcc.apple/asm-block-2.c execution test
+3939381: gcc.c-torture/execute/20030913-1.c execution, -O0
+3939381: gcc.c-torture/execute/20030913-1.c execution, -O1
+3939381: gcc.c-torture/execute/20030913-1.c execution, -O2
+3939381: gcc.c-torture/execute/20030913-1.c execution, -O3 -fomit-frame-pointer
+3939381: gcc.c-torture/execute/20030913-1.c execution, -O3 -g
+3939381: gcc.c-torture/execute/20030913-1.c execution, -Os
+3939381: gcc.c-torture/execute/960218-1.c execution, -O0
+3939381: gcc.c-torture/execute/960218-1.c execution, -O1
+3939381: gcc.c-torture/execute/960218-1.c execution, -O2
+3939381: gcc.c-torture/execute/960218-1.c execution, -O3 -fomit-frame-pointer
+3939381: gcc.c-torture/execute/960218-1.c execution, -O3 -fomit-frame-pointer -funroll-loops
+3939381: gcc.c-torture/execute/960218-1.c execution, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
+3939381: gcc.c-torture/execute/960218-1.c execution, -O3 -g
+3939381: gcc.c-torture/execute/960218-1.c execution, -Os
+3939381: gcc.c-torture/execute/complex-6.c execution, -O0
+3939381: gcc.c-torture/execute/complex-6.c execution, -O1
+3939381: gcc.c-torture/execute/complex-6.c execution, -O2
+3939381: gcc.c-torture/execute/complex-6.c execution, -O3 -fomit-frame-pointer
+3939381: gcc.c-torture/execute/complex-6.c execution, -O3 -g
+3939381: gcc.c-torture/execute/complex-6.c execution, -Os
+#3965386: gcc.apple/asm-function-6.c execution test
+#3941199: gcc.c-torture/execute/20000822-1.c execution, -O0
+#3941199: gcc.c-torture/execute/920501-7.c execution, -O1
+#3941199: gcc.c-torture/execute/920501-7.c execution, -O2
+#3941199: gcc.c-torture/execute/920501-7.c execution, -O3 -fomit-frame-pointer
+#3941199: gcc.c-torture/execute/920501-7.c execution, -O3 -g
+#3941199: gcc.c-torture/execute/920501-7.c execution, -Os
+#3941199: gcc.c-torture/execute/comp-goto-2.c execution, -O1
+#3941199: gcc.c-torture/execute/comp-goto-2.c execution, -O2
+#3941199: gcc.c-torture/execute/comp-goto-2.c execution, -O3 -fomit-frame-pointer
+#3941199: gcc.c-torture/execute/comp-goto-2.c execution, -O3 -g
+#3941199: gcc.c-torture/execute/comp-goto-2.c execution, -Os
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -O0
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -O1
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -O2
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -O3 -fomit-frame-pointer
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -O3 -fomit-frame-pointer -funroll-loops
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -O3 -g
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -Os
+#3941199: gcc.c-torture/execute/nestfunc-3.c execution, -fast
+#3941199: gcc.c-torture/execute/nestfunc-5.c execution, -O1
+#3941199: gcc.c-torture/execute/nestfunc-5.c execution, -O2
+#3941199: gcc.c-torture/execute/nestfunc-5.c execution, -O3 -fomit-frame-pointer
+#3941199: gcc.c-torture/execute/nestfunc-5.c execution, -O3 -g
+#3941199: gcc.c-torture/execute/nestfunc-5.c execution, -Os
+#3941199: gcc.c-torture/execute/nestfunc-5.c execution, -fast
+#3941199: gcc.c-torture/execute/nestfunc-6.c execution, -O1
+#3941199: gcc.c-torture/execute/nestfunc-6.c execution, -O2
+#3941199: gcc.c-torture/execute/nestfunc-6.c execution, -O3 -fomit-frame-pointer
+#3941199: gcc.c-torture/execute/nestfunc-6.c execution, -O3 -g
+#3941199: gcc.c-torture/execute/nestfunc-6.c execution, -Os
+3953569: gcc.dg/nest.c execution test
+#3941199: gcc.dg/trampoline-1.c execution test
+#3944688: gcc.c-torture/execute/930718-1.c execution, -O2
+#3944688: gcc.c-torture/execute/930718-1.c execution, -O3 -fomit-frame-pointer
+#3944688: gcc.c-torture/execute/930718-1.c execution, -O3 -g
+#3944688: gcc.c-torture/execute/930718-1.c execution, -Os
+#3944688: gcc.c-torture/execute/930718-1.c execution, -fast
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-21 (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-21 -O (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-21 -O3 (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-21 -fast (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-2 (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-2 -O (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-2 -O3 (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-2 -fast (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-23 (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-23 -O (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-23 -O3 (test for excess errors)
+3967637: gcc.dg/debug/20020220-1.c -gdwarf-23 -fast (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-21 (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-21 -O (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-21 -O3 (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-21 -fast (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-2 (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-2 -O (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-2 -O3 (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-2 -fast (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-23 (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-23 -O (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-23 -O3 (test for excess errors)
+3967637: gcc.dg/debug/20020327-1.c -gdwarf-23 -fast (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-21 (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-21 -O (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-21 -O3 (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-21 -fast (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-2 (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-2 -O (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-2 -O3 (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-2 -fast (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-23 (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-23 -O (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-23 -O3 (test for excess errors)
+3967637: gcc.dg/debug/trivial.c -gdwarf-23 -fast (test for excess errors)
+3967653: gcc.dg/altivec-14.c (test for excess errors)
+3967747: gcc.dg/cleanup-10.c execution test
+3967747: gcc.dg/cleanup-11.c execution test
+3967747: gcc.dg/cleanup-8.c execution test
+3967747: gcc.dg/cleanup-9.c execution test
+3944739: gcc.dg/tree-ssa/loop-2.c scan-tree-dump-times \* 17 0
+3944739: gcc.dg/tree-ssa/loop-2.c scan-tree-dump-times \+ 17 1
+3944739: gcc.dg/tree-ssa/loop-2.c scan-tree-dump-times 1700 1
+3944739: gcc.dg/tree-ssa/loop-2.c scan-tree-dump-times iter 0
+3944739: gcc.dg/vect/vect-77.c scan-tree-dump-times vectorized 1 loops 1
+3944739: gcc.dg/vect/vect-77a.c scan-tree-dump-times vectorized 1 loops 1
+3944942: gcc.dg/vect/pr18425.c scan-tree-dump-times vectorized 1 loops 1
+3939259: gcc.misc-tests/bprob-1.c compilation, -g -fprofile-arcs
+3939259: gcc.misc-tests/bprob-1.c compilation, -O3 -g -DPERFTIME -fprofile-arcs
+3939259: gcc.misc-tests/bprob-2.c compilation, -g -fprofile-arcs
+3939259: gcc.misc-tests/bprob-2.c compilation, -O3 -g -DPERFTIME -fprofile-arcs
+3939259: gcc.misc-tests/bprob-1.c compilation, -g -ftree-based-profiling -fprofile-arcs
+3939259: gcc.misc-tests/bprob-1.c compilation, -O3 -g -DPERFTIME -ftree-based-profiling -fprofile-arcs
+3939259: gcc.misc-tests/bprob-2.c compilation, -g -ftree-based-profiling -fprofile-arcs
+3939259: gcc.misc-tests/bprob-2.c compilation, -O3 -g -DPERFTIME -ftree-based-profiling -fprofile-arcs
+3939259: gcc.misc-tests/bprob-1.c execution, -fast -fprofile-arcs
+3939259: gcc.misc-tests/bprob-2.c execution, -fast -fprofile-arcs
+3939259: gcc.misc-tests/bprob-1.c execution, -fast -ftree-based-profiling -fprofile-arcs
+3939259: gcc.misc-tests/bprob-2.c execution, -fast -ftree-based-profiling -fprofile-arcs
+3939259: gcc.misc-tests/gcov-2.c (test for excess errors)
+3939035: linkage.c
+#3968090: gcc.c-torture/execute/20000717-4.c compilation, -fast
+#3968090: gcc.c-torture/execute/20000801-3.c compilation, -fast
+#3968090: gcc.c-torture/execute/20000801-4.c compilation, -fast
+#3968090: gcc.c-torture/execute/20010325-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/20020213-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/20030109-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/20040629-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/20040705-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/20040705-2.c compilation, -fast
+#3968090: gcc.c-torture/execute/20040709-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/960326-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/990326-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/builtin-prefetch-3.c compilation, -fast
+#3968090: gcc.c-torture/execute/index-1.c compilation, -fast
+#3968090: gcc.c-torture/execute/struct-ini-4.c compilation, -fast
+#3968607: gcc.c-torture/execute/990208-1.c execution, -fast
+3968604: gcc.dg/pch/apple-altivec-1.c -O0 -g (test for excess errors)
+3968604: gcc.dg/pch/apple-altivec-1.c -O0 -g (test for excess errors) #1
+3968604: gcc.dg/pch/apple-altivec-1.c -O0 (test for excess errors)
+3968604: gcc.dg/pch/apple-altivec-1.c -O0 (test for excess errors) #1
+3968604: gcc.dg/pch/apple-altivec-1.c -O1 (test for excess errors)
+3968604: gcc.dg/pch/apple-altivec-1.c -O1 (test for excess errors) #1
+3968604: gcc.dg/pch/apple-altivec-1.c -O2 (test for excess errors)
+3968604: gcc.dg/pch/apple-altivec-1.c -O2 (test for excess errors) #1
+3968604: gcc.dg/pch/apple-altivec-1.c -O3 -fomit-frame-pointer (test for excess errors)
+3968604: gcc.dg/pch/apple-altivec-1.c -O3 -fomit-frame-pointer (test for excess errors) #1
+3968604: gcc.dg/pch/apple-altivec-1.c -O3 -g (test for excess errors)
+3968604: gcc.dg/pch/apple-altivec-1.c -O3 -g (test for excess errors) #1
+3968604: gcc.dg/pch/apple-altivec-1.c -Os (test for excess errors)
+3968604: gcc.dg/pch/apple-altivec-1.c -Os (test for excess errors) #1
+#3962992: gcc.apple/inttypes-3.c (test for excess errors)
+3968602: gcc.c-torture/execute/20030811-1.c compilation, -fast
+#3968560: gcc.c-torture/execute/20040302-1.c compilation, -O0
+#3968560: gcc.c-torture/execute/20040302-1.c compilation, -O1
+#3968560: gcc.c-torture/execute/20040302-1.c compilation, -O3 -fomit-frame-pointer
+#3968560: gcc.c-torture/execute/20040302-1.c compilation, -O3 -g
+#3968560: gcc.c-torture/execute/20040302-1.c compilation, -Os
+#3968560: gcc.c-torture/execute/920302-1.c compilation, -O1
+#3968560: gcc.c-torture/execute/920302-1.c compilation, -O2
+#3968560: gcc.c-torture/execute/920302-1.c compilation, -O3 -fomit-frame-pointer
+#3968560: gcc.c-torture/execute/920302-1.c compilation, -O3 -fomit-frame-pointer -funroll-loops
+#3968560: gcc.c-torture/execute/920302-1.c compilation, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
+#3968560: gcc.c-torture/execute/920302-1.c compilation, -O3 -g
+#3968560: gcc.c-torture/execute/920302-1.c compilation, -Os
+#3968560: gcc.c-torture/execute/comp-goto-1.c compilation, -O1
+#3968560: gcc.c-torture/execute/comp-goto-1.c compilation, -O2
+#3968560: gcc.c-torture/execute/comp-goto-1.c compilation, -O3 -fomit-frame-pointer
+#3968560: gcc.c-torture/execute/comp-goto-1.c compilation, -O3 -fomit-frame-pointer -funroll-loops
+#3968560: gcc.c-torture/execute/comp-goto-1.c compilation, -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions
+#3968560: gcc.c-torture/execute/comp-goto-1.c compilation, -O3 -g
+3983883: gcc.dg/altivec-14.c (test for warnings, line 9)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 10)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 11)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 12)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 13)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 15)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 16)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 17)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 21)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 22)
+3983883: gcc.dg/altivec-14.c (test for warnings, line 23)
+3996036: gcc.dg/Wpadded.c (test for excess errors)
+#
+#3906388: gcc.dg/vmx/1b-07.c -Os (test for excess errors)
+#3906388: gcc.dg/vmx/1b-07.c -fast (test for excess errors)
+#3906478: gcc.dg/vmx/darwin-abi-3.c -O0 execution test
+#3906478: gcc.dg/vmx/darwin-abi-3.c -O1 execution test
+#3906478: gcc.dg/vmx/darwin-abi-3.c -O2 execution test
+#3906478: gcc.dg/vmx/darwin-abi-3.c -O3 -fomit-frame-pointer execution test
+#3906478: gcc.dg/vmx/darwin-abi-3.c -O3 -g execution test
+#3906478: gcc.dg/vmx/darwin-abi-3.c -Os execution test
+#3906478: gcc.dg/vmx/darwin-abi-3.c -fast execution test
+3906482: gcc.dg/cpp/trad/comment-3.c (test for warnings, line 6)
+#3907006: gcc.dg/tree-ssa/20040308-4.c scan-tree-dump-times straightline 1
+#3907012: gcc.dg/vect/vect-30.c execution test
+#3907012: gcc.dg/vect/vect-8.c execution test
+3961392: gcc.dg/ppc-fsel-3.c scan-assembler-not fsub
+3965499: gcc.dg/cpp/headermap-2.c (test for warnings, line 8)
+3965499: gcc.dg/cpp/headermap-2.c (test for excess errors)
diff --git a/gcc/testsuite/bugs/powerpc/obj-c++.xfail b/gcc/testsuite/bugs/powerpc/obj-c++.xfail
new file mode 100644
index 00000000000..90675d4f7fa
--- /dev/null
+++ b/gcc/testsuite/bugs/powerpc/obj-c++.xfail
@@ -0,0 +1,15 @@
+# APPLE LOCAL file testsuite
+###
+### List of failing tests with Radar bug numbers
+### <radarNum>: <test name>
+### test name should be exactly as it appears html summary reports
+### including any trailing #<number>
+###
+### When the bug is fixed and the test passes, it will be an
+### analyzed non-fail. You should then comment out the test in this
+### file and make sure the Radar is closed.
+###
+###------------------------------------------------------------------
+#3863563: obj-c++.dg/basic.mm (test for excess errors)
+#3869273: obj-c++.dg/cxx-ivars-2.mm execution test
+#3869280: obj-c++.dg/template-4.mm (test for excess errors)
diff --git a/gcc/testsuite/bugs/powerpc/objc.xfail b/gcc/testsuite/bugs/powerpc/objc.xfail
new file mode 100644
index 00000000000..d199db27aae
--- /dev/null
+++ b/gcc/testsuite/bugs/powerpc/objc.xfail
@@ -0,0 +1,52 @@
+# APPLE LOCAL file testsuite
+###
+### List of failing tests with Radar bug numbers
+### <radarNum>: <test name>
+### test name should be exactly as it appears html summary reports
+### including any trailing #<number>
+###
+### When the bug is fixed and the test passes, it will be an
+### analyzed non-fail. You should then comment out the test in this
+### file and make sure the Radar is closed.
+###
+###------------------------------------------------------------------
+#3664851: objc/execute/string1.m compilation, -O0
+#3664851: objc/execute/string1.m compilation, -O1
+#3664851: objc/execute/string1.m compilation, -O2
+#3664851: objc/execute/string1.m compilation, -O3 -fomit-frame-pointer
+#3664851: objc/execute/string1.m compilation, -O3 -g
+#3664851: objc/execute/string1.m compilation, -Os
+#3664851: objc/execute/string1.m compilation, -fast
+#3664851: objc/execute/string2.m compilation, -O0
+#3664851: objc/execute/string2.m compilation, -O1
+#3664851: objc/execute/string2.m compilation, -O2
+#3664851: objc/execute/string2.m compilation, -O3 -fomit-frame-pointer
+#3664851: objc/execute/string2.m compilation, -O3 -g
+#3664851: objc/execute/string2.m compilation, -Os
+#3664851: objc/execute/string2.m compilation, -fast
+#3664851: objc/execute/string3.m compilation, -O0
+#3664851: objc/execute/string3.m compilation, -O1
+#3664851: objc/execute/string3.m compilation, -O2
+#3664851: objc/execute/string3.m compilation, -O3 -fomit-frame-pointer
+#3664851: objc/execute/string3.m compilation, -O3 -g
+#3664851: objc/execute/string3.m compilation, -Os
+#3664851: objc/execute/string3.m compilation, -fast
+#3664851: objc/execute/string4.m compilation, -O0
+#3664851: objc/execute/string4.m compilation, -O1
+#3664851: objc/execute/string4.m compilation, -O2
+#3664851: objc/execute/string4.m compilation, -O3 -fomit-frame-pointer
+#3664851: objc/execute/string4.m compilation, -O3 -g
+#3664851: objc/execute/string4.m compilation, -Os
+#3664851: objc/execute/string4.m compilation, -fast
+#3664999: objc.dg/const-cfstring-1.m execution test
+#3665002: objc.dg/const-str-3.m (test for excess errors)
+#3665002: objc.dg/const-str-4.m (test for excess errors)
+#3691708: objc.dg/const-str-3.m execution test
+#3691708: objc.dg/const-str-4.m execution test
+#3753413: objc.dg/const-cfstring-1.m (test for excess errors)
+#3753413: objc.dg/const-cfstring-2.m (test for warnings, line 21)
+#3753413: objc.dg/const-cfstring-2.m (test for warnings, line 22)
+#3753413: objc.dg/const-cfstring-2.m (test for warnings, line 24)
+#3753413: objc.dg/const-cfstring-2.m (test for warnings, line 25)
+#3753413: objc.dg/const-cfstring-2.m (test for excess errors)
+#3753413: objc.dg/const-str-5.m (test for excess errors)
diff --git a/gcc/testsuite/g++.dg/align-test-1.C b/gcc/testsuite/g++.dg/align-test-1.C
new file mode 100644
index 00000000000..e0cdb68c851
--- /dev/null
+++ b/gcc/testsuite/g++.dg/align-test-1.C
@@ -0,0 +1,295 @@
+/* APPLE LOCAL file Macintosh alignment */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-long-long -Wno-invalid-offsetof" } */
+
+/*
+ * Macintosh compiler alignment test for C++.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ */
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+extern "C" void abort (void);
+
+#define Q(x) #x, x
+
+typedef unsigned char UINT8;
+typedef unsigned short UINT16;
+typedef unsigned long UINT32;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+/* === classes === */
+
+class C1 {
+ static const int f1 = 1;
+ UINT8 f2;
+};
+
+class C2 {
+ static int f1;
+ UINT8 f2;
+};
+
+class C3 {
+ public:
+ enum E1 {
+ f1 = 1
+ };
+ protected:
+ UINT8 f2;
+};
+
+class C4 {
+ UINT8 f1;
+ static const int f2 = 1;
+};
+
+class C5 {
+ UINT8 f2;
+ static int f1;
+};
+
+class C6 {
+ UINT8 f1;
+ enum E1 {
+ f2 = 1
+ };
+};
+
+class C7 {
+ /* empty base class */
+};
+
+#ifndef __LP64__
+#pragma options align=mac68k
+
+class C8 {
+ /* empty base class */
+};
+
+class C9: public C8 {
+ public:
+ UINT8 f1;
+};
+
+#pragma options align=reset
+#endif /* n __LP64 __ */
+
+/* What is offset of first field after an empty base class? */
+class C10: public C7 {
+ public:
+ UINT8 f1;
+};
+
+/* Check that we no longer try to put derived class bits in padding at end of base class. */
+class C11 {
+ public:
+ UINT32 f1;
+ UINT8 f2;
+};
+
+class C12: public C11 {
+ public:
+ UINT8 f3;
+};
+
+/* Check whether compiler will reorder members to take advantage of
+ padding. If the compiler did this (which it does not appear to
+ do), f3 and f4 in C14 would be reordered to take advantage of the
+ padding at the end of the base class. */
+class C13 {
+ public:
+ UINT32 f1;
+ UINT16 f2;
+};
+
+class C14: public C13 {
+ public:
+ UINT32 f3;
+ UINT16 f4;
+};
+
+/* Tests for double aligned base class */
+
+class C15 {
+ public:
+ double f1;
+ long f2;
+};
+
+class C16: public C15 {
+};
+
+class C17: public C15 {
+ public:
+ long f3;
+};
+
+class C18: public C16 {
+ public:
+ char f3;
+};
+
+class C19: public C17 {
+ public:
+ char f4;
+};
+
+/* Tests for alignment in class with v-table pointer */
+
+class C20 {
+ public:
+ double f1;
+ virtual void func1(void);
+};
+
+/* === vectors === */
+
+#ifdef __VEC__
+class VC1 {
+ public:
+ vector signed short f1;
+ UINT8 f2;
+};
+
+typedef struct VS1 {
+ VC1 f1;
+ UINT8 f2;
+} VS1;
+
+class VC2: public VC1 {
+ public:
+ UINT8 f1;
+};
+
+typedef struct VS2 {
+ UINT8 f1;
+ VC2 f2;
+ UINT8 f3;
+} VS2;
+
+class VC3 {
+ public:
+ vector signed short f1;
+ virtual void func1(void);
+};
+
+#endif
+
+/* === bools === */
+
+typedef struct B1 {
+ bool f1;
+ UINT8 f2;
+} B1;
+
+typedef struct B2 {
+ UINT8 f1;
+ bool f2;
+} B2;
+
+
+static void check(char * rec_name, int actual, int expected32, int expected64,
+ int expected_ia32, char * comment)
+{
+ int expected;
+#ifdef __i386__
+ expected = expected_ia32;
+#else
+ expected = ((sizeof(char *) == 8) ? expected64 : expected32);
+#endif
+ if (flag_verbose || (actual != expected)) {
+ printf("%-20s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+ check(Q(sizeof(C1)), 1, 1, 1, "const as 1st field");
+ check(Q(sizeof(C2)), 1, 1, 1, "static as 1st field");
+ check(Q(sizeof(C3)), 1, 1, 1, "enum as 1st field");
+ check(Q(sizeof(C4)), 1, 1, 1, "const as 2nd field");
+ check(Q(sizeof(C5)), 1, 1, 1, "static as 2nd field");
+ check(Q(sizeof(C6)), 1, 1, 1, "enum as 2nd field");
+ check(Q(sizeof(C7)), 1, 1, 1, "empty class, power mode");
+#ifndef __LP64__
+ check(Q(sizeof(C8)), 2, 2, 2, "empty class, mac68k mode");
+ check(Q(sizeof(C9)), 2, 2, 2, "class with empty base class and one char, mac68k");
+ check(Q(offsetof(C9, f1)), 0, 0, 0, "offset of 1st field after empty base class");
+#endif
+ check(Q(sizeof(C10)), 1, 1, 1, "class based on an empty class, power mode");
+ check(Q(sizeof(C11)), 8, 16, 8, "class with long, char");
+ check(Q(sizeof(C12)), 12, 24, 12, "class with base class with long, char and its own char");
+ check(Q(offsetof(C12, f3)), 8, 16, 8, "offset of 1st field in class with a base class with a long, char");
+ check(Q(sizeof(C13)), 8, 16, 8, "class with long, short");
+ check(Q(sizeof(C14)), 16, 32, 16, "derived class with short, long");
+ check(Q(offsetof(C14, f3)), 8, 16, 8, "offset of 1st field after base class with padding");
+ check(Q(offsetof(C14, f4)), 12, 24, 12, "offset of 2nd field after base class with padding");
+
+ check(Q(sizeof(C15)), 16, 16, 12, "base class with double, long");
+ check(Q(sizeof(C16)), 16, 16, 12, "empty derived class with base with double, long");
+ check(Q(sizeof(C17)), 24, 24, 16, "derived class with base with double, long and its own long");
+ check(Q(sizeof(C18)), 20, 24, 16, "derived class based on empty derived class with base with double, long");
+ check(Q(sizeof(C19)), 24, 32, 20, "derived class based on derived class with base with double, long and its own long");
+ check(Q(sizeof(C20)), 12, 16, 12, "class with double and v-table ptr");
+ check(Q(offsetof(C20, f1)), 4, 8, 4, "offset of double 1st field in class with v-table ptr");
+
+ /* Vector tests */
+#ifdef __VEC__
+ check(Q(sizeof(VC1)), 32, 32, 32, "class with vector as 1st field");
+ check(Q(sizeof(VS1)), 48, 48, 48, "struct with a class with a vector as 1st field");
+ check(Q(sizeof(VC2)), 48, 48, 48, "class with base class containing a vector");
+ check(Q(offsetof(VC2, f1)), 32, 32, 32, "offset of 1st field after base class with vector, char, and padding");
+ check(Q(sizeof(VS2)), 80, 80, 80, "struct with a char, class with a vector, char");
+ check(Q(offsetof(VS2, f2)), 16, 16, 16, "offset of class with a vector in a struct with char, class...");
+ check(Q(offsetof(VS2, f3)), 64, 64, 64, "offset of 2nd char in a struct with char, class, char");
+ check(Q(sizeof(VC3)), 32, 32, 32, "class with a vector and v-table ptr");
+ check(Q(offsetof(VC3, f1)), 16, 16, 16, "offset vector in class with a vector and v-table ptr");
+#endif
+
+ /* bool tests */
+ check(Q(sizeof(bool)), 4, 1, 1, "bool data type");
+ check(Q(sizeof(B1)), 8, 2, 2, "struct with bool, char");
+ check(Q(sizeof(B2)), 8, 2, 2, "struct with char, bool");
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/altivec-1.C b/gcc/testsuite/g++.dg/altivec-1.C
new file mode 100644
index 00000000000..6bda7094db0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/altivec-1.C
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file AltiVec */
+/* Test for static_cast<...> among AltiVec types. */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+struct Foo2 {
+ vector unsigned int vui;
+ vector signed int As_vsi() {
+ return static_cast<vector signed int>(vui); /* { dg-bogus "invalid static_cast" } */
+ }
+};
+
diff --git a/gcc/testsuite/g++.dg/altivec-2.C b/gcc/testsuite/g++.dg/altivec-2.C
new file mode 100644
index 00000000000..0b2f3751a24
--- /dev/null
+++ b/gcc/testsuite/g++.dg/altivec-2.C
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file AltiVec */
+/* Test for distinguishing 'vector bool ...' from 'vector unsigned ...'
+ types by the front-end. */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+struct Foo1 {
+ void foo(vector unsigned char) { }
+ void foo(vector bool char) { } /* { dg-bogus "has already been declared" } */
+ void bar(vector unsigned short) { }
+ void bar(vector bool short) { } /* { dg-bogus "has already been declared" } */
+ void baz(vector unsigned int) { }
+ void baz(vector bool int) { } /* { dg-bogus "has already been declared" } */
+};
+
diff --git a/gcc/testsuite/g++.dg/altivec-3.C b/gcc/testsuite/g++.dg/altivec-3.C
new file mode 100644
index 00000000000..77084a1d824
--- /dev/null
+++ b/gcc/testsuite/g++.dg/altivec-3.C
@@ -0,0 +1,21 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec -Wall" } */
+
+/* This test checks if AltiVec builtins accept const-qualified
+ arguments. */
+
+int main (int argc, const char * argv[])
+{
+ int i;
+ const float cf = 1.0;
+ vector float v;
+ const vector float cv = (vector float)(1.0, 2.0, 3.0, 4.0);
+
+ vec_dst(&cv, i, 0);
+ v = vec_ld(0, &cv);
+ v = vec_lde(0, &cf);
+ vec_lvsl(0, &cf);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/altivec-4.C b/gcc/testsuite/g++.dg/altivec-4.C
new file mode 100644
index 00000000000..63eb1d5c379
--- /dev/null
+++ b/gcc/testsuite/g++.dg/altivec-4.C
@@ -0,0 +1,129 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec -maltivec" } */
+
+/* Test for correct handling of AltiVec constants passed
+ through '...' (va_arg). */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define CHECK_INVARIANT(expr) \
+ if (!(expr)) { \
+ printf ("ASSERT FAILED: %d: %s\n", __LINE__, #expr); \
+ abort (); \
+ }
+
+struct foo { int x; int y; };
+struct vfoo { int x; __vector signed int v; int y; };
+union u { __vector signed int v; signed int i[4]; };
+
+struct foo x_g = { 3, 4};
+struct vfoo vx_g = { 10, (vector signed int)(11, 12, 13, 14), 15 };
+__vector signed int v_g = (vector signed int) (22, 23, 24, 25);
+struct vfoo vx2_g = { 30, (vector signed int)(31, 32, 33, 34), 35 };
+__vector signed int v2_g = (vector signed int)(40, 41, 42, 43);
+int i_1 = 99, i_2 = 33;
+double d_2 = 1.5, d_3 = 1.75;
+long double ld_1 = 1.25;
+
+void bar (int i, ... )
+{
+ struct foo xi;
+ double d;
+ long double ld;
+ float f;
+ char c;
+ short s;
+ va_list ap;
+ va_start(ap, i);
+ xi = va_arg(ap, struct foo);
+ s = (short)va_arg(ap, int);
+ f = (float)va_arg(ap, double);
+ ld = va_arg(ap, long double);
+ c = (char)va_arg(ap, int);
+ d = va_arg(ap, double);
+ va_end(ap);
+
+ CHECK_INVARIANT (xi.x == x_g.x && xi.y == x_g.y);
+ CHECK_INVARIANT (s == (short)i_2);
+ CHECK_INVARIANT (f == (float)d_2);
+ CHECK_INVARIANT (ld == ld_1);
+ CHECK_INVARIANT (c == (char)i_1);
+ CHECK_INVARIANT (d == d_3);
+}
+
+void baz (int i, ... )
+{
+ struct vfoo vx, vx2;
+ __vector signed int v_i, v2_i;
+ int j, k, l;
+ va_list ap;
+ va_start(ap, i);
+ v_i = va_arg(ap, __vector signed int); /* { dg-bogus "non-POD type" } */
+ j = va_arg(ap, int);
+ vx = va_arg(ap, struct vfoo); /* { dg-bogus "non-POD type" } */
+ k = va_arg(ap, int);
+ v2_i = va_arg(ap, __vector signed int); /* { dg-bogus "non-POD type" } */
+ l = va_arg(ap, int);
+ vx2 = va_arg(ap, struct vfoo); /* { dg-bogus "non-POD type" } */
+ va_end(ap);
+
+ CHECK_INVARIANT (vec_all_eq (v_i, v_g));
+ CHECK_INVARIANT (j == i_1);
+ CHECK_INVARIANT (vx.x == vx_g.x && vec_all_eq(vx.v, vx_g.v) && vx.y == vx_g.y);
+ CHECK_INVARIANT (k == i_1);
+ CHECK_INVARIANT (vec_all_eq (v2_i, v2_g));
+ CHECK_INVARIANT (l == i_1);
+ CHECK_INVARIANT (vx2.x == vx2_g.x && vec_all_eq(vx2.v, vx2_g.v) && vx2.y == vx2_g.y);
+}
+
+void quux (int i, ... )
+{
+ __vector signed int v_i, v2_i;
+ union u vi, v2i;
+ va_list ap;
+ va_start(ap, i);
+ v_i = va_arg(ap, __vector signed int);
+ v2_i = va_arg(ap, __vector signed int);
+ va_end(ap);
+ vi.v = v_i;
+ v2i.v = v2_i;
+
+ CHECK_INVARIANT (vec_all_eq (v_i, v_g));
+ CHECK_INVARIANT (vec_all_eq (v2_i, v_g));
+ CHECK_INVARIANT (vec_all_eq (vi.v, v_g));
+ CHECK_INVARIANT (vec_all_eq (v2i.v, v_g));
+}
+
+void baz2 (int i, ... )
+{
+ struct vfoo vx;
+ union u vxi;
+ va_list ap;
+ va_start(ap, i);
+ vx = va_arg(ap, struct vfoo);
+ va_end(ap);
+ vxi.v = vx.v;
+
+ CHECK_INVARIANT (vx.x == vx_g.x && vec_all_eq(vx.v, vx_g.v) && vx.y == vx_g.y);
+ CHECK_INVARIANT (vec_all_eq (vxi.v, vx_g.v));
+}
+
+int main(void)
+{
+ CHECK_INVARIANT (sizeof(struct foo) == 8 && sizeof(struct vfoo) == 48);
+
+ bar(i_1, x_g, (short)i_2, (float)d_2, ld_1, (char)i_1, d_3);
+ baz(i_1, v_g, /* { dg-bogus "non-POD type" "" { target *-*-* } 122 } */
+ i_1, vx_g, /* { dg-bogus "non-POD type" "" { target *-*-* } 122 } */
+ i_1, v2_g, /* { dg-bogus "non-POD type" "" { target *-*-* } 122 } */
+ i_1, vx2_g); /* { dg-bogus "non-POD type" } */
+ quux(i_1, v_g, /* { dg-bogus "non-POD type" "" { target *-*-* } 124 } */
+ v_g); /* { dg-bogus "non-POD type" } */
+ baz2(i_1, vx_g); /* { dg-bogus "non-POD type" } */
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/altivec-5.C b/gcc/testsuite/g++.dg/altivec-5.C
new file mode 100644
index 00000000000..9cfa64470d6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/altivec-5.C
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file AltiVec */
+/* Test for AltiVec type overloading. */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+ void foo(vector unsigned char) { }
+ void foo(vector signed char) { }
+ void foo(vector bool char) { }
+ void foo(vector unsigned short) { }
+ void foo(vector signed short) { }
+ void foo(vector bool short) { }
+ void foo(vector unsigned int) { }
+ void foo(vector signed int) { }
+ void foo(vector bool int) { }
+ void foo(vector float) { }
+ void foo(vector pixel) { }
+ void foo(int) { }
+ void foo(unsigned int) { }
+ void foo(float) { }
+ void foo(bool) { }
diff --git a/gcc/testsuite/g++.dg/altivec-7.C b/gcc/testsuite/g++.dg/altivec-7.C
new file mode 100644
index 00000000000..74467361dd9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/altivec-7.C
@@ -0,0 +1,66 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+
+extern "C" void abort(void);
+
+void CMP (vector unsigned char v, vector unsigned char v1)
+{
+ union {
+ vector unsigned char vv;
+ unsigned char s[16];
+ } r, r1;
+ r.vv = v;
+ r1.vv = v1;
+
+ for (int i=0; i < 16; i++)
+ if (r.s[i] != r1.s[i])
+ abort();
+ return;
+}
+
+#define TEST_FUNCTION_TEMPLATE
+
+#ifdef TEST_FUNCTION_TEMPLATE
+template <int I>
+#endif
+void vectorTest()
+{
+ typedef vector unsigned char VUC;
+
+ // Multiple initializers with expressions
+ const unsigned char kFoo = 0;
+ enum { kBar = 1 };
+ VUC v1 = {kFoo,kBar,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ VUC v3 = (VUC)(kFoo,kBar,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
+ CMP (v1, v3);
+
+ VUC v2 = {kBar*kFoo,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
+ VUC v4 = (VUC)(kBar*kFoo,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15);
+ CMP (v2, v4);
+
+ // Single initializers
+ VUC v5 = {42};
+ VUC v7 = (VUC)(42);
+ CMP (v5, v7);
+
+ VUC v6 = {40+2};
+ VUC v8 = (VUC)(40+2);
+ CMP (v6, v8);
+
+ VUC v9 = {I+5};
+ VUC v11 = (VUC)(I+5);
+ CMP (v9, v11);
+}
+
+
+int main (int argc, char * const argv[])
+{
+#ifdef TEST_FUNCTION_TEMPLATE
+ vectorTest<0>();
+#else
+ vectorTest();
+#endif
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/altivec-8.C b/gcc/testsuite/g++.dg/altivec-8.C
new file mode 100644
index 00000000000..5e6b75c1b62
--- /dev/null
+++ b/gcc/testsuite/g++.dg/altivec-8.C
@@ -0,0 +1,31 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+extern "C" void abort();
+
+void check_eq (vector signed short v1, vector signed short v2)
+{
+ if (!vec_all_eq (v1, v2))
+ abort();
+ return;
+}
+
+int main()
+{
+ int r;
+
+ vector signed short vboundary[8] = {
+ (vector signed short)(0),
+ (vector signed short)(1),
+ (vector signed short)(2),
+ (vector signed short)(3),
+ (vector signed short)(4),
+ (vector signed short)(5),
+ (vector signed short)(6),
+ (vector signed short)(7)
+ };
+ for (r = 0; r < 8; r++)
+ check_eq (vboundary[r], (vector signed short)(r,r,r,r,r,r,r,r));
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/apple-altivec-1.C b/gcc/testsuite/g++.dg/apple-altivec-1.C
new file mode 100644
index 00000000000..c070de43f6c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/apple-altivec-1.C
@@ -0,0 +1,9 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+void foo() {
+ vector bool int boolVector = (vector bool int) vec_splat_u32(3);
+ boolVector = vec_sld( boolVector, boolVector,
+ 1 ); /* { dg-bogus "no instance of overloaded" } */
+}
diff --git a/gcc/testsuite/g++.dg/apple-altivec-2.C b/gcc/testsuite/g++.dg/apple-altivec-2.C
new file mode 100644
index 00000000000..4e6d70b483b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/apple-altivec-2.C
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+extern "C" void abort (void);
+
+int main()
+{
+ vector float tiny = (vector float) ((vector unsigned int) (0x00800000, 0xBF800000, 0x3E800000, 0));
+ unsigned int af[4] = {
+ (unsigned int)(unsigned int)0x00800000,
+ (unsigned int)(unsigned int)0xBF800000,
+ (unsigned int)(unsigned int)0x3E800000,
+ (unsigned int)(unsigned int)0};
+
+ union u {
+ vector float vf;
+ unsigned int ai[4];
+ }vu;
+ int i;
+
+ vu.vf = tiny;
+
+ for (i=0; i < 4; i++)
+ if (af[i] != vu.ai[i])
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/apple-altivec-6.C b/gcc/testsuite/g++.dg/apple-altivec-6.C
new file mode 100644
index 00000000000..90c2d48abe1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/apple-altivec-6.C
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec -pedantic" } */
+
+int main()
+ {
+ typedef unsigned char UC;
+ typedef vector unsigned char VUC;
+
+ const UC kBar = 7;
+ VUC vBar1 = (VUC)(kBar);
+ VUC vBar2 = {kBar};
+ VUC vBar3 = (VUC){kBar};
+ return 0;
+ }
diff --git a/gcc/testsuite/g++.dg/apple-altivec-test.C b/gcc/testsuite/g++.dg/apple-altivec-test.C
new file mode 100644
index 00000000000..723ed86006d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/apple-altivec-test.C
@@ -0,0 +1,57 @@
+/* APPLE LOCAL file */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+extern "C" void abort();
+
+class Star
+{
+ public:
+ inline vector float foo() const;
+
+ Star()
+ {
+ data.f[0] = 1.0; data.f[1] = 2.0; data.f[2] = 3.0, data.f[3] = 4.0;
+ }
+
+ private:
+ union {
+ float f[4];
+ vector float v;
+ } data;
+
+ friend vector float fTest(const Star &);
+};
+
+vector float Star::foo() const
+{
+ return data.v;
+}
+
+vector float fTest(const Star & val)
+{
+ vector float vf = val.foo();
+ return vf;
+}
+
+int main() {
+
+ Star s;
+
+ union u {
+ float f[4];
+ vector float v;
+ } data;
+
+ data.v = fTest(s);
+ for (int i=0 ; i < 4; i++)
+ if (data.f[i] != (float)(i+1))
+ abort();
+ return 0;
+}
+
+
+
+
diff --git a/gcc/testsuite/g++.dg/asm-block-1.C b/gcc/testsuite/g++.dg/asm-block-1.C
new file mode 100644
index 00000000000..63446417a12
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-block-1.C
@@ -0,0 +1,75 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test asm-syntax blocks within functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+extern "C" void abort (void);
+
+int
+foo (int argx, int argy)
+{
+ register int locx = argx, locy = argy, rslt;
+ asm {
+ add rslt,locx,locy
+ }
+ return rslt;
+}
+
+/* Exercise corners of syntax. */
+
+int
+bar ()
+{
+ register int rslt = 100;
+ asm {
+ // Combos of instructions on a line
+
+ nop
+ ;
+ nop
+ nop ;
+ ; nop
+ nop ; nop
+ ; nop ;;; li r3,95 ; nop ;
+ // '.' in an opcode
+ add. r6,r6,r5
+ }
+ return rslt;
+}
+
+int baz ()
+{
+ register int rslt = 1;
+ asm {
+ li r8,29+(2 * 3);
+ add rslt,rslt,r8;
+ b @192
+ @34
+ nop
+ ble+ @34
+ b forward
+ abc:
+ b abc
+ @abc:
+ b @abc
+ forward: ; @192:
+ nop
+ ;
+ sameline: nop
+ x1: @x2 @x3: nop ; @x4 x5:
+ }
+ return rslt;
+}
+
+int
+main ()
+{
+ if (foo (22, 23) != 45)
+ abort ();
+ if (bar () != 100)
+ abort ();
+ if (baz () != 36)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/asm-block-2.C b/gcc/testsuite/g++.dg/asm-block-2.C
new file mode 100644
index 00000000000..6248c2dcc63
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-block-2.C
@@ -0,0 +1,101 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test structure refs in asm-syntax blocks within functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+extern "C" void abort(void);
+
+typedef struct astruct {
+ int arr[40];
+ char charfield;
+ int fieldx;
+} atypedef;
+
+union aunion {
+ int field1;
+ int field2;
+};
+
+class aclass {
+ public:
+ double headfield;
+ int intfield;
+};
+
+int fun1 (struct astruct *x)
+{
+ int loc;
+ asm {
+ lwz loc, astruct.fieldx(x)
+ addi loc, loc, 42
+ }
+ return loc;
+}
+
+int fun2 (atypedef *x)
+{
+ int loc;
+
+ asm {
+ lwz loc, atypedef.fieldx(r3)
+ addi loc, loc, 43
+ }
+ return loc;
+}
+
+int fun3(int arg)
+{
+ int loc;
+
+ asm {
+ mr loc, r3
+ addi loc, loc, aunion.field1
+ }
+ return loc;
+}
+
+int fun4 (struct astruct *arg)
+{
+ int loc;
+ asm {
+ lbz loc, arg->charfield
+ addi loc, loc, 1
+ }
+ return loc;
+}
+
+int fun5 (aclass *x)
+{
+ int loc;
+ asm {
+ lwz loc, aclass.intfield(x)
+ addi loc, loc, 95
+ }
+ return loc;
+}
+
+struct astruct glob;
+union uglob;
+
+int
+main ()
+{
+ aclass *localobj = new aclass;
+
+ glob.charfield = 'b';
+ glob.fieldx = 22;
+ if (fun1 (&glob) != 64)
+ abort ();
+ if (fun2 (&glob) != 65)
+ abort ();
+ if (fun3 (89) != 89)
+ abort ();
+ if (fun4 (&glob) != 'c')
+ abort ();
+ localobj->intfield = 55;
+ if (fun5 (localobj) != 150)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/asm-block-3.C b/gcc/testsuite/g++.dg/asm-block-3.C
new file mode 100644
index 00000000000..b7fa0fe475a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-block-3.C
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test C++ keywords in asm-syntax blocks within functions. */
+
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+void
+bar ()
+{
+ register unsigned int theColor;
+ register unsigned char bbb;
+ asm {and++ bbb,theColor,24; };
+ asm {and bbb,theColor,24; };
+ asm {and_eq bbb,theColor,24; };
+ asm {bitand bbb,theColor,24; };
+ asm {bitor bbb,theColor,24; };
+ asm {compl bbb,theColor,24; };
+ asm {not bbb,theColor,24; };
+ asm {not_eq bbb,theColor,24; };
+ asm {or bbb,theColor,24; };
+ asm {or_eq bbb,theColor,24; };
+ asm {xor bbb,theColor,24; };
+ asm {xor_eq bbb,theColor,24; };
+}
diff --git a/gcc/testsuite/g++.dg/asm-block-4.C b/gcc/testsuite/g++.dg/asm-block-4.C
new file mode 100644
index 00000000000..75886faa038
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-block-4.C
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test C++ keywords that are binary operators in asm-syntax blocks within functions. */
+
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+int baz (int arg1) {
+ asm {
+ mr r2, arg1
+ add r3, r2, r2
+ and r3, arg1, r3
+ }
+}
diff --git a/gcc/testsuite/g++.dg/asm-function-1.C b/gcc/testsuite/g++.dg/asm-function-1.C
new file mode 100644
index 00000000000..c546c1f0dde
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-1.C
@@ -0,0 +1,39 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test whole asm functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+extern "C" void abort (void);
+
+asm int
+foo (register int argx, register int argy)
+{
+ add r3, argx, argy
+}
+
+#define rsltreg r3
+
+asm int
+foo1 (register int argx, register int argy)
+{ register int loc1, loc2;
+ nop
+ li loc1, 100
+ li rsltreg,0
+ b @a34
+ add rsltreg, argx, argy
+@a34
+ add rsltreg, rsltreg, loc1
+ blr
+}
+
+int
+main ()
+{
+ if (foo (22, 23) != 45)
+ abort ();
+ if (foo1 (1, 2) != 100)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/asm-function-10.C b/gcc/testsuite/g++.dg/asm-function-10.C
new file mode 100644
index 00000000000..c3ebc52bf65
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-10.C
@@ -0,0 +1,21 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+struct tDummyStruct
+{
+ unsigned long fDummy;
+ unsigned long fSample;
+};
+
+asm void foo()
+{
+ lwzu r1,(sizeof(tDummyStruct))(r2) // works
+ lwzu r1,sizeof(tDummyStruct)(r2)
+}
+
+int main (int argc, char * const argv[])
+{
+ foo();
+}
+
diff --git a/gcc/testsuite/g++.dg/asm-function-11.C b/gcc/testsuite/g++.dg/asm-function-11.C
new file mode 100644
index 00000000000..c46d4c5a292
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-11.C
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+struct tDummyStruct
+{
+ unsigned long fDummy;
+ unsigned long fSample;
+};
+
+asm void foo()
+{
+ lwz r1,-8+tDummyStruct.fSample(r2)
+ stw r1,-8+tDummyStruct.fSample(r2)
+ lwz r1,-8-(tDummyStruct.fSample-tDummyStruct.fDummy)(r2)
+ stw r1,-8-(tDummyStruct.fSample-tDummyStruct.fDummy)(r2)
+}
+
+int main (int argc, char * const argv[])
+{
+ foo();
+}
+
+
diff --git a/gcc/testsuite/g++.dg/asm-function-12.C b/gcc/testsuite/g++.dg/asm-function-12.C
new file mode 100644
index 00000000000..c518550fcdd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-12.C
@@ -0,0 +1,18 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+asm void foo()
+{
+ b .+8
+ bl .+24
+ b .-8
+ bl .-32
+ andi. r1, r0, 3
+}
+
+int main (int argc, char * const argv[])
+{
+ foo();
+}
+
diff --git a/gcc/testsuite/g++.dg/asm-function-13.C b/gcc/testsuite/g++.dg/asm-function-13.C
new file mode 100644
index 00000000000..ace3cba12ef
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-13.C
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+asm void foo()
+{
+ .align 15
+ andi. r1,r2, 3
+ .align 10
+ b .+8
+ .align 4
+ b .-16
+ .align 3
+ lha r1, 4(r3)
+ .align 4
+ add r1,r2,r3
+ .align 3
+ .align 4
+}
+
+int main (int argc, char * const argv[])
+{
+ foo();
+}
+
+
diff --git a/gcc/testsuite/g++.dg/asm-function-2.C b/gcc/testsuite/g++.dg/asm-function-2.C
new file mode 100644
index 00000000000..87f46a6b787
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-2.C
@@ -0,0 +1,75 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test whole asm functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+extern "C" void abort(void);
+
+asm void normal_fn ()
+{
+ nop
+ nop
+}
+
+asm void nofralloc_fn ()
+{
+ nofralloc
+ nop
+ blr
+}
+
+asm void fralloc_fn ()
+{
+ fralloc
+ nop
+ nop
+}
+
+asm int fralloc_fn_1 ()
+{
+ fralloc
+ mr r4,r1
+ frfree
+ sub r3,r4,r1
+ blr
+}
+
+asm int fralloc_fn_2 ()
+{
+ fralloc 1000
+ nop
+ frfree
+ blr
+}
+
+asm int fralloc_fn_3 ()
+{
+ int loc1, loc2;
+ fralloc 41
+ nop
+ mr r3, loc2
+ frfree
+ mr r3, loc1
+ blr
+}
+
+asm int f6 ()
+{
+ opword 0x386004d2 /* li r3,1234 */
+}
+
+main()
+{
+ normal_fn ();
+ nofralloc_fn ();
+ fralloc_fn ();
+ /*
+ fralloc_fn_1 ();
+ fralloc_fn_2 ();
+ fralloc_fn_3 ();
+ */
+ if (f6 () != 1234)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/asm-function-3.C b/gcc/testsuite/g++.dg/asm-function-3.C
new file mode 100644
index 00000000000..8a05a300004
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-3.C
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file CW asm blocks */
+/* More tests of asm functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+extern "C" void abort(void);
+
+/* Return 0 if xer and spr1 both have the same data. */
+
+asm int
+test_spr ()
+{
+ mfspr r5,xer
+ mfspr r4,spr1
+ sub r3,r4,r5
+}
+
+int
+main ()
+{
+ if (test_spr ())
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/asm-function-4.C b/gcc/testsuite/g++.dg/asm-function-4.C
new file mode 100644
index 00000000000..eb1baa76b83
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-4.C
@@ -0,0 +1,62 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test asm with macros. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+extern "C" void abort(void);
+
+#define mac1 add r3, argx, argy
+
+asm int
+foo (register int argx, register int argy)
+{
+ mac1
+}
+
+#define rsltreg r3
+#define mac2(x,y) add rsltreg,x,y
+
+asm int
+foo1 (register int argx, register int argy)
+{
+ register int loc1, loc2;
+ nop
+ li loc1, 100
+ li rsltreg,0
+ b @a34
+ mac2(argx,argy)
+@a34
+ mac2(rsltreg,loc1)
+ blr
+}
+
+#define limac li
+#define num 48
+
+asm int foo2(int x, float y)
+{
+#pragma unused(x)
+#pragma unused(x,y)
+ limac rsltreg, num;
+#define mac3(zzz) \
+ limac r4, zzz
+#pragma unused(y)
+ nop
+ mac3(num)
+#pragma unused(x)
+ add r3,r3,r4
+}
+
+int
+main ()
+{
+ if (foo (22, 23) != 45)
+ abort ();
+ if (foo1 (1, 2) != 100)
+ abort ();
+ if (foo2 (100, 1.2) != 2 * num)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/asm-function-5.C b/gcc/testsuite/g++.dg/asm-function-5.C
new file mode 100644
index 00000000000..f04eb4eed19
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-5.C
@@ -0,0 +1,55 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test function calls in asm functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+void function_with_asm_stmts () {
+ asm ("nop");
+ asm volatile ("nop");
+ __asm__ ("nop");
+ __asm__ __volatile__ ("nop");
+}
+
+extern "C" void abort (void);
+
+int glob = 0;
+
+int other ();
+extern "C" int stubfn ();
+int localfn () { return other (); }
+
+asm void foo(int arg)
+{
+ nofralloc
+ mflr r0
+ stmw r30,(-8)(r1)
+ stw r0,8(r1)
+ stwu r1,(-80)(r1)
+ bl stubfn
+ addi r1,r1,80
+ lwz r0,8(r1)
+ lmw r30,(-8)(r1)
+ mtlr r0
+ b localfn
+}
+
+void bar (int arg)
+{
+ stubfn ();
+ localfn ();
+}
+
+int stubfn () { return other(); }
+
+int other () { return ++glob; }
+
+int main ()
+{
+ bar(34);
+ foo(92);
+ if (glob != 4)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/asm-function-6.C b/gcc/testsuite/g++.dg/asm-function-6.C
new file mode 100644
index 00000000000..0c46c33476c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-6.C
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test entry points in asm functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+#include <stdlib.h>
+
+int entry1(int);
+int entry2(int);
+int entry3(int);
+
+asm int foo(int x)
+{
+ addi x,x,45
+ entry entry1
+ addi x,x,1
+ entry static entry2
+ addi x,x,1
+ entry extern entry3
+ addi x,x,1
+}
+
+int main ()
+{
+ if (entry1(0) != 3)
+ abort();
+ if (entry2(89) != 91)
+ abort();
+ if (entry3(100) != 101)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/asm-function-7.C b/gcc/testsuite/g++.dg/asm-function-7.C
new file mode 100644
index 00000000000..fc877cf5fd8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-7.C
@@ -0,0 +1,17 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test la16(TABLE), lo16(TABLE), and bdnz+. */
+
+/* { dg-do assemble { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+double TABLE[4]={2.0, 1./2., 3., 1.};
+
+asm void SQRT()
+{
+ lis r3,ha16(TABLE)
+ addi r3,r3,lo16(TABLE)
+@cycle:
+ fmul fp6,fp1,fp1
+ bdnz+ @cycle
+ blr
+}
diff --git a/gcc/testsuite/g++.dg/asm-function-8.C b/gcc/testsuite/g++.dg/asm-function-8.C
new file mode 100644
index 00000000000..5101c078628
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-8.C
@@ -0,0 +1,14 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test lo16(foo)(v) and ha16(foo). */
+
+/* { dg-do assemble { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+int foo;
+
+asm int fun1 ()
+{
+ int v;
+ addis v,0,ha16(foo)
+ lwz r3,lo16(foo)(v)
+}
diff --git a/gcc/testsuite/g++.dg/asm-function-9.C b/gcc/testsuite/g++.dg/asm-function-9.C
new file mode 100644
index 00000000000..576390fc1a3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/asm-function-9.C
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test macros with . in the opcode. */
+
+/* { dg-do assemble { target powerpc*-*-darwin* } } */
+/* { dg-options "-fasm-blocks" } */
+
+#define foodef() rlwinm. r4,r4,31,16,31
+
+asm void foo (void)
+{
+ foodef()
+}
diff --git a/gcc/testsuite/g++.dg/const-cfstring-1.C b/gcc/testsuite/g++.dg/const-cfstring-1.C
new file mode 100644
index 00000000000..23bfb0e4ee7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/const-cfstring-1.C
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file constant cfstrings */
+/* Test whether the __builtin__CFStringMakeConstantString
+ "function" fails gracefully when handed a non-constant
+ argument. This will only work on MacOS X 10.1.2 and later. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fconstant-cfstrings" } */
+
+#import <CoreFoundation/CFString.h>
+
+#ifdef __CONSTANT_CFSTRINGS__
+#undef CFSTR
+#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString (STR))
+#endif
+
+extern int cond;
+extern const char *func(void);
+
+int main(void) {
+ CFStringRef s1 = CFSTR("Str1");
+ CFStringRef s2 = CFSTR(cond? "Str2": "Str3"); /* { dg-error "CFString literal expression is not constant" } */
+ CFStringRef s3 = CFSTR(func()); /* { dg-error "CFString literal expression is not constant" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/expr/align68k-1.C b/gcc/testsuite/g++.dg/expr/align68k-1.C
new file mode 100644
index 00000000000..8a89425f1d7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/align68k-1.C
@@ -0,0 +1,53 @@
+// APPLE LOCAL file test of -mdynamic-no-pic combined with 68k alignment
+// Radar 3242139: Positive C++ test case
+// Origin: Matt Austern <austern@apple.com>
+// { dg-do run }
+// { dg-options "-mdynamic-no-pic" }
+
+#ifdef __LP64__
+/* mac68k align not going to be supported for 64-bit, so skip entirely. */
+int main () { return 0; }
+#else
+
+const long val1 = 0xa0b0;
+const long val2 = 0x1234;
+
+#pragma options align=mac68k
+struct X {
+ long x1;
+ long x2;
+};
+
+#pragma options align=reset
+
+void setX(X* x) {
+ x->x1 = val1;
+ x->x2 = val2;
+}
+
+struct Y
+{
+ X field;
+ void set_vals();
+};
+
+void Y::set_vals()
+{
+ ::setX(&field);
+}
+
+int main()
+{
+ Y y;
+ bool ok = true;
+
+ y.field.x1 = y.field.x2 = 0;
+ ok = ok && y.field.x1 == 0 && y.field.x2 == 0;
+
+ y.set_vals();
+ ok = ok && y.field.x1 == val1 && y.field.x2 == val2;
+
+ return !ok;
+}
+
+#endif /* __LP64__ */
diff --git a/gcc/testsuite/g++.dg/expr/align68k-2.C b/gcc/testsuite/g++.dg/expr/align68k-2.C
new file mode 100644
index 00000000000..e0bebacf332
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/align68k-2.C
@@ -0,0 +1,45 @@
+// APPLE LOCAL file test 68k alignment
+// Radar 3313261: Positive C++ test case
+// Origin: Matt Austern <austern@apple.com>
+// { dg-do run }
+
+#ifdef __LP64__
+/* mac68k align not going to be supported for 64-bit, so skip entirely. */
+int main () { return 0; }
+#else
+
+#pragma options align=mac68k
+
+typedef struct PMR {
+ double x;
+ double y;
+}PMR;
+
+#pragma options align=reset
+
+static void GetDouble(double *doubleP)
+{
+ *doubleP = 1.;
+}
+
+static void GetPMR(PMR *p)
+{
+ GetDouble(&p->x);
+ GetDouble(&p->y);
+}
+
+int main(void)
+{
+ PMR tmp;
+ bool ok = true;
+
+ tmp.x = tmp.y = 0;
+ ok = ok && tmp.x == 0.0 && tmp.y == 0.0;
+
+ GetPMR(&tmp);
+ ok = ok && tmp.x == 1.0 && tmp.y == 1.0;
+
+ return !ok;
+}
+
+#endif /* __LP64__ */
diff --git a/gcc/testsuite/g++.dg/expr/cast-ptr-1.C b/gcc/testsuite/g++.dg/expr/cast-ptr-1.C
new file mode 100644
index 00000000000..cb42d13ac48
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/cast-ptr-1.C
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file pointer casts */
+/* Test that casts of pointer to unsigned long long aren't sign extended */
+/* Author: Matt Austern <austern@apple.com> */
+/* { dg-do run } */
+/* { dg-options "-Wno-error -w" } */
+
+int main () {
+ /* Note: test assumes sizeof(long long) >= sizeof(void*) */
+
+ unsigned long x1 = 0x80000000ul;
+ void* p = (void*) x1;
+ unsigned long long x2 = (unsigned long long) p;
+
+ return !(x1 == x2);
+}
diff --git a/gcc/testsuite/g++.dg/expr/fieldref1.C b/gcc/testsuite/g++.dg/expr/fieldref1.C
new file mode 100644
index 00000000000..b04ed137548
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/fieldref1.C
@@ -0,0 +1,23 @@
+// APPLE LOCAL file - test of access to 8-byte struct field
+// Radar 3309305: positive C++ test case
+// Origin: Matt Austern <austern@apple.com>
+// { dg-do run }
+
+struct X {
+ char array[8];
+};
+
+char* get_array(X* p) {
+ char* p2 = p->array;
+ return p2;
+}
+
+int main()
+{
+ X t;
+ X* p = &t;
+ char* p2 = get_array(p);
+
+ bool ok = (void*)p == (void*)p2;
+ return !ok;
+}
diff --git a/gcc/testsuite/g++.dg/ext/altivec-apple-11.C b/gcc/testsuite/g++.dg/ext/altivec-apple-11.C
new file mode 100644
index 00000000000..c5104b2635b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/altivec-apple-11.C
@@ -0,0 +1,18 @@
+/* APPLE LOCAL file AltiVec */
+/* This is a compile-only test for interaction of "-maltivec" and "-save-temps". */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-save-temps -maltivec" } */
+
+#define vector_float vector float
+#define vector_float_foo vector float foo
+#define vector_float_bar_eq vector float bar =
+
+/* NB: Keep the following split across three lines. */
+vector
+int
+a1 = { 100, 200, 300, 400 };
+
+vector_float f1 = { 1.0, 2.0, 3.0, 4.0 };
+vector_float_foo = { 3.0, 4.0, 5.0, 6.0 };
+vector_float_bar_eq { 8.0, 7.0, 6.0, 5.0 };
diff --git a/gcc/testsuite/g++.dg/ext/apple-altivec-1.C b/gcc/testsuite/g++.dg/ext/apple-altivec-1.C
new file mode 100644
index 00000000000..2726c81b3af
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/apple-altivec-1.C
@@ -0,0 +1,43 @@
+/* APPLE LOCAL file AltiVec */
+/* Additional AltiVec PIM argument type combinations. */
+
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec -Wall" } */
+
+vector signed int
+LoadUnalignedSI( signed int *p)
+{
+ vector signed int vload1 = vec_ld( 0, (vector signed int *)p);
+ if ( ((long)p) * 0xF){
+ vector signed int vload2 = vec_ld( 16, (vector signed int *)p);
+ vector unsigned char vperm = vec_ldl( 0, p);
+
+ vload1 = vec_perm(vload1, vload2, vperm);
+ }
+ return vload1;
+}
+
+inline vector float Reciprocal( vector float v )
+{
+
+ vector float estimate = vec_re( v );
+
+ return vec_madd( vec_nmsub( estimate, v, (vector float) (1.0) ), estimate, estimate );
+}
+
+void foo(void) {
+ vector bool char vbc1 = (vector bool char)(255);
+ vector pixel vp1, vp2;
+ vector float vf1, vf2;
+ vector unsigned char vuc1;
+ vector unsigned short vus1, vus2;
+ vector bool short vbs1, vbs2;
+ vector signed short vss1;
+ vector signed int vsi1, vsi2;
+ vbc1 = vec_splat (vbc1, 9);
+ vp2 = vec_splat (vp1, 7);
+ vf1 = vec_splat (vf2, 31);
+ vuc1 = vec_pack (vus1, vus2);
+ vbc1 = vec_pack (vbs1, vbs2);
+ vss1 = vec_pack (vsi1, vsi2);
+}
diff --git a/gcc/testsuite/g++.dg/ext/apple-altivec-2.C b/gcc/testsuite/g++.dg/ext/apple-altivec-2.C
new file mode 100644
index 00000000000..6e3d959bb3d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/apple-altivec-2.C
@@ -0,0 +1,398 @@
+/* APPLE LOCAL file AltiVec */
+/* Check for presence of AltiVec PIM "specific operations". */
+
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec -Wall" } */
+
+vector signed int
+specific_operations( signed int *p)
+{
+ vector unsigned int vui1, vui2;
+ vector unsigned short vus1, vus2;
+ vector unsigned char vuc1, vuc2;
+ vector signed int vsi1, vsi2;
+ vector signed short vss1, vss2;
+ vector signed char vsc1, vsc2;
+ vector bool int vbi1, vbi2;
+ vector bool short vbs1, vbs2;
+ vector bool char vbc1, vbc2;
+ vector float vf1, vf2;
+ vector pixel vp1, vp2;
+
+ vuc1 = vec_lvebx (8, (unsigned char *)p);
+ vss1 = vec_lvehx (4, (short *)p);
+ vf1 = vec_lvewx (2, (float *)p);
+
+ vsi1 = vec_lvx (1, (vector signed int *)p);
+ vp1 = vec_lvxl (16, (vector pixel *)p);
+
+ vec_stvebx (vuc1, 2, (char *)p);
+ vec_stvehx (vp1, 4, (unsigned short *)p);
+ vec_stvewx (vf1, 1, (float *)p);
+
+ vec_stvx (vbi1, 12, (vector int bool *)p);
+ vec_stvxl (vp1, 11, (vector pixel *)p);
+
+ vui1 = vec_vaddcuw (vui1, vui2);
+ vf1 = vec_vaddfp (vf1, vf2);
+
+ vsc1 = vec_vaddsbs (vsc1, vsc2);
+ vss1 = vec_vaddshs (vss1, vss2);
+ vsi1 = vec_vaddsws (vsi1, vsi2);
+ vuc1 = vec_vaddubs (vuc1, vuc2);
+ vus1 = vec_vadduhs (vus1, vus2);
+ vui1 = vec_vadduws (vui1, vui2);
+ vuc1 = vec_vaddubm (vuc1, vuc2);
+ vus1 = vec_vadduhm (vus1, vus2);
+ vui1 = vec_vadduwm (vui1, vui2);
+
+ vsc1 = vec_vand (vsc1, vsc2);
+ vss1 = vec_vandc (vss1, vss2);
+
+ vsc1 = vec_vavgsb (vsc1, vsc2);
+ vss1 = vec_vavgsh (vss1, vss2);
+ vsi1 = vec_vavgsw (vsi1, vsi2);
+ vuc1 = vec_vavgub (vuc1, vuc2);
+ vus1 = vec_vavguh (vus1, vus2);
+ vui1 = vec_vavguw (vui1, vui2);
+
+ vf1 = vec_vcfsx (vsi1, 4);
+ vf2 = vec_vcfux (vui1, 3);
+
+ vsi1 = vec_vcmpbfp (vf1, vf2);
+ vbi1 = vec_vcmpeqfp (vf1, vf2);
+
+ vbc1 = vec_vcmpequb (vuc1, vuc2);
+ vbs2 = vec_vcmpequh (vus1, vus2);
+ vbi1 = vec_vcmpequw (vui1, vui2);
+
+ vbi1 = vec_vcmpgefp (vf1, vf2);
+ vbi2 = vec_vcmpgtfp (vf1, vf2);
+
+ vbc1 = vec_vcmpgtsb (vsc1, vsc2);
+ vbs1 = vec_vcmpgtsh (vss1, vss2);
+ vbi1 = vec_vcmpgtsw (vsi1, vsi2);
+
+ vbc1 = vec_vcmpgtub (vuc1, vuc2);
+ vbs1 = vec_vcmpgtuh (vus1, vus2);
+ vbi1 = vec_vcmpgtuw (vui1, vui2);
+
+ vsi1 = vec_vctsxs (vf1, 22);
+ vui1 = vec_vctuxs (vf2, 30);
+
+ vf2 = vec_vexptefp (vf1);
+ vf1 = vec_vlogefp (vf2);
+ vf2 = vec_vmaddfp (vf1, vf2, vf2);
+
+ vf1 = vec_vmaxfp (vf1, vf2);
+
+ vsc1 = vec_vmaxsb (vsc1, vsc2);
+ vss1 = vec_vmaxsh (vss1, vss2);
+ vsi1 = vec_vmaxsw (vsi1, vsi2);
+ vuc1 = vec_vmaxub (vuc1, vuc2);
+ vus1 = vec_vmaxuh (vus1, vus2);
+ vui1 = vec_vmaxuw (vui1, vui2);
+
+ vbc1 = vec_vmrghb (vbc1, vbc2);
+ vp1 = vec_vmrghh (vp1, vp2);
+ vf2 = vec_vmrghw (vf2, vf1);
+
+ vbc1 = vec_vmrglb (vbc1, vbc2);
+ vp1 = vec_vmrglh (vp1, vp2);
+ vf2 = vec_vmrglw (vf2, vf1);
+
+ vf1 = vec_vminfp (vf1, vf2);
+
+ vsc1 = vec_vminsb (vsc1, vsc2);
+ vss1 = vec_vminsh (vss1, vss2);
+ vsi1 = vec_vminsw (vsi1, vsi2);
+ vuc1 = vec_vminub (vuc1, vuc2);
+ vus1 = vec_vminuh (vus1, vus2);
+ vui1 = vec_vminuw (vui1, vui2);
+
+ vss1 = vec_vmhaddshs (vss1, vss2, vss2);
+ vss2 = vec_vmhraddshs (vss1, vss2, vss2);
+ vus1 = vec_vmladduhm (vus1, vus1, vus2);
+ vui1 = vec_vmsumubm (vuc1, vuc2, vui1);
+ vsi1 = vec_vmsummbm (vsc1, vuc2, vsi1);
+ vsi2 = vec_vmsumshm (vss1, vss2, vsi1);
+ vui1 = vec_vmsumuhm (vus1, vus2, vui2);
+ vui2 = vec_vmsumuhs (vus1, vus2, vui1);
+ vsi2 = vec_vmsumshs (vss1, vss1, vsi2);
+
+ vus1 = vec_vmuleub (vuc1, vuc2);
+ vss1 = vec_vmulesb (vsc1, vsc2);
+ vui1 = vec_vmuleuh (vus1, vus2);
+ vsi1 = vec_vmulesh (vss1, vss2);
+
+ vus2 = vec_vmuloub (vuc1, vuc2);
+ vss2 = vec_vmulosb (vsc1, vsc2);
+ vui2 = vec_vmulouh (vus1, vus2);
+ vsi2 = vec_vmulosh (vss1, vss2);
+
+ vf1 = vec_vnmsubfp (vf1, vf2, vf1);
+
+ vp1 = vec_vnor (vp1, vp2);
+ vf2 = vec_vor (vf2, vbi1);
+ vf2 = vec_vxor (vf2, vbi1);
+
+ vsc1 = vec_vpkuhum (vss1, vss2);
+ vbs1 = vec_vpkuwum (vbi1, vbi2);
+ vp1 = vec_vpkpx (vui1, vui2);
+ vuc1 = vec_vpkuhus (vus1, vus1);
+ vsc1 = vec_vpkshss (vss1, vss2);
+ vus1 = vec_vpkuwus (vui1, vui2);
+ vss2 = vec_vpkswss (vsi1, vsi1);
+ vuc1 = vec_vpkshus (vss1, vss2);
+ vus1 = vec_vpkswus (vsi1, vsi1);
+
+ vp1 = vec_vperm (vp1, vp2, vuc1);
+
+ vf1 = vec_vrefp (vf2);
+ vf2 = vec_vrfin (vf1);
+ vf1 = vec_vrsqrtefp (vf2);
+
+ vuc1 = vec_vrlb (vuc1, vuc2);
+ vss1 = vec_vrlh (vss2, vss1);
+ vui2 = vec_vrlw (vui2, vui1);
+
+ vf1 = vec_vsel (vf2, vf1, vbi1);
+
+ vuc1 = vec_vslb (vuc1, vuc2);
+ vss1 = vec_vslh (vss2, vss1);
+ vui2 = vec_vslw (vui2, vui1);
+
+ vp1 = vec_vsldoi (vp2, vp1, 14);
+ vp2 = vec_vsl (vp1, vuc1);
+ vp1 = vec_vslo (vp2, vuc1);
+
+ vbc1 = vec_vspltb (vbc1, 9);
+ vp2 = vec_vsplth (vp1, 7);
+ vf1 = vec_vspltw (vf2, 31);
+ vsc2 = vec_vspltisb (30);
+ vss1 = vec_vspltish (29);
+ vsi1 = vec_vspltisw (28);
+
+ vuc1 = vec_vsrb (vuc1, vuc2);
+ vss1 = vec_vsrh (vss2, vss1);
+ vui2 = vec_vsrw (vui2, vui1);
+ vuc2 = vec_vsrab (vuc1, vuc2);
+ vss2 = vec_vsrah (vss2, vss1);
+ vui1 = vec_vsraw (vui2, vui1);
+ vp2 = vec_vsr (vp1, vuc1);
+ vp1 = vec_vsro (vp2, vuc1);
+
+ vui1 = vec_vsubcuw (vui1, vui2);
+ vf1 = vec_vsubfp (vf1, vf2);
+
+ vsc1 = vec_vsubsbs (vsc1, vsc2);
+ vss1 = vec_vsubshs (vss1, vss2);
+ vsi1 = vec_vsubsws (vsi1, vsi2);
+ vuc1 = vec_vsububs (vuc1, vuc2);
+ vus1 = vec_vsubuhs (vus1, vus2);
+ vui1 = vec_vsubuws (vui1, vui2);
+ vuc1 = vec_vsububm (vuc1, vuc2);
+ vus1 = vec_vsubuhm (vus1, vus2);
+ vui1 = vec_vsubuwm (vui1, vui2);
+
+ vui2 = vec_vsum4ubs (vuc1, vui1);
+ vsi1 = vec_vsum4sbs (vsc2, vsi1);
+ vsi1 = vec_vsum2sws (vsi1, vsi1);
+ vsi2 = vec_vsumsws (vsi2, vsi1);
+
+ vf2 = vec_vrfiz (vf1);
+
+ vbs1 = vec_vupkhsb (vbc1);
+ vui1 = vec_vupkhpx (vp1);
+ vbi1 = vec_vupkhsh (vbs1);
+
+ vss1 = vec_vupklsb (vsc1);
+ vui1 = vec_vupklpx (vp2);
+ vbi1 = vec_vupklsh (vbs1);
+
+ return vsi1;
+}
+
+/* { dg-final { scan-assembler "\tlvebx " } } */
+/* { dg-final { scan-assembler "\tlvehx " } } */
+/* { dg-final { scan-assembler "\tlvewx " } } */
+/* { dg-final { scan-assembler "\tlvx " } } */
+/* { dg-final { scan-assembler "\tlvxl " } } */
+/* { dg-final { scan-assembler "\tstvebx " } } */
+/* { dg-final { scan-assembler "\tstvehx " } } */
+/* { dg-final { scan-assembler "\tstvewx " } } */
+/* { dg-final { scan-assembler "\tstvx " } } */
+/* { dg-final { scan-assembler "\tstvxl " } } */
+
+/* { dg-final { scan-assembler "\tvaddcuw " } } */
+/* { dg-final { scan-assembler "\tvaddfp " } } */
+/* { dg-final { scan-assembler "\tvaddsbs " } } */
+/* { dg-final { scan-assembler "\tvaddshs " } } */
+/* { dg-final { scan-assembler "\tvaddsws " } } */
+/* { dg-final { scan-assembler "\tvaddubs " } } */
+/* { dg-final { scan-assembler "\tvadduhs " } } */
+/* { dg-final { scan-assembler "\tvadduws " } } */
+/* { dg-final { scan-assembler "\tvaddubm " } } */
+/* { dg-final { scan-assembler "\tvadduhm " } } */
+/* { dg-final { scan-assembler "\tvadduwm " } } */
+
+/* { dg-final { scan-assembler "\tvand " } } */
+/* { dg-final { scan-assembler "\tvandc " } } */
+
+/* { dg-final { scan-assembler "\tvavgsb " } } */
+/* { dg-final { scan-assembler "\tvavgsh " } } */
+/* { dg-final { scan-assembler "\tvavgsw " } } */
+/* { dg-final { scan-assembler "\tvavgub " } } */
+/* { dg-final { scan-assembler "\tvavguh " } } */
+/* { dg-final { scan-assembler "\tvavguw " } } */
+
+/* { dg-final { scan-assembler "\tvcfsx " } } */
+/* { dg-final { scan-assembler "\tvcfux " } } */
+
+/* { dg-final { scan-assembler "\tvcmpbfp " } } */
+/* { dg-final { scan-assembler "\tvcmpeqfp " } } */
+
+/* { dg-final { scan-assembler "\tvcmpequb " } } */
+/* { dg-final { scan-assembler "\tvcmpequh " } } */
+/* { dg-final { scan-assembler "\tvcmpequw " } } */
+
+/* { dg-final { scan-assembler "\tvcmpgefp " } } */
+/* { dg-final { scan-assembler "\tvcmpgtfp " } } */
+
+/* { dg-final { scan-assembler "\tvcmpgtsb " } } */
+/* { dg-final { scan-assembler "\tvcmpgtsh " } } */
+/* { dg-final { scan-assembler "\tvcmpgtsw " } } */
+
+/* { dg-final { scan-assembler "\tvcmpgtub " } } */
+/* { dg-final { scan-assembler "\tvcmpgtuh " } } */
+/* { dg-final { scan-assembler "\tvcmpgtuw " } } */
+
+/* { dg-final { scan-assembler "\tvctsxs " } } */
+/* { dg-final { scan-assembler "\tvctuxs " } } */
+
+/* { dg-final { scan-assembler "\tvexptefp " } } */
+/* { dg-final { scan-assembler "\tvlogefp " } } */
+/* { dg-final { scan-assembler "\tvmaddfp " } } */
+
+/* { dg-final { scan-assembler "\tvmaxfp " } } */
+/* { dg-final { scan-assembler "\tvmaxsb " } } */
+/* { dg-final { scan-assembler "\tvmaxsh " } } */
+/* { dg-final { scan-assembler "\tvmaxsw " } } */
+/* { dg-final { scan-assembler "\tvmaxub " } } */
+/* { dg-final { scan-assembler "\tvmaxuh " } } */
+/* { dg-final { scan-assembler "\tvmaxuw " } } */
+
+/* { dg-final { scan-assembler "\tvmrghb " } } */
+/* { dg-final { scan-assembler "\tvmrghh " } } */
+/* { dg-final { scan-assembler "\tvmrghw " } } */
+
+/* { dg-final { scan-assembler "\tvmrglb " } } */
+/* { dg-final { scan-assembler "\tvmrglh " } } */
+/* { dg-final { scan-assembler "\tvmrglw " } } */
+
+/* { dg-final { scan-assembler "\tvminfp " } } */
+/* { dg-final { scan-assembler "\tvminsb " } } */
+/* { dg-final { scan-assembler "\tvminsh " } } */
+/* { dg-final { scan-assembler "\tvminsw " } } */
+/* { dg-final { scan-assembler "\tvminub " } } */
+/* { dg-final { scan-assembler "\tvminuh " } } */
+/* { dg-final { scan-assembler "\tvminuw " } } */
+
+/* { dg-final { scan-assembler "\tvmhaddshs " } } */
+/* { dg-final { scan-assembler "\tvmhraddshs " } } */
+/* { dg-final { scan-assembler "\tvmladduhm " } } */
+/* { dg-final { scan-assembler "\tvmsumubm " } } */
+/* { dg-final { scan-assembler "\tvmsummbm " } } */
+/* { dg-final { scan-assembler "\tvmsumshm " } } */
+/* { dg-final { scan-assembler "\tvmsumuhm " } } */
+/* { dg-final { scan-assembler "\tvmsumuhs " } } */
+/* { dg-final { scan-assembler "\tvmsumshs " } } */
+
+/* { dg-final { scan-assembler "\tvmuleub " } } */
+/* { dg-final { scan-assembler "\tvmulesb " } } */
+/* { dg-final { scan-assembler "\tvmuleuh " } } */
+/* { dg-final { scan-assembler "\tvmulesh " } } */
+
+/* { dg-final { scan-assembler "\tvmuloub " } } */
+/* { dg-final { scan-assembler "\tvmulosb " } } */
+/* { dg-final { scan-assembler "\tvmulouh " } } */
+/* { dg-final { scan-assembler "\tvmulosh " } } */
+
+/* { dg-final { scan-assembler "\tvnmsubfp " } } */
+
+/* { dg-final { scan-assembler "\tvnor " } } */
+/* { dg-final { scan-assembler "\tvor " } } */
+/* { dg-final { scan-assembler "\tvxor " } } */
+
+/* { dg-final { scan-assembler "\tvpkuhum " } } */
+/* { dg-final { scan-assembler "\tvpkuwum " } } */
+/* { dg-final { scan-assembler "\tvpkpx " } } */
+/* { dg-final { scan-assembler "\tvpkuhus " } } */
+/* { dg-final { scan-assembler "\tvpkshss " } } */
+/* { dg-final { scan-assembler "\tvpkuwus " } } */
+/* { dg-final { scan-assembler "\tvpkswss " } } */
+/* { dg-final { scan-assembler "\tvpkshus " } } */
+/* { dg-final { scan-assembler "\tvpkswus " } } */
+
+/* { dg-final { scan-assembler "\tvperm " } } */
+
+/* { dg-final { scan-assembler "\tvrefp " } } */
+/* { dg-final { scan-assembler "\tvrfin " } } */
+/* { dg-final { scan-assembler "\tvrsqrtefp " } } */
+
+/* { dg-final { scan-assembler "\tvrlb " } } */
+/* { dg-final { scan-assembler "\tvrlh " } } */
+/* { dg-final { scan-assembler "\tvrlw " } } */
+
+/* { dg-final { scan-assembler "\tvsel " } } */
+
+/* { dg-final { scan-assembler "\tvslb " } } */
+/* { dg-final { scan-assembler "\tvslh " } } */
+/* { dg-final { scan-assembler "\tvslw " } } */
+
+/* { dg-final { scan-assembler "\tvsldoi " } } */
+/* { dg-final { scan-assembler "\tvsl " } } */
+/* { dg-final { scan-assembler "\tvslo " } } */
+
+/* { dg-final { scan-assembler "\tvspltb " } } */
+/* { dg-final { scan-assembler "\tvsplth " } } */
+/* { dg-final { scan-assembler "\tvspltw " } } */
+/* { dg-final { scan-assembler "\tvspltisb " } } */
+/* { dg-final { scan-assembler "\tvspltish " } } */
+/* { dg-final { scan-assembler "\tvspltisw " } } */
+
+/* { dg-final { scan-assembler "\tvsrb " } } */
+/* { dg-final { scan-assembler "\tvsrh " } } */
+/* { dg-final { scan-assembler "\tvsrw " } } */
+/* { dg-final { scan-assembler "\tvsrab " } } */
+/* { dg-final { scan-assembler "\tvsrah " } } */
+/* { dg-final { scan-assembler "\tvsraw " } } */
+/* { dg-final { scan-assembler "\tvsr " } } */
+/* { dg-final { scan-assembler "\tvsro " } } */
+
+/* { dg-final { scan-assembler "\tvsubcuw " } } */
+/* { dg-final { scan-assembler "\tvsubfp " } } */
+/* { dg-final { scan-assembler "\tvsubsbs " } } */
+/* { dg-final { scan-assembler "\tvsubshs " } } */
+/* { dg-final { scan-assembler "\tvsubsws " } } */
+/* { dg-final { scan-assembler "\tvsububs " } } */
+/* { dg-final { scan-assembler "\tvsubuhs " } } */
+/* { dg-final { scan-assembler "\tvsubuws " } } */
+/* { dg-final { scan-assembler "\tvsububm " } } */
+/* { dg-final { scan-assembler "\tvsubuhm " } } */
+/* { dg-final { scan-assembler "\tvsubuwm " } } */
+
+/* { dg-final { scan-assembler "\tvsum4ubs " } } */
+/* { dg-final { scan-assembler "\tvsum4sbs " } } */
+/* { dg-final { scan-assembler "\tvsum2sws " } } */
+/* { dg-final { scan-assembler "\tvsumsws " } } */
+
+/* { dg-final { scan-assembler "\tvrfiz " } } */
+
+/* { dg-final { scan-assembler "\tvupkhsb " } } */
+/* { dg-final { scan-assembler "\tvupkhpx " } } */
+/* { dg-final { scan-assembler "\tvupkhsh " } } */
+
+/* { dg-final { scan-assembler "\tvupklsb " } } */
+/* { dg-final { scan-assembler "\tvupklpx " } } */
+/* { dg-final { scan-assembler "\tvupklsh " } } */
diff --git a/gcc/testsuite/g++.dg/ext/apple-altivec-3.C b/gcc/testsuite/g++.dg/ext/apple-altivec-3.C
new file mode 100644
index 00000000000..b095b88eee4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/apple-altivec-3.C
@@ -0,0 +1,18 @@
+/* APPLE LOCAL file AltiVec */
+/* Vectors in template functions. */
+
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec -Wall" } */
+
+template<int I>
+void FooBar()
+{
+ vector unsigned char va, vb, vc;
+ vc = (vector unsigned char)vec_mergeh((vector unsigned short)va, (vector unsigned short)vb);
+}
+
+int main (int argc, char * const argv[])
+{
+ FooBar<0>();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/apple-altivec-4.C b/gcc/testsuite/g++.dg/ext/apple-altivec-4.C
new file mode 100644
index 00000000000..0bb1dcd1d3a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/apple-altivec-4.C
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+/* Existing AltiVec PIM implementations allow numeric literals with
+ any number of bits, so long as the value is within allowed range. */
+int foo(void)
+{
+ vector unsigned char amask = vec_splat_u8 ( 0xFFFFFFF3L );
+ vector signed short bmask = vec_splat_s16 ( 0xFFFFFFFFFFFFFFF1LL );
+}
+
+
+/* { dg-final { scan-assembler "vspltisb.+\\-13" } } */
+/* { dg-final { scan-assembler "vspltish.+\\-15" } } */
+
diff --git a/gcc/testsuite/g++.dg/ext/apple-altivec-5.C b/gcc/testsuite/g++.dg/ext/apple-altivec-5.C
new file mode 100644
index 00000000000..4473881dda7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/apple-altivec-5.C
@@ -0,0 +1,31 @@
+/* APPLE LOCAL file AltiVec */
+/* Test for handling of reference vector parameters. */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec" } */
+
+struct Vect
+{
+ typedef vector unsigned int vector_1;
+
+ static vector_1 ConvertPixel1(const vector_1 &source, const vector unsigned char &vp);
+ static vector_1 ConvertPixel2(const vector_1 source, const vector unsigned char vp);
+ static vector_1 ConvertPixel3(vector_1 &source, vector unsigned char &vp);
+ static vector_1 ConvertPixel4(vector_1 source, vector unsigned char vp);
+};
+
+Vect::vector_1 Vect::ConvertPixel1(const vector_1 &source, const vector unsigned char &vp)
+{
+ return (vector_1) vec_perm(source, source, vp);
+}
+Vect::vector_1 Vect::ConvertPixel2(const vector_1 source, const vector unsigned char vp)
+{
+ return (vector_1) vec_perm(source, source, vp);
+}
+Vect::vector_1 Vect::ConvertPixel3(vector_1 &source, vector unsigned char &vp)
+{
+ return (vector_1) vec_perm(source, source, vp);
+}
+Vect::vector_1 Vect::ConvertPixel4(vector_1 source, vector unsigned char vp)
+{
+ return (vector_1) vec_perm(source, source, vp);
+}
diff --git a/gcc/testsuite/g++.dg/ext/apple-altivec-6.C b/gcc/testsuite/g++.dg/ext/apple-altivec-6.C
new file mode 100644
index 00000000000..7a74578d477
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/apple-altivec-6.C
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file AltiVec */
+/* Test for handling of volatile reference vector parameters. */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec" } */
+
+int foo(volatile vector float &i, int &j)
+{
+ vector unsigned char zero = vec_splat_u8(0);
+ vector unsigned char one = vec_splat_u8(1);
+ i = vec_add( (vector float)zero, (vector float)one );
+ j = 5;
+ return 0;
+}
+
+/* { dg-final { scan-assembler "Z3fooRVU8__vectorfRi" } } */
diff --git a/gcc/testsuite/g++.dg/ext/lvalue-cast-1.C b/gcc/testsuite/g++.dg/ext/lvalue-cast-1.C
new file mode 100644
index 00000000000..ebee754f069
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/lvalue-cast-1.C
@@ -0,0 +1,34 @@
+/* APPLE LOCAL file non lvalue assign */
+/* { dg-do run } */
+/* { dg-options "-fnon-lvalue-assign" } */
+
+#include <stdlib.h>
+#define CHECK_IF(expr) if (!(expr)) abort ()
+
+static int global;
+
+void f(int &) { global = 35; }
+void f(const int &) { global = 78; }
+
+long long_arr[2];
+
+int main(void) {
+
+ char *p;
+
+ (long *)p = long_arr; /* { dg-warning "target of assignment not really an lvalue" } */
+ ((long *)p)++; /* { dg-warning "target of assignment not really an lvalue" } */
+ *(long *)p = -1;
+
+ *p = -2;
+ CHECK_IF(p[-1] == 0 && p[0] == -2 && p[1] == -1);
+
+ (long *)p += 2; /* { dg-warning "target of assignment not really an lvalue" } */
+ (long *)p -= 2; /* { dg-warning "target of assignment not really an lvalue" } */
+
+ long x = 0;
+ f((int)x);
+ CHECK_IF(global == 78);
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/lvalue-cast-2.C b/gcc/testsuite/g++.dg/ext/lvalue-cast-2.C
new file mode 100644
index 00000000000..bfd2e29e52c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/lvalue-cast-2.C
@@ -0,0 +1,14 @@
+/* APPLE LOCAL file non lvalue assign */
+/* Allow lvalue casts in conjunction with '&'. */
+/* { dg-do compile } */
+/* { dg-options "-fnon-lvalue-assign" } */
+
+int foo (void **ptr) {
+ return 1;
+}
+
+int bar (void) {
+ char *string;
+
+ return foo ((void **)&((char *)string)); /* { dg-warning "argument to .&. not really an lvalue" } */
+}
diff --git a/gcc/testsuite/g++.dg/ext/lvalue-cond-1.C b/gcc/testsuite/g++.dg/ext/lvalue-cond-1.C
new file mode 100644
index 00000000000..ad059afe9b6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/lvalue-cond-1.C
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file non lvalue assign */
+/* Allow assignments to conditional expressions, as long as the second and third
+ operands are already lvalues. */
+/* NB: It turns out that C++ (unlike C) already allows these as lvalues, and so
+ no warnings whatsoever will be produced. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-options "-fnon-lvalue-assign" } */
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+int g1 = 3, g2 = 5;
+
+void assign_val1 (int which, int value) {
+ (which ? g1 : g2) = value; /* { dg-bogus "target of assignment not really an lvalue" } */
+}
+
+void assign_val2 (int which) {
+ (which ? g1 : g2)++; /* { dg-bogus "target of assignment not really an lvalue" } */
+}
+
+int main(void) {
+ assign_val1 (0, 15);
+ if (g1 != 3 || g2 != 15)
+ abort ();
+
+ assign_val2 (1);
+ if (g1 != 4 || g2 != 15)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/ext/new-delete-1.C b/gcc/testsuite/g++.dg/ext/new-delete-1.C
new file mode 100644
index 00000000000..8f09183ab7a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/new-delete-1.C
@@ -0,0 +1,28 @@
+/* APPLE LOCAL file coalescing */
+/* Make sure that non-weak '::new' and '::delete' operators do not wind
+ up in a coalesced section. Whether or not they get called via a stub
+ from within the same translation unit is an issue we defer for later
+ (i.e., Positron); when called from other translation units, they do
+ need a stub. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+
+extern "C" void free(void *);
+
+void operator delete(void*) throw();
+void operator delete(void* p) throw() { free(p); }
+
+void operator delete(void*, int) throw();
+
+void *operator new(unsigned long) throw();
+void *operator new(unsigned long) throw() { return (void *)0; }
+
+int *foo(void) {
+ int *n = new int();
+ ::operator delete(n, 0);
+ ::operator delete(n);
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "coal" } } */
+/* { dg-final { scan-assembler "bl L__ZdlPvi.stub" } } */
diff --git a/gcc/testsuite/g++.dg/ext/new-delete-2.C b/gcc/testsuite/g++.dg/ext/new-delete-2.C
new file mode 100644
index 00000000000..72d6b9e3ae1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/new-delete-2.C
@@ -0,0 +1,28 @@
+/* APPLE LOCAL file coalescing */
+/* Make sure that weak '::new' and '::delete' operators wind
+ up in a coalesced section and get called via a stub. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+
+extern "C" void free(void *);
+
+void operator delete(void*) throw() __attribute__((weak));
+void operator delete(void* p) throw() { free(p); }
+
+void operator delete(void*, int) throw() __attribute__((weak));
+
+void *operator new(unsigned long) throw() __attribute__((weak));
+void *operator new(unsigned long) throw() { return (void *)0; }
+
+int *foo(void) {
+ int *n = new int();
+ ::operator delete(n, 0);
+ ::operator delete(n);
+ return 0;
+}
+
+/* { dg-final { scan-assembler "coal" } } */
+
+/* { dg-final { scan-assembler "bl L__Znwm.stub" } } */
+/* { dg-final { scan-assembler "bl L__ZdlPvi.stub" } } */
+/* { dg-final { scan-assembler "bl L__ZdlPv.stub" } } */
diff --git a/gcc/testsuite/g++.dg/kext1.C b/gcc/testsuite/g++.dg/kext1.C
new file mode 100644
index 00000000000..2b8cdfa07e9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext1.C
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file KEXT indirect-virtual-calls --sts */
+/* Radar 3008388: Positive C++ test case. */
+/* Origin: Matt Austern <austern@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-fapple-kext" } */
+
+struct B1 { }; /* ok */
+struct B2 { }; /* ok */
+struct D1 : B1 { }; /* ok */
+struct D2 : B1, B2 { }; /* ok */
+struct D3 : virtual B1 { }; /* ok */
diff --git a/gcc/testsuite/g++.dg/kext10.C b/gcc/testsuite/g++.dg/kext10.C
new file mode 100644
index 00000000000..74cfa24c96b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext10.C
@@ -0,0 +1,23 @@
+// APPLE LOCAL file
+// Radar 3988061
+// { dg-do compile { target powerpc*-*-darwin* } }
+// { dg-options "-Os -static -fapple-kext" }
+// the virtual call to IOHIDElement::free() is normally resolved
+// at compile time, but with -fapple-kext we don't want this.
+class IOHIDElement
+{
+protected:
+ virtual ~IOHIDElement();
+ virtual void free();
+};
+class IOHIDElementPrivate: public IOHIDElement
+{
+protected:
+ virtual void free();
+};
+IOHIDElement::~IOHIDElement() {}
+void IOHIDElementPrivate::free()
+{
+ IOHIDElement::free();
+}
+// { dg-final { scan-assembler-times "IOHIDElement4free" 1} }
diff --git a/gcc/testsuite/g++.dg/kext11.C b/gcc/testsuite/g++.dg/kext11.C
new file mode 100644
index 00000000000..d91a686e00f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext11.C
@@ -0,0 +1,39 @@
+/* APPLE LOCAL file ptmf casts --bowdidge */
+/* In gcc-4.0 and beyond, kexts are not permitted to cast
+ pointer-to-member- functions into pointer-to-functions.
+ These casts should be flagged as a hard error if
+ -fapple-kext is an option for the compile. -fpermissive shouldn't permit
+ this, either. This checks for OSMemberFunctionCast in the error message
+ because the error advises developers to use that function to replace
+ these casts.
+
+ Radar 4025923, gcc-4.0 should ban kexts from doing ptmf to ptf
+ conversions without OSMemberFunctionCast
+*/
+/* { dg-do compile { target powerpc*-apple-darwin* } } */
+/* { dg-options "-S -static -fapple-kext -fpermissive -fno-exceptions" } */
+
+typedef int(*INT_FUNC_INT)(int);
+class Superclass {
+public:
+ /* In 3.3, this would get the foo function for the class of "this". In 4.0, it
+ gets the foo function for Superclass. */
+ virtual int init(void) {_myFunc = (INT_FUNC_INT)&Superclass::foo;}; /* { dg-error "OSMemberFunctionCast" } */
+ INT_FUNC_INT _myFunc;
+ virtual int foo(int i) { return 2;};
+};
+
+class Subclass : public Superclass {
+public:
+ virtual int foo(int) { return 1;};
+};
+
+main(int argc, char **argv) {
+ Superclass sup;
+ Subclass sub;
+ sup.init();
+ sup.foo(1);
+ sub.init();
+ sub.foo(1);
+}
+
diff --git a/gcc/testsuite/g++.dg/kext2.C b/gcc/testsuite/g++.dg/kext2.C
new file mode 100644
index 00000000000..992c81c6a3a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext2.C
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file KEXT indirect-virtual-calls --sts */
+/* Radar 3008388: Positive C++ test case. */
+/* Origin: Matt Austern <austern@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-fapple-kext" } */
+
+struct B1 { virtual ~B1(); virtual void f(); }; /* ok */
+struct D1 : B1 { }; /* ok */
+struct X1 : D1 { virtual void f(); }; /* ok */
+
+void X1::f() { D1::f(); } /* ok */
+
+
diff --git a/gcc/testsuite/g++.dg/kext3.C b/gcc/testsuite/g++.dg/kext3.C
new file mode 100644
index 00000000000..25b904bf78b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext3.C
@@ -0,0 +1,18 @@
+/* APPLE LOCAL file KEXT indirect-virtual-calls --sts */
+/* Radar 3008388: Negative C++ test case. */
+/* Origin: Matt Austern <austern@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-fapple-kext" } */
+
+struct B1 { virtual ~B1(); virtual void f(); }; /* ok */
+struct D1 : B1 { }; /* ok */
+struct D2 { }; /* ok */
+
+struct X1 : D1, D2 { }; /* ok */
+struct X2 : virtual D1 { }; /* ok */
+
+struct Y1 : X1 { virtual void f(); }; /* ok */
+struct Y2 : X2 { virtual void f(); }; /* ok */
+
+void Y1::f() { X1::f(); } /* { dg-error "indirect virtual" } */
+void Y2::f() { X2::f(); } /* { dg-error "indirect virtual" } */
diff --git a/gcc/testsuite/g++.dg/kext4.C b/gcc/testsuite/g++.dg/kext4.C
new file mode 100644
index 00000000000..bdaefb61121
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext4.C
@@ -0,0 +1,27 @@
+/* APPLE LOCAL file KEXT double destructor */
+/* { dg-do compile } */
+/* { dg-options "-fapple-kext" } */
+/* test for use of apple_kext_compatibility on stack */
+struct B1 {
+ virtual ~B1();
+} __attribute__((apple_kext_compatibility));
+
+struct D1 : B1 {
+ void operator delete(void *) { }
+ D1();
+};
+
+struct D2 : B1 {
+ void operator delete(void *);
+ D2();
+};
+
+struct D3 : B1 {
+ D3();
+};
+
+void foo() {
+ D1 d1; // ok
+ D2 d2; // { dg-warning "is an instance of a class" }
+ D3 d3; // { dg-warning "is an instance of a class" }
+}
diff --git a/gcc/testsuite/g++.dg/kext5.C b/gcc/testsuite/g++.dg/kext5.C
new file mode 100644
index 00000000000..4306c171401
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext5.C
@@ -0,0 +1,16 @@
+/* APPLE LOCAL file KEXT double destructor */
+/* { dg-do compile } */
+/* { dg-options "-fapple-kext" } */
+
+class tTest
+{
+ public:
+
+ tTest();
+ ~tTest();
+};
+
+void bar ()
+{
+ tTest tests[5];
+}
diff --git a/gcc/testsuite/g++.dg/kext6.C b/gcc/testsuite/g++.dg/kext6.C
new file mode 100644
index 00000000000..c3f7503e53d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext6.C
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file KEXT indirect-virtual-calls --sts */
+/* Radar 3848842 Positive C++ test case. */
+/* Origin F. Jahanian <fjahanian@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-Os -fapple-kext" } */
+
+struct Integer
+{
+ Integer ( void ) ;
+ virtual ~Integer ( void ) ;
+};
+
+static void AppendMa(unsigned char *outBuffer);
+static void AppendNonce();
+
+extern "C" void afpfs_DHXLogin ()
+{
+ unsigned char *cptr = __null;
+ AppendMa(cptr);
+ AppendNonce();
+}
+
+static void AppendNonce() { }
+
+
+static void AppendMa(unsigned char *outBuffer)
+{
+ Integer Ma;
+}
diff --git a/gcc/testsuite/g++.dg/kext7.C b/gcc/testsuite/g++.dg/kext7.C
new file mode 100644
index 00000000000..564e1219599
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext7.C
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file KEXT double destructor --bowdidge */
+/* Radar 3943783 kernel extensions built with gcc-4.0 can't be loaded */
+/* { dg-do compile { target powerpc*-apple-darwin* } } */
+/* { dg-options "-S -fapple-kext" } */
+
+struct Base {
+ virtual ~Base();
+} __attribute__((apple_kext_compatibility));
+
+struct Derived : Base {
+ void operator delete(void *) { }
+ Derived();
+};
+
+void foo() {
+ Derived d1; // ok
+}
+/* An implicit in-charge destructor shouldn't be created when -fapple-kext
+ is declared. */
+/* { dg-final { scan-assembler-not "_ZN7DerivedD1Ev" } } */
diff --git a/gcc/testsuite/g++.dg/kext8.C b/gcc/testsuite/g++.dg/kext8.C
new file mode 100644
index 00000000000..399f8c03f44
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext8.C
@@ -0,0 +1,36 @@
+/* APPLE LOCAL file KEXT double destructor --bowdidge */
+/* Radar 3943783 kernel extensions built with gcc-4.0 can't be loaded */
+/* { dg-do compile { target powerpc*-apple-darwin* } } */
+/* { dg-options "-S -fapple-kext -fno-exceptions" } */
+
+/* Here's some kext class hierarchy code. */
+
+
+struct Base {
+ virtual ~Base();
+} __attribute__((apple_kext_compatibility));
+
+struct Derived : Base {
+ void operator delete(void *) { }
+ Derived();
+};
+
+void foo() {
+ Derived d1; // ok
+}
+
+/* Here's some inlined functions to try to trick the compiler into creating coalesced
+ sections. */
+inline unsigned f(unsigned n) { return n == 0 ? 0 : n + f(n-1); }
+
+unsigned g(unsigned n) { return f(n); }
+
+/* Here's some template stuff to try to trick the compiler into creating coalesced sections
+ another way. */
+
+ template <typename X> X ident(X x) { return x; }
+ int foo(int n) { return ident(n); }
+
+/* See if there's any sections with the coalesced flag. coalesced sections
+ currently aren't loaded by the kernel loader into memory. */
+/* { dg-final { scan-assembler-not "coalesced" } } */
diff --git a/gcc/testsuite/g++.dg/kext9.C b/gcc/testsuite/g++.dg/kext9.C
new file mode 100644
index 00000000000..88293aa5558
--- /dev/null
+++ b/gcc/testsuite/g++.dg/kext9.C
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file KEXT indirect virtual calls */
+/* Radar 3972840: Positive C++ test case */
+/* Origin: Matt Austern <austern@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-fapple-kext" } */
+
+struct Base { virtual char* abc(void) const; };
+
+char* Base::abc() const { return 0; }
+
+void f(Base* p) {
+ char* c = p->Base::abc();
+}
diff --git a/gcc/testsuite/g++.dg/pascal-strings-1.C b/gcc/testsuite/g++.dg/pascal-strings-1.C
new file mode 100644
index 00000000000..50c52015ec4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pascal-strings-1.C
@@ -0,0 +1,44 @@
+/* APPLE LOCAL file pascal strings */
+/* Positive C++ test cases. */
+/* Origin: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do run } */
+/* { dg-options "-fpascal-strings" } */
+
+typedef __SIZE_TYPE__ size_t;
+extern "C" void abort (void);
+extern "C" size_t strlen (const char *s);
+
+const unsigned char *pascalStr1 = "\pHello, World!";
+const unsigned char *concat1 = "\pConcatenated" "string" "\pliteral";
+
+const unsigned char msg1[] = "\pHello"; /* ok */
+const unsigned char *msg2 = "\pHello"; /* ok */
+const signed char msg3[] = "\pHello"; /* ok */
+const char msg4[] = "\pHello"; /* ok */
+unsigned char msg5[] = "\pHello"; /* ok */
+signed char msg7[] = "\pHello"; /* ok */
+char msg8[] = "\pHello"; /* ok */
+
+int
+main (void)
+{
+ const unsigned char *pascalStr2 = "\pGood-bye!";
+
+ if (strlen ((const char *)pascalStr1) != 14)
+ abort ();
+ if (*pascalStr1 != 13)
+ abort (); /* the length byte does not include trailing null */
+
+ if (strlen ((const char *)pascalStr2) != 10)
+ abort ();
+ if (*pascalStr2 != 9)
+ abort ();
+
+ if (strlen ((const char *)concat1) != 26)
+ abort ();
+ if (*concat1 != 25)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/pascal-strings-2.C b/gcc/testsuite/g++.dg/pascal-strings-2.C
new file mode 100644
index 00000000000..e74c67f89c7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pascal-strings-2.C
@@ -0,0 +1,43 @@
+/* APPLE LOCAL file pascal strings */
+/* Negative C++ test cases. */
+/* Origin: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-fpascal-strings" } */
+
+const wchar_t *pascalStr1 = L"\pHi!"; /* { dg-warning "unknown escape sequence" } */
+const wchar_t *pascalStr2 = L"Bye\p!"; /* { dg-warning "unknown escape sequence" } */
+
+const wchar_t *initErr0 = "\pHi"; /* { dg-error "cannot convert" } */
+const wchar_t initErr0a[] = "\pHi"; /* { dg-error "initialized from non-wide string" } */
+const wchar_t *initErr1 = "Bye"; /* { dg-error "cannot convert" } */
+const wchar_t initErr1a[] = "Bye"; /* { dg-error "initialized from non-wide string" } */
+
+const char *initErr2 = L"Hi"; /* { dg-error "cannot convert" } */
+const char initErr2a[] = L"Hi"; /* { dg-error "initialized from wide string" } */
+const signed char *initErr3 = L"Hi"; /* { dg-error "cannot convert" } */
+const signed char initErr3a[] = L"Hi"; /* { dg-error "initialized from wide string" } */
+const unsigned char *initErr4 = L"Hi"; /* { dg-error "cannot convert" } */
+const unsigned char initErr4a[] = L"Hi"; /* { dg-error "initialized from wide string" } */
+
+const char *pascalStr3 = "Hello\p, World!"; /* { dg-warning "unknown escape sequence" } */
+
+const char *concat2 = "Hi" "\pthere"; /* { dg-warning "unknown escape sequence" } */
+const char *concat3 = "Hi" "there\p"; /* { dg-warning "unknown escape sequence" } */
+
+const char *s2 = "\pGoodbye!"; /* { dg-error "invalid conversion" } */
+unsigned char *s3 = "\pHi!"; /* { dg-error "invalid conversion" } */
+char *s4 = "\pHi"; /* { dg-error "invalid conversion" } */
+signed char *s5 = "\pHi"; /* { dg-error "invalid conversion" } */
+const signed char *s6 = "\pHi"; /* { dg-error "invalid conversion" } */
+
+/* the maximum length of a Pascal literal is 255. */
+const unsigned char *almostTooLong =
+ "\p12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "123456789012345"; /* ok */
+const unsigned char *definitelyTooLong =
+ "\p12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "1234567890123456"; /* { dg-error "too long" } */
diff --git a/gcc/testsuite/g++.dg/pascal-strings-3.C b/gcc/testsuite/g++.dg/pascal-strings-3.C
new file mode 100644
index 00000000000..7c7cf8139ed
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pascal-strings-3.C
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file pascal strings */
+/* Ensure that there are no warnings or errors issued when a Pascal string is used to
+ initialize an array and the NUL terminator does not fit. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-fpascal-strings" } */
+
+typedef unsigned char Str15[16];
+
+Str15 ggg = "\p012345678901234";
+Str15 hhh = "\p0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */
+
+int foo(void)
+{
+ Str15 sss = "\p012345678901234";
+ Str15 ttt = "\p0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/pascal-strings-4.C b/gcc/testsuite/g++.dg/pascal-strings-4.C
new file mode 100644
index 00000000000..ef336990455
--- /dev/null
+++ b/gcc/testsuite/g++.dg/pascal-strings-4.C
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file pascal strings */
+/* Ensure that Pascal strings do not get confused with ordinary C strings when
+ -funsigned-char is being used. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-fpascal-strings -funsigned-char" } */
+
+typedef unsigned char Str15[16];
+
+Str15 ggg = "\p012345678901234";
+Str15 hhh = "0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */
+
+int foo(void)
+{
+ Str15 sss = "\p012345678901234";
+ Str15 ttt = "0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/preserve-PPC-CR.C b/gcc/testsuite/g++.dg/preserve-PPC-CR.C
new file mode 100644
index 00000000000..38e76873ddd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/preserve-PPC-CR.C
@@ -0,0 +1,41 @@
+// APPLE LOCAL file preserve CR2 for save_world prologues
+// This testcase failed at -O2 due to a missing EH note describing the PowerPC Condition Register.
+// Thanks to Dale Johannesen.
+
+// { dg-do run }
+// { dg-options "-fpascal-strings" }
+#include <stdlib.h>
+#include <stdio.h>
+int tick = 1;
+int caught_x = 1;
+int h() { return 2; }
+void f()
+{ throw(3); }
+extern int h();
+void ff() {
+ bool xx = h() == 0;
+ if ( !xx ) {
+ try {
+ f();
+ } catch (float f) {
+ if (!xx) printf("%f\n", f);
+ }
+ }
+}
+int g(int y)
+{
+ bool x = h() != 0;
+ if ( x) {
+ try {
+ ff();
+ } catch (int ex) {
+ // if (x) printf("%d\n", ex);
+ if (x) { tick++; caught_x = ex; }
+ }}
+}
+main()
+{
+ g(3);
+ if (tick != 2 || caught_x != 3)
+ abort();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.abi/align.C b/gcc/testsuite/g++.old-deja/g++.abi/align.C
index 28d3ba9ce86..09b5667ddef 100644
--- a/gcc/testsuite/g++.old-deja/g++.abi/align.C
+++ b/gcc/testsuite/g++.old-deja/g++.abi/align.C
@@ -1,4 +1,5 @@
-// { dg-do run { target i?86-*-linux* i?86-*-freebsd* } }
+// APPLE LOCAL why is this local?
+// { dg-do run { target i?86-*-linux* i?86-*-freebsd* i?86-*-darwin* } }
// { dg-options "-malign-double" }
// Origin: Alex Samuel <samuel@codesourcery.com>
diff --git a/gcc/testsuite/g++.old-deja/g++.mike/pascal.C b/gcc/testsuite/g++.old-deja/g++.mike/pascal.C
new file mode 100644
index 00000000000..e1d6fe342a7
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.mike/pascal.C
@@ -0,0 +1,5 @@
+// APPLE LOCAL file pascal strings
+// { dg-do compile }
+// { dg-options "-fpascal-strings -save-temps" }
+
+const unsigned char * cucp = "\pHi";
diff --git a/gcc/testsuite/gcc.apple/Wextra-tokens.c b/gcc/testsuite/gcc.apple/Wextra-tokens.c
new file mode 100644
index 00000000000..08b3cb7745c
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/Wextra-tokens.c
@@ -0,0 +1,21 @@
+/* APPLE LOCAL file -Wextra-tokens */
+/* Lifted from gcc.dg/cpp/extratokens2.c. */
+/* Copyright (C) 2002 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-fno-show-column -Wextra-tokens" } */
+
+/* Tests that -Wextra-tokens correctly enables the checks
+ that are disabled by default. */
+
+#if 1
+#if 0
+#else foo /* { dg-warning "extra tokens" "bad warning" } */
+#endif / /* { dg-warning "extra tokens" "bad warning" } */
+#endif
+
+# 36 "file.c" 3
+
+/* ... but in a system header, it's acceptable. */
+#ifdef KERNEL
+#endif KERNEL /* { dg-bogus "extra tokens" "bad warning" } */
diff --git a/gcc/testsuite/gcc.apple/Wfour-char-constants-1.c b/gcc/testsuite/gcc.apple/Wfour-char-constants-1.c
new file mode 100644
index 00000000000..536396454b7
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/Wfour-char-constants-1.c
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file -Wfour-char-constants */
+/* We warn by default on Darwin, so no specific option needed. */
+
+/* { dg-do compile { target "*-*-darwin*" } } */
+/* { dg-options "" } */
+
+int glob1 = 'a';
+int glob2 = 'ab'; /* { dg-warning "multi-character character constant" } */
+int glob3 = 'abc'; /* { dg-warning "multi-character character constant" } */
+int glob4 = 'abcd'; /* say nothing */
+int glob5 = 'abcde'; /* { dg-warning "character constant too long" } */
+
diff --git a/gcc/testsuite/gcc.apple/Wfour-char-constants-2.c b/gcc/testsuite/gcc.apple/Wfour-char-constants-2.c
new file mode 100644
index 00000000000..14115ba6fea
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/Wfour-char-constants-2.c
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file -Wfour-char-constants */
+/* Explicitly enable the warning. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wfour-char-constants" } */
+
+int glob1 = 'a';
+int glob2 = 'ab'; /* { dg-warning "multi-character character constant" } */
+int glob3 = 'abc'; /* { dg-warning "multi-character character constant" } */
+int glob4 = 'abcd'; /* { dg-warning "multi-character character constant" } */
+int glob5 = 'abcde'; /* { dg-warning "character constant too long" } */
+
diff --git a/gcc/testsuite/gcc.apple/Wmost.c b/gcc/testsuite/gcc.apple/Wmost.c
new file mode 100644
index 00000000000..6e1d3342539
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/Wmost.c
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file -Wmost */
+
+/* { dg-do compile } */
+/* { dg-options "-Wmost" } */
+
+int baz (void);
+
+int
+foo ()
+{
+ int loc;
+
+ bar (); /* { dg-warning "implicit declaration" } */
+
+ if (loc = baz ()) /* be quiet about this */
+ return 1;
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/Wno-newline-1.c b/gcc/testsuite/gcc.apple/Wno-newline-1.c
new file mode 100644
index 00000000000..44eab6e533c
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/Wno-newline-1.c
@@ -0,0 +1,3 @@
+/* Test no newline at eof warning. */
+/* { dg-do compile } */
+int main() { return 0; } \ No newline at end of file
diff --git a/gcc/testsuite/gcc.apple/Wno-newline-2.c b/gcc/testsuite/gcc.apple/Wno-newline-2.c
new file mode 100644
index 00000000000..74acf1afa68
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/Wno-newline-2.c
@@ -0,0 +1,4 @@
+/* Test no newline at eof warning. */
+/* { dg-do compile } */
+/* { dg-options "-Wnewline-eof" } */
+int main() { return 0; } /* { dg-warning "no newline" } */ \ No newline at end of file
diff --git a/gcc/testsuite/gcc.apple/align-test-1.c b/gcc/testsuite/gcc.apple/align-test-1.c
new file mode 100644
index 00000000000..e8493c0e260
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-1.c
@@ -0,0 +1,613 @@
+/* APPLE LOCAL file Macintosh alignment */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-long-long" } */
+
+/*
+ * Macintosh compiler alignment test for C.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ */
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#define Q(x) #x, x
+
+typedef unsigned char UINT8;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+/* === basic types === */
+
+typedef struct B1 {
+ char f1;
+ UINT8 f2;
+} B1;
+
+typedef struct B2 {
+ short f1;
+ UINT8 f2;
+} B2;
+
+typedef struct B3 {
+ long f1;
+ UINT8 f2;
+} B3;
+
+typedef struct B4 {
+ int f1;
+ UINT8 f2;
+} B4;
+
+typedef struct B5 {
+ float f1;
+ UINT8 f2;
+} B5;
+
+/* doubles, long longs, and vectors are treated separately below. */
+
+/* === enums === */
+
+typedef enum E1 {
+ e1_b = 0,
+ e1_e = 255
+} E1;
+
+typedef enum E2 {
+ e2_b = -256,
+ e2_e = 255
+} E2;
+
+typedef enum E3 {
+ e3_b = 0,
+ e3_e = 32767
+} E3;
+
+typedef enum E4 {
+ e4_b = 0,
+ e4_e = 65536
+} E4;
+
+/* === pointers === */
+
+typedef struct P1 {
+ char * f1;
+ UINT8 f2;
+} P1;
+
+typedef struct P2 {
+ long * f1;
+ UINT8 f2;
+} P2;
+
+typedef struct P3 {
+ double * f1;
+ UINT8 f2;
+} P3;
+
+typedef struct P4 {
+ long long * f1;
+ UINT8 f2;
+} P4;
+
+typedef struct P5 {
+ void (* f1) (void);
+ UINT8 f2;
+} P5;
+
+#ifdef __VEC__
+typedef struct P61 {
+ vector signed short * f1;
+ UINT8 f2;
+} P6;
+#endif
+
+/* === vectors === */
+
+#ifdef __VEC__
+typedef struct V1 {
+ vector signed short f1;
+ UINT8 f2;
+} V1;
+
+typedef struct V2 {
+ V1 f1;
+ UINT8 f2;
+} V2;
+
+typedef struct V3 {
+ UINT8 f1;
+ vector signed short f2;
+} V3;
+
+typedef struct V4 {
+ V3 f1;
+ UINT8 f2;
+} V4;
+#endif
+
+/* === doubles === */
+
+typedef struct D1 {
+ double f1;
+ UINT8 f2;
+} D1;
+
+typedef struct D2 {
+ D1 f1;
+ UINT8 f2;
+} D2;
+
+typedef struct D3 {
+ UINT8 f1;
+ double f2;
+} D3;
+
+typedef struct D4 {
+ D3 f1;
+ UINT8 f2;
+} D4;
+
+typedef struct D5 {
+ UINT8 f1;
+ D3 f2;
+} D5;
+
+typedef struct D6 {
+ double f1;
+ UINT8 f2;
+ double f3;
+} D6;
+
+typedef struct D7 {
+ UINT8 f1;
+ D1 f2;
+} D7;
+
+/* === long longs === */
+
+typedef struct LL1 {
+ long long f1;
+ UINT8 f2;
+} LL1;
+
+typedef struct LL2 {
+ LL1 f1;
+ UINT8 f2;
+} LL2;
+
+typedef struct LL3 {
+ UINT8 f1;
+ long long f2;
+} LL3;
+
+typedef struct LL4 {
+ LL3 f1;
+ UINT8 f2;
+} LL4;
+
+typedef struct LL5 {
+ UINT8 f1;
+ LL3 f2;
+} LL5;
+
+/* === arrays === */
+
+typedef struct A1 {
+ short f1[4];
+ UINT8 f2;
+} A1;
+
+typedef struct A2 {
+ A1 f1;
+ UINT8 f2;
+} A2;
+
+typedef struct A3 {
+ double f1[4];
+ UINT8 f2;
+} A3;
+
+typedef struct A4 {
+ A3 f1;
+ UINT8 f2;
+} A4;
+
+typedef struct A5 {
+ long long f1[4];
+ UINT8 f2;
+} A5;
+
+typedef struct A6 {
+ A5 f1;
+ UINT8 f2;
+} A6;
+
+#ifdef __VEC__
+typedef struct A7 {
+ vector signed short f1[4];
+ UINT8 f2;
+} A7;
+
+typedef struct A8 {
+ A7 f1;
+ UINT8 f2;
+} A8;
+#endif
+
+typedef struct A9 {
+ D1 f1[4];
+ UINT8 f2;
+} A9;
+
+typedef struct A10 {
+ A9 f1;
+ UINT8 f2;
+} A10;
+
+/* === unions === */
+
+typedef union U1 {
+ UINT8 f1;
+ double f2;
+} U1;
+
+typedef struct U2 {
+ U1 f1;
+ UINT8 f2;
+} U2;
+
+typedef union U3 {
+ UINT8 f1;
+ long long f2;
+} U3;
+
+typedef struct U4 {
+ U3 f1;
+ UINT8 f2;
+} U4;
+
+#ifdef __VEC__
+typedef union U5 {
+ UINT8 f1;
+ vector signed short f2;
+} U5;
+
+typedef struct U6 {
+ U5 f1;
+ UINT8 f2;
+} U6;
+#endif
+
+typedef union U7 {
+ UINT8 f1;
+ short f2[4];
+} U7;
+
+typedef struct U8 {
+ U7 f1;
+ UINT8 f2;
+} U8;
+
+/* === misc === */
+
+typedef struct { /* unnamed struct */
+ long long f1;
+ UINT8 f2;
+} M0;
+
+typedef struct M1 {
+ UINT8 f1[8];
+} M1;
+
+typedef struct M2 {
+ M1 f1;
+ UINT8 f2;
+} M2;
+
+typedef struct M3 {
+ UINT8 f1;
+ M1 f2;
+} M3;
+
+typedef struct M4 { /* M4 & M5: see corresponding mac68k tests (M68K11 & M68K12) */
+ UINT8 f1[9];
+} M4;
+
+typedef struct M5 {
+ UINT8 f1;
+ M4 f2;
+} M5;
+
+/* === mac68k === */
+
+#ifndef __LP64__
+#pragma options align=mac68k
+
+typedef struct M68K0 {
+ long f1;
+ UINT8 f2;
+} M68K0;
+
+typedef struct M68K1 {
+ double f1;
+ UINT8 f2;
+} M68K1;
+
+#pragma options align=reset
+
+typedef struct M68K2 {
+ M68K1 f1;
+ UINT8 f2;
+} M68K2;
+
+#ifdef __VEC__
+#pragma options align=mac68k
+
+typedef struct M68K3 {
+ vector signed short f1;
+ UINT8 f2;
+} M68K3;
+
+typedef struct M68K4 {
+ M68K3 f1;
+ UINT8 f2;
+} M68K4;
+
+#pragma options align=reset
+
+typedef struct M68K5 {
+ M68K3 f1;
+ UINT8 f2;
+} M68K5;
+
+#pragma options align=mac68k
+
+typedef struct M68K6 {
+ UINT8 f1;
+ vector signed short f2;
+} M68K6;
+
+#pragma options align=reset
+#endif /* __VEC__ */
+
+#pragma options align=mac68k
+
+typedef struct M68K7 {
+ UINT8 f1;
+} M68K7;
+
+typedef union M68K8 {
+ UINT8 f1;
+} M68K8;
+
+typedef struct M68K9 {
+ UINT8 f1;
+ int f2;
+ UINT8 f3;
+} M68K9;
+
+#pragma options align=reset
+
+typedef struct M68K10 {
+ UINT8 f1;
+ M68K9 f2;
+} M68K10;
+
+#pragma options align=mac68k
+
+typedef struct M68K11 { /* M68K11 & M68K12: see corresponding power tests (M4 & M5) */
+ UINT8 f1[9];
+} M68K11;
+
+typedef struct M68K12 {
+ UINT8 f1;
+ M68K11 f2;
+} M68K12;
+
+typedef struct M68K13 {
+ UINT8 f1;
+ UINT8 f2[5];
+} M68K13;
+
+#pragma options align=reset
+#endif /* n __LP64__ */
+
+static void check(char * rec_name, int actual, int expected32, int expected64,
+ int expected_ia32, char * comment)
+{
+ int expected;
+#ifdef __i386__
+ expected = expected_ia32;
+#else
+ expected = ((sizeof(char *) == 8) ? expected64 : expected32);
+#endif
+ if (flag_verbose || (actual != expected)) {
+ printf("%-20s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+ /* === basic data types === */
+
+ check(Q(sizeof(char)), 1, 1, 1, "char data type");
+ check(Q(sizeof(signed char)), 1, 1, 1, "signed char data type");
+ check(Q(sizeof(unsigned char)), 1, 1, 1, "unsigned char data type");
+ check(Q(sizeof(short)), 2, 2, 2, "short data type");
+ check(Q(sizeof(signed short)), 2, 2, 2, "signed short data type");
+ check(Q(sizeof(unsigned short)), 2, 2, 2, "unsigned short data type");
+ check(Q(sizeof(long)), 4, 8, 4, "short long type");
+ check(Q(sizeof(signed long)), 4, 8, 4, "signed long data type");
+ check(Q(sizeof(unsigned long)), 4, 8, 4, "unsigned long data type");
+ check(Q(sizeof(int)), 4, 4, 4, "short int type");
+ check(Q(sizeof(signed int)), 4, 4, 4, "signed int data type");
+ check(Q(sizeof(unsigned int)), 4, 4, 4, "unsigned int data type");
+ check(Q(sizeof(float)), 4, 4, 4, "float type");
+ check(Q(sizeof(double)), 8, 8, 8, "double data type");
+ check(Q(sizeof(long long)), 8, 8, 8, "long long data type");
+ check(Q(sizeof(signed long long)), 8, 8, 8, "signed long long data type");
+ check(Q(sizeof(unsigned long long)), 8, 8, 8, "unsigned long long data type");
+
+ check(Q(sizeof(B1)), 2, 2, 2, "char as 1st field");
+ check(Q(sizeof(B2)), 4, 4, 4, "short as 1st field");
+ check(Q(sizeof(B3)), 8, 16, 8, "long as 1st field");
+ check(Q(sizeof(B4)), 8, 8, 8, "int as 1st field");
+ check(Q(sizeof(B5)), 8, 8, 8, "float as 1st field");
+
+ /* === enums === */
+
+ check(Q(sizeof(E1)), 4, 4, 4, "enum with range 0..255");
+ check(Q(sizeof(E2)), 4, 4, 4, "enum with range -256..255");
+ check(Q(sizeof(E3)), 4, 4, 4, "enum with range 0..32767");
+ check(Q(sizeof(E4)), 4, 4, 4, "enum with range 0..65536");
+
+ /* === pointers === */
+
+ check(Q(sizeof(P1)), 8, 16, 8, "char * as 1st field");
+ check(Q(sizeof(P2)), 8, 16, 8, "long * as 1st field");
+ check(Q(sizeof(P3)), 8, 16, 8, "double * as 1st field");
+ check(Q(sizeof(P4)), 8, 16, 8, "long long * as 1st field");
+ check(Q(sizeof(P5)), 8, 16, 8, "function * as 1st field");
+
+#ifdef __VEC__
+ check(Q(sizeof(P6)), 8, 16, 8, "vector signed short * as 1st field");
+#endif
+
+#ifdef __VEC__
+ /* === vectors === */
+
+ /* ??? Do we want to test all the possible vector data types? ??? */
+ check(Q(sizeof(vector signed short)), 16, 16, 16, "vector signed short data type");
+
+ check(Q(sizeof(V1)), 32, 32, 32, "vector as 1st field");
+ check(Q(sizeof(V2)), 48, 48, 48, "embedding struct with vector as 1st field");
+ check(Q(sizeof(V3)), 32, 32, 32, "vector as 2nd field");
+ check(Q(offsetof(V3, f2)), 16, 16, 16, "offset of vector as 2nd field");
+ check(Q(sizeof(V4)), 48, 48, 48, "embedding struct with vector as 2nd field");
+#endif
+
+ /* === doubles === */
+
+ check(Q(sizeof(D1)), 16, 16, 12, "double as 1st field");
+ check(Q(sizeof(D2)), 24, 24, 16, "embedding struct with double as 1st field");
+ check(Q(sizeof(D3)), 12, 16, 12, "double as 2nd field");
+ check(Q(offsetof(D3, f2)), 4, 8, 4, "offset of double as 2nd field");
+ check(Q(sizeof(D4)), 16, 24, 16, "embedding struct with double as 2nd field");
+ check(Q(sizeof(D5)), 16, 24, 16, "struct with double as 2nd field");
+ check(Q(offsetof(D5, f2)), 4, 8, 4, "offset of struct with double as 2nd field");
+ check(Q(sizeof(D6)), 24, 24, 20, "struct with double, char, double");
+ check(Q(offsetof(D6, f3)), 12, 16, 12, "offset of 2nd double in struct with double, char, double");
+ check(Q(sizeof(D7)), 20, 24, 16, "struct with double as 2nd field of another struct");
+ check(Q(offsetof(D7, f2)), 4, 8, 4, "offset of struct with double as 2nd field of another struct");
+
+ /* === long longs === */
+
+ check(Q(sizeof(LL1)), 16, 16, 12, "long long as 1st field");
+ check(Q(sizeof(LL2)), 24, 24, 16, "embedding struct with long long as 1st field");
+ check(Q(sizeof(LL3)), 12, 16, 12, "long long as 2nd field");
+ check(Q(offsetof(LL3, f2)), 4, 8, 4, "offset of long long as 2nd field");
+ check(Q(sizeof(LL4)), 16, 24, 16, "embedding struct with long long as 2nd field");
+ check(Q(sizeof(LL5)), 16, 24, 16, "struct with long long as 2nd field");
+ check(Q(offsetof(LL5, f2)), 4, 8, 4, "offset of struct with long long as 2nd field");
+
+ /* === arrays === */
+
+ check(Q(sizeof(A1)), 10, 10, 10, "array of shorts as 1st field");
+ check(Q(sizeof(A2)), 12, 12, 12, "embedding struct with array of shorts as 1st field");
+ check(Q(sizeof(A3)), 40, 40, 36, "array of doubles as 1st field");
+ check(Q(sizeof(A4)), 48, 48, 40, "embedding struct with array of doubles as 1st field");
+ check(Q(sizeof(A5)), 40, 40, 36, "array of long longs as 1st field");
+ check(Q(sizeof(A6)), 48, 48, 40, "embedding struct with array of long longs as 1st field");
+#ifdef __VEC__
+ check(Q(sizeof(A7)), 80, 80, 80, "array of vectors as 1st field");
+ check(Q(sizeof(A8)), 96, 96, 96, "embedding struct with array of vectors as 1st field");
+#endif
+ check(Q(sizeof(A9)), 72, 72, 52, "array of structs as 1st field");
+ check(Q(sizeof(A10)), 80, 80, 56, "embedding struct with array of structs as 1st field");
+
+ /* === unions === */
+
+ check(Q(sizeof(U1)), 8, 8, 8, "union with double");
+ check(Q(sizeof(U2)), 16, 16, 12, "embedding union with double");
+ check(Q(sizeof(U3)), 8, 8, 8, "union with long long");
+ check(Q(sizeof(U4)), 16, 16, 12, "embedding union with long long");
+#if __VEC__
+ check(Q(sizeof(U5)), 16, 16, 16, "union with vector");
+ check(Q(sizeof(U6)), 32, 32, 32, "embedding union with vector");
+#endif
+ check(Q(sizeof(U7)), 8, 8, 8, "union with array of shorts");
+ check(Q(sizeof(U8)), 10, 10, 10, "embedding union with array of shorts");
+
+ /* === misc === */
+
+ check(Q(sizeof(M0)), 16, 16, 12, "untagged struct with long long as 1st field");
+ check(Q(sizeof(M1)), 8, 8, 8, "array[8] of char");
+ check(Q(sizeof(M2)), 9, 9, 9, "embedding struct with array[8] of char as 1st field");
+ check(Q(sizeof(M3)), 9, 9, 9, "embedding struct with array[8] of char as 2nd field");
+ check(Q(offsetof(M3, f2)), 1, 1, 1, "offset of struct with array[8] of char as 2nd field");
+ check(Q(sizeof(M4)), 9, 9, 9, "odd size struct: array[9] of char");
+ check(Q(sizeof(M5)), 10, 10, 10, "embedding odd size struct");
+
+ /* === mac68k mode === */
+
+#ifndef __LP64__
+ check(Q(sizeof(M68K0)), 6, 6, 6, "mac68k struct with long");
+ check(Q(sizeof(M68K1)), 10, 10, 10, "mac68k struct with double as 1st field");
+ check(Q(sizeof(M68K2)), 12, 12, 12, "embedding mac68k struct with double as 1st field");
+#ifdef __VEC__
+ check(Q(sizeof(M68K3)), 32, 32, 32, "mac68k struct with vector as 1st field");
+ check(Q(sizeof(M68K4)), 48, 48, 48, "embedding mac68k struct with vector as 1st field in a mac68k struct");
+ check(Q(sizeof(M68K5)), 48, 48, 48, "embedding mac68k struct with vector as 1st field in a power struct");
+ check(Q(offsetof(M68K6, f2)), 16, 16, 16, "offset of vector as 2nd field in a mac68k struct");
+#endif
+ check(Q(sizeof(M68K7)), 2, 2, 2, "padding of mac68k struct with one char");
+ check(Q(sizeof(M68K8)), 2, 2, 2, "padding of mac68k union with one char");
+ check(Q(sizeof(M68K9)), 8, 8, 8, "padding of mac68k struct");
+ check(Q(offsetof(M68K9, f2)), 2, 2, 2, "offset of int as 2nd field in a mac68k struct");
+ check(Q(sizeof(M68K10)), 10, 10, 10, "power struct with embedded mac68k struct");
+ check(Q(offsetof(M68K10, f2)), 2, 2, 2, "offset of mac68k struct as 2nd field in a power struct");
+ check(Q(sizeof(M68K11)), 10, 10, 10, "odd size struct (before padding): array[9] of char");
+ check(Q(sizeof(M68K12)), 12, 12, 12, "embedding odd size struct (before padding)");
+ check(Q(sizeof(M68K13)), 6, 6, 6, "array of char at odd addr in mac68k struct");
+ check(Q(offsetof(M68K13, f2)), 1, 1, 1, "offset of array of char at odd addr in mac68k struct");
+#endif
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/align-test-2.c b/gcc/testsuite/gcc.apple/align-test-2.c
new file mode 100644
index 00000000000..c78b8e390a4
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-2.c
@@ -0,0 +1,163 @@
+/* APPLE LOCAL file Macintosh alignment */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-long-long" } */
+
+/*
+ * Macintosh compiler alignment test for alignment extensions in GCC 3.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ */
+
+ /* Check whether we are testing GCC 3 or later. */
+#ifdef __GNUC__
+#if __GNUC__ >= 3
+ #define GCC3 1
+#endif
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#define Q(x) #x, x
+
+typedef unsigned char UINT8;
+typedef unsigned long UINT32;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+/* === alignment modes === */
+
+typedef struct S1 {
+ UINT8 f1;
+} S1;
+
+#ifndef __LP64__
+#pragma options align=mac68k
+
+typedef struct S2 {
+ UINT8 f1;
+} S2;
+#endif
+
+#pragma options align=native
+
+typedef struct S3 {
+ UINT8 f1;
+} S3;
+
+#pragma options align=reset
+/* Should be mac68k mode here. */
+
+#ifndef __LP64__
+#pragma options align=reset
+#endif
+/* Should be power mode here. */
+
+typedef struct S4 {
+ UINT8 f1;
+ double f2;
+} S4;
+
+#pragma options align=natural
+
+typedef struct S5 {
+ UINT8 f1;
+ double f2;
+} S5;
+
+typedef struct S6 {
+ UINT8 f1;
+ double f2;
+ UINT8 f3;
+} S6;
+
+#pragma options align=reset
+/* Should be power mode here. */
+
+#pragma options align=packed
+
+typedef struct S7 {
+ UINT8 f1;
+ UINT32 f2;
+} S7;
+
+#pragma options align=reset
+/* Should be power mode here. */
+
+typedef struct S8 {
+ UINT8 f1;
+ UINT32 f2;
+} S8;
+
+static void check(char * rec_name, int actual, int expected32, int expected64,
+ int expected_ia32, char * comment)
+{
+ int expected;
+#ifdef __i386__
+ expected = expected_ia32;
+#else
+ expected = ((sizeof(char *) == 8) ? expected64 : expected32);
+#endif
+ if (flag_verbose || (actual != expected)) {
+ printf("%-20s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+#ifndef GCC3
+ printf("This test requires GCC 3");
+ return 1;
+#endif
+
+ check(Q(sizeof(S1)), 1, 1, 1, "struct with 1 char; power mode");
+#ifndef __LP64__
+ check(Q(sizeof(S2)), 2, 2, 2, "struct with 1 char; mac68k mode");
+#endif
+ check(Q(sizeof(S3)), 1, 1, 1, "struct with 1 char; native mode");
+ check(Q(sizeof(S4)), 12, 16, 12, "struct with char, double; power/natural mode");
+ check(Q(offsetof(S4, f2)), 4, 8, 4, "offset of double in a struct with char, double; power/natural mode");
+ check(Q(sizeof(S5)), 16, 16, 12, "struct with char, double; natural mode");
+ check(Q(offsetof(S5, f2)), 8, 8, 4, "offset of double in a struct with char, double; natural mode");
+ check(Q(sizeof(S6)), 24, 24, 16, "struct with char, double, char; natural mode");
+ check(Q(sizeof(S7)), 5, 9, 5, "struct with char, long; packed mode");
+ check(Q(sizeof(S8)), 8, 16, 8, "struct with char, long; power/natural mode");
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/align-test-3.c b/gcc/testsuite/gcc.apple/align-test-3.c
new file mode 100644
index 00000000000..ef806238508
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-3.c
@@ -0,0 +1,136 @@
+/* APPLE LOCAL file Macintosh alignment */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-long-long" } */
+
+/*
+ * GCC alignment test for alignment problems due to interactions
+ * between FSF and Macintosh alignment modes.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ */
+
+#ifdef __LP64__
+int main()
+{
+ return 0;
+}
+#else /* 32-bit */
+
+ /* Check whether we are testing GCC 3 or later. */
+#ifdef __GNUC__
+#if __GNUC__ >= 3
+#define GCC3 1
+#else
+#define GCC3 0
+#endif
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#define Q(x) #x, x
+
+typedef unsigned char UINT8;
+typedef unsigned long UINT32;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+/* === alignment modes === */
+
+#pragma options align=power
+#pragma options align=mac68k
+#pragma pack(1)
+
+typedef struct S0 {
+ UINT32 f1;
+ UINT8 f2;
+} S0;
+
+#pragma options align=reset
+
+/* We should be back in mac68k alignment, if #pragma option align=reset
+ can rest a #pragma pack(n). So check for mac68k alignment. */
+
+typedef struct S1 {
+ UINT32 f1;
+ UINT8 f2;
+} S1;
+
+#if GCC3
+#pragma options align=power
+#pragma options align=mac68k
+//#pragma pack(push, 1)
+//#pragma pack(pop)
+#pragma pack(1)
+#pragma pack()
+
+/* We should be back in mac68k alignment, if #pragma pack()
+ can reset a #pragma pack(n). So check for mac68k alignment. */
+
+typedef struct S2 {
+ UINT32 f1;
+ UINT8 f2;
+} S2;
+#endif /* GCC3 */
+
+static void check(char * rec_name, int actual, int expected_ppc32, int expected_ia32, char * comment)
+{
+ int expected;
+#ifdef __i386__
+ expected = expected_ia32;
+#else
+ expected = expected_ppc32;
+#endif
+ if (flag_verbose || (actual != expected)) {
+ printf("%-20s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+ check(Q(sizeof(S0)), 5, 5, "struct with 1 long, 1 char; pack(1) mode");
+ check(Q(sizeof(S1)), 6, 6, "struct with 1 long, 1 char; should be mac68k mode");
+#if GCC3
+ check(Q(sizeof(S2)), 6, 6, "struct with 1 long, 1 char; should be mac68k mode");
+#endif
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
+
+#endif /* 32-bit */
diff --git a/gcc/testsuite/gcc.apple/align-test-4.c b/gcc/testsuite/gcc.apple/align-test-4.c
new file mode 100644
index 00000000000..dec805161f4
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-4.c
@@ -0,0 +1,233 @@
+/* APPLE LOCAL file Macintosh alignment */
+
+/* { dg-do run } */
+/* { dg-options "-Wno-long-long" } */
+
+/*
+ * GCC alignment test for bit-fields.
+ * This came up initially as an alignment problem in the kernel.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ */
+
+ /* Check whether we are testing GCC 3 or later. */
+#ifdef __GNUC__
+#if __GNUC__ >= 3
+#define GCC3 1
+#else
+#define GCC3 0
+#endif
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+/*
+ * The following defined determines whether we should compare against
+ * the values produced by GCC 2.95 or against the values I expect given
+ * my understanding of the alignment rules.
+ */
+#define USE_GCC2_VALUES 1
+
+#define NAME2(name,mode) mode##_##name
+#define NAME(name,mode) NAME2(name,mode)
+
+#define STR(s) #s
+#define SIZEOF3(name) STR(sizeof(name)), sizeof(name)
+#define SIZEOF2(name,mode) SIZEOF3(mode##_##name)
+#define SIZEOF(name,mode) SIZEOF2(name,mode)
+
+#define OFFSETOF3(name,field) STR(offsetof(name,field)), offsetof(name,field)
+#define OFFSETOF2(name,mode,field) OFFSETOF3(mode##_##name,field)
+#define OFFSETOF(name,mode,field) OFFSETOF2(name,mode,field)
+
+typedef unsigned char UINT8;
+typedef unsigned long UINT32;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+/* === mac68k alignment problem in kernel === */
+
+typedef unsigned PEF_UBits32, ByteCount;
+typedef short SInt16;
+
+/* === power === */
+#pragma options align=power
+#define MODE power
+#include "align-test-4.h"
+
+#ifndef __LP64__
+/* === mac68k === */
+#pragma options align=mac68k
+#undef MODE
+#define MODE mac68k
+#include "align-test-4.h"
+#endif
+
+/* === pack(2) === */
+#pragma pack(2)
+#undef MODE
+#define MODE pack2
+#include "align-test-4.h"
+
+
+static void check(char * rec_name, int actual, int expected32, int expected64,
+ int expected_ia32, char * comment)
+{
+ int expected;
+#ifdef __i386__
+ expected = expected_ia32;
+#else
+ expected = ((sizeof(char *) == 8) ? expected64 : expected32);
+#endif
+ if (flag_verbose || (actual != expected)) {
+ printf("%-30s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+#undef MODE
+#define MODE power
+
+#if USE_GCC2_VALUES
+ check(SIZEOF(LoaderExport, MODE), 12, 12, 12, "kernel struct");
+ check(OFFSETOF(LoaderExport, MODE, offset), 4, 4, 4, "offset of offset");
+ check(OFFSETOF(LoaderExport, MODE, sectionNumber), 8, 8, 8, "offset of sectionNumber");
+ check(SIZEOF(S1, MODE), 8, 8, 8, "bitfields & char");
+ check(SIZEOF(S2, MODE), 8, 8, 8, "int & char");
+ check(SIZEOF(S3, MODE), 12, 12, 12, "char, bitfields(32), char");
+ check(OFFSETOF(S3, MODE, f3), 8, 8, 8, "offset of 2nd char");
+ check(SIZEOF(S4, MODE), 8, 8, 8, "char, bitfields(32), char");
+ check(OFFSETOF(S4, MODE, f3), 7, 7, 7, "offset of 2nd char");
+ check(SIZEOF(S5, MODE), 4, 4, 4, "char, bitfields(16), char");
+ check(OFFSETOF(S5, MODE, f3), 3, 3, 3, "offset of 2nd char");
+ check(SIZEOF(S6, MODE), 4, 4, 4, "char, bitfields(8), char");
+ check(OFFSETOF(S6, MODE, f3), 2, 2, 2, "offset of 2nd char");
+#else
+ check(SIZEOF(LoaderExport, MODE), 12, 12, "kernel struct");
+ check(OFFSETOF(LoaderExport, MODE, offset), 4, 4, "offset of offset");
+ check(OFFSETOF(LoaderExport, MODE, sectionNumber), 8, 8, "offset of sectionNumber");
+ check(SIZEOF(S1, MODE), 8, 8, "bitfields & char");
+ check(SIZEOF(S2, MODE), 8, 8, "int & char");
+ check(SIZEOF(S3, MODE), 12, 12, "char, bitfields(32), char");
+ check(OFFSETOF(S3, MODE, f3), 8, 8, "offset of 2nd char");
+ check(SIZEOF(S4, MODE), 12, 12, "char, bitfields(32), char");
+ check(OFFSETOF(S4, MODE, f3), 8, 8, "offset of 2nd char");
+ check(SIZEOF(S5, MODE), 12, 12, "char, bitfields(16), char");
+ check(OFFSETOF(S5, MODE, f3), 8, 8, "offset of 2nd char");
+ check(SIZEOF(S6, MODE), 12, 12, "char, bitfields(8), char");
+ check(OFFSETOF(S6, MODE, f3), 8, 8, "offset of 2nd char");
+#endif
+
+#ifndef __LP64__
+#undef MODE
+#define MODE mac68k
+
+#if USE_GCC2_VALUES
+ check(SIZEOF(LoaderExport, MODE), 10, 10, 10, "kernel struct");
+ check(OFFSETOF(LoaderExport, MODE, offset), 4, 4, 4, "offset of offset");
+ check(OFFSETOF(LoaderExport, MODE, sectionNumber), 8, 8, 8, "offset of sectionNumber");
+#if 1
+ // GCC 2 is wrong on the following.
+ check(SIZEOF(S1, MODE), 6, 6, 6, "bitfields & char");
+#else
+ check(SIZEOF(S1, MODE), 8, 8, "bitfields & char");
+#endif
+ check(SIZEOF(S2, MODE), 6, 6, 6, "int & char");
+ check(SIZEOF(S3, MODE), 6, 6, 6, "char, bitfields(32), char");
+ check(OFFSETOF(S3, MODE, f3), 5, 5, 5, "offset of 2nd char");
+ check(SIZEOF(S4, MODE), 6, 6, 6, "char, bitfields(32), char");
+ check(OFFSETOF(S4, MODE, f3), 5, 5, 5, "offset of 2nd char");
+ check(SIZEOF(S5, MODE), 4, 4, 4, "char, bitfields(16), char");
+ check(OFFSETOF(S5, MODE, f3), 3, 3, 3, "offset of 2nd char");
+ check(SIZEOF(S6, MODE), 4, 4, 4, "char, bitfields(8), char");
+ check(OFFSETOF(S6, MODE, f3), 2, 2, 2, "offset of 2nd char");
+#else
+ check(SIZEOF(LoaderExport, MODE), 10, 10, "kernel struct");
+ check(OFFSETOF(LoaderExport, MODE, offset), 4, 4, "offset of offset");
+ check(OFFSETOF(LoaderExport, MODE, sectionNumber), 8, 8, "offset of sectionNumber");
+ check(SIZEOF(S1, MODE), 6, 6, "bitfields & char");
+ check(SIZEOF(S2, MODE), 6, 6, "int & char");
+ check(SIZEOF(S3, MODE), 8, 8, "char, bitfields(32), char");
+ check(OFFSETOF(S3, MODE, f3), 6, 6, "offset of 2nd char");
+ check(SIZEOF(S4, MODE), 8, 8, "char, bitfields(32), char");
+ check(OFFSETOF(S4, MODE, f3), 6, 6, "offset of 2nd char");
+ check(SIZEOF(S5, MODE), 6, 6, "char, bitfields(16), char");
+ check(OFFSETOF(S5, MODE, f3), 4, 4, "offset of 2nd char");
+ check(SIZEOF(S6, MODE), 4, 4, "char, bitfields(8), char");
+ check(OFFSETOF(S6, MODE, f3), 2, 2, "offset of 2nd char");
+#endif
+#endif /* n __LP64__ */
+
+#undef MODE
+#define MODE pack2
+
+#if USE_GCC2_VALUES
+ check(SIZEOF(LoaderExport, MODE), 10, 10, 10, "kernel struct");
+ check(OFFSETOF(LoaderExport, MODE, offset), 4, 4, 4, "offset of offset");
+ check(OFFSETOF(LoaderExport, MODE, sectionNumber), 8, 8, 8, "offset of sectionNumber");
+ /* GCC2 used to have this as '8', but it should really be 6. */
+ check(SIZEOF(S1, MODE), 6, 6, 6, "bitfields & char");
+ check(SIZEOF(S2, MODE), 6, 6, 6, "int & char");
+ check(SIZEOF(S3, MODE), 6, 6, 6, "char, bitfields(32), char");
+ check(OFFSETOF(S3, MODE, f3), 5, 5, 5, "offset of 2nd char");
+ check(SIZEOF(S4, MODE), 6, 6, 6, "char, bitfields(32), char");
+ check(OFFSETOF(S4, MODE, f3), 5, 5, 5, "offset of 2nd char");
+ check(SIZEOF(S5, MODE), 4, 4, 4, "char, bitfields(16), char");
+ check(OFFSETOF(S5, MODE, f3), 3, 3, 3, "offset of 2nd char");
+ check(SIZEOF(S6, MODE), 4, 4, 4, "char, bitfields(8), char");
+ check(OFFSETOF(S6, MODE, f3), 2, 2, 2, "offset of 2nd char");
+#else
+ check(SIZEOF(LoaderExport, MODE), 10, 10, "kernel struct");
+ check(OFFSETOF(LoaderExport, MODE, offset), 4, 4, "offset of offset");
+ check(OFFSETOF(LoaderExport, MODE, sectionNumber), 8, 8, "offset of sectionNumber");
+ check(SIZEOF(S1, MODE), 6, 6, "bitfields & char");
+ check(SIZEOF(S2, MODE), 6, 6, "int & char");
+ check(SIZEOF(S3, MODE), 8, 8, "char, bitfields(32), char");
+ check(OFFSETOF(S3, MODE, f3), 6, 6, "offset of 2nd char");
+ check(SIZEOF(S4, MODE), 8, 8, "char, bitfields(32), char");
+ check(OFFSETOF(S4, MODE, f3), 6, 6, "offset of 2nd char");
+ check(SIZEOF(S5, MODE), 6, 6, "char, bitfields(16), char");
+ check(OFFSETOF(S5, MODE, f3), 4, 4, "offset of 2nd char");
+ check(SIZEOF(S6, MODE), 4, 4, "char, bitfields(8), char");
+ check(OFFSETOF(S6, MODE, f3), 2, 2, "offset of 2nd char");
+#endif
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/align-test-4.h b/gcc/testsuite/gcc.apple/align-test-4.h
new file mode 100644
index 00000000000..f7c18727fee
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-4.h
@@ -0,0 +1,43 @@
+/* APPLE LOCAL file Macintosh alignment */
+
+typedef struct {
+ PEF_UBits32 symClass : 8;
+ PEF_UBits32 nameOffset : 24;
+ ByteCount offset;
+ SInt16 sectionNumber;
+} NAME(LoaderExport, MODE);
+
+typedef struct {
+ unsigned f1 : 32;
+ char f2;
+} NAME(S1, MODE);
+
+typedef struct {
+ unsigned f1;
+ char f2;
+} NAME(S2, MODE);
+
+typedef struct {
+ char f1;
+ unsigned f2 : 32;
+ char f3;
+} NAME(S3, MODE);
+
+typedef struct {
+ char f1;
+ unsigned f2_1 : 8;
+ unsigned f2_2 : 24;
+ char f3;
+} NAME(S4, MODE);
+
+typedef struct {
+ char f1;
+ unsigned f2 : 16;
+ char f3;
+} NAME(S5, MODE);
+
+typedef struct {
+ char f1;
+ unsigned f2 : 8;
+ char f3;
+} NAME(S6, MODE);
diff --git a/gcc/testsuite/gcc.apple/align-test-5a.c b/gcc/testsuite/gcc.apple/align-test-5a.c
new file mode 100644
index 00000000000..10c7d8ad7c3
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-5a.c
@@ -0,0 +1,87 @@
+/* APPLE LOCAL file Macintosh alignment */
+/* align-test-5*.c are all the same code but with different options. */
+
+/* { dg-do run { target "powerpc-*-darwin*" } } */
+/* { dg-options "-malign-natural -DSIZE=16" } */
+
+/*
+ * GCC alignment test for command line options for setting alignment modes.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ * (C) 2000-2002.
+ * Last modified 2002-2-18.
+ *
+ */
+
+ /* Check whether we are testing GCC 3 or later. */
+#ifdef __GNUC__
+#if __GNUC__ >= 3
+#define GCC3 1
+#else
+#define GCC3 0
+#endif
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#define Q(x) #x, x
+
+typedef unsigned char UINT8;
+typedef unsigned long UINT32;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+typedef struct S0 {
+ UINT8 f1;
+ double f2;
+} S0;
+
+static void check(char * rec_name, int actual, int expected, char * comment)
+{
+ if (flag_verbose || (actual != expected)) {
+ printf("%-20s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+ check(Q(sizeof(S0)), SIZE, "struct with 1 char, 1 double");
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/align-test-5b.c b/gcc/testsuite/gcc.apple/align-test-5b.c
new file mode 100644
index 00000000000..a44d8cb4d8f
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-5b.c
@@ -0,0 +1,87 @@
+/* APPLE LOCAL file Macintosh alignment */
+/* align-test-5*.c are all the same code but with different options. */
+
+/* { dg-do run } */
+/* { dg-options "-malign-power -DSIZE=12" } */
+
+/* We have a different test to pick up the warning from 64-bit case. */
+/* { dg-xfail-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */
+
+/*
+ * GCC alignment test for command line options for setting alignment modes.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ */
+
+ /* Check whether we are testing GCC 3 or later. */
+#ifdef __GNUC__
+#if __GNUC__ >= 3
+#define GCC3 1
+#else
+#define GCC3 0
+#endif
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#define Q(x) #x, x
+
+typedef unsigned char UINT8;
+typedef unsigned long UINT32;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+typedef struct S0 {
+ UINT8 f1;
+ double f2;
+} S0;
+
+static void check(char * rec_name, int actual, int expected, char * comment)
+{
+ if (flag_verbose || (actual != expected)) {
+ printf("%-20s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+ check(Q(sizeof(S0)), SIZE, "struct with 1 char, 1 double");
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/align-test-5c.c b/gcc/testsuite/gcc.apple/align-test-5c.c
new file mode 100644
index 00000000000..707a9c6a215
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-5c.c
@@ -0,0 +1,87 @@
+/* APPLE LOCAL file Macintosh alignment */
+/* align-test-5*.c are all the same code but with different options. */
+
+/* { dg-do run } */
+/* { dg-options "-malign-mac68k -DSIZE=10" } */
+
+/* dg-skip-if would be better, should be in the next merge after 2004-01. */
+/* { dg-xfail-if "" { powerpc*-*-darwin* } { "-m64" } { "" } } */
+
+/*
+ * GCC alignment test for command line options for setting alignment modes.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ */
+
+ /* Check whether we are testing GCC 3 or later. */
+#ifdef __GNUC__
+#if __GNUC__ >= 3
+#define GCC3 1
+#else
+#define GCC3 0
+#endif
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#define Q(x) #x, x
+
+typedef unsigned char UINT8;
+typedef unsigned long UINT32;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+typedef struct S0 {
+ UINT8 f1;
+ double f2;
+} S0;
+
+static void check(char * rec_name, int actual, int expected, char * comment)
+{
+ if (flag_verbose || (actual != expected)) {
+ printf("%-20s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+ check(Q(sizeof(S0)), SIZE, "struct with 1 char, 1 double");
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/align-test-5d.c b/gcc/testsuite/gcc.apple/align-test-5d.c
new file mode 100644
index 00000000000..fbbe60f7aa2
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/align-test-5d.c
@@ -0,0 +1,90 @@
+/* APPLE LOCAL file Macintosh alignment */
+/* align-test-5*.c are all the same code but with different options. */
+
+/* { dg-do run { target "i?86-*-darwin*" } } */
+/* { dg-options "-malign-natural -DSIZE=12" } */
+
+/* This is for Intel only. */
+/* { dg-xfail-if "" { powerpc*-*-darwin* } { "" } { "" } } */
+
+/*
+ * GCC alignment test for command line options for setting alignment modes.
+ * Fred Forsman
+ * Apple Computer, Inc.
+ * (C) 2000-2002.
+ * Last modified 2002-2-18.
+ *
+ */
+
+ /* Check whether we are testing GCC 3 or later. */
+#ifdef __GNUC__
+#if __GNUC__ >= 3
+#define GCC3 1
+#else
+#define GCC3 0
+#endif
+#endif
+
+#include <stdio.h>
+#include <stddef.h>
+#include <string.h>
+
+#define Q(x) #x, x
+
+typedef unsigned char UINT8;
+typedef unsigned long UINT32;
+
+static int bad_option = 0;
+static int flag_verbose = 0;
+static int nbr_failures = 0;
+
+typedef struct S0 {
+ UINT8 f1;
+ double f2;
+} S0;
+
+static void check(char * rec_name, int actual, int expected, char * comment)
+{
+ if (flag_verbose || (actual != expected)) {
+ printf("%-20s = %2d (%2d) ", rec_name, actual, expected);
+ if (actual != expected) {
+ printf("*** FAIL");
+ nbr_failures++;
+ } else
+ printf(" PASS");
+ printf(": %s\n", comment);
+ }
+}
+
+static void check_option(char *option)
+{
+ if (*option == '-') {
+ if (strcmp(option, "-v") == 0)
+ flag_verbose = 1;
+ else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+ } else {
+ fprintf(stderr, "*** unrecognized option '%s'.\n", option);
+ bad_option = 1;
+ }
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ for (i = 1; i < argc; i++)
+ check_option(argv[i]);
+
+ if (bad_option)
+ return 1;
+
+ check(Q(sizeof(S0)), SIZE, "struct with 1 char, 1 double");
+
+ if (nbr_failures > 0)
+ return 1;
+ else
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/altivec-1.c b/gcc/testsuite/gcc.apple/altivec-1.c
new file mode 100644
index 00000000000..c8df7f026b9
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-1.c
@@ -0,0 +1,124 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+/* Test for correct handling of AltiVec constants passed
+ through '...' (va_arg). */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define CHECK_INVARIANT(expr) \
+ if (!(expr)) { \
+ printf ("ASSERT FAILED: %d: %s\n", __LINE__, #expr); \
+ abort (); \
+ }
+
+struct foo { int x; int y; };
+struct vfoo { int x; __vector signed int v; int y; };
+union u { __vector signed int v; signed int i[4]; };
+
+struct foo x_g = { 3, 4};
+struct vfoo vx_g = { 10, (vector signed int)(11, 12, 13, 14), 15 };
+__vector signed int v_g = (vector signed int) (22, 23, 24, 25);
+struct vfoo vx2_g = { 30, (vector signed int)(31, 32, 33, 34), 35 };
+__vector signed int v2_g = (vector signed int)(40, 41, 42, 43);
+int i_1 = 99, i_2 = 33;
+double d_2 = 1.5, d_3 = 1.75;
+long double ld_1 = 1.25;
+
+void bar (int i, ... )
+{
+ struct foo xi;
+ double d;
+ long double ld;
+ float f;
+ char c;
+ short s;
+ va_list ap;
+ va_start(ap, i);
+ xi = va_arg(ap, struct foo);
+ s = (short)va_arg(ap, int);
+ f = (float)va_arg(ap, double);
+ ld = va_arg(ap, long double);
+ c = (char)va_arg(ap, int);
+ d = va_arg(ap, double);
+ va_end(ap);
+
+ CHECK_INVARIANT (xi.x == x_g.x && xi.y == x_g.y);
+ CHECK_INVARIANT (s == (short)i_2);
+ CHECK_INVARIANT (f == (float)d_2);
+ CHECK_INVARIANT (ld == ld_1);
+ CHECK_INVARIANT (c == (char)i_1);
+ CHECK_INVARIANT (d == d_3);
+}
+
+void baz (int i, ... )
+{
+ struct vfoo vx, vx2;
+ __vector signed int v_i, v2_i;
+ int j, k, l;
+ va_list ap;
+ va_start(ap, i);
+ v_i = va_arg(ap, __vector signed int);
+ j = va_arg(ap, int);
+ vx = va_arg(ap, struct vfoo);
+ k = va_arg(ap, int);
+ v2_i = va_arg(ap, __vector signed int);
+ l = va_arg(ap, int);
+ vx2 = va_arg(ap, struct vfoo);
+ va_end(ap);
+
+ CHECK_INVARIANT (vec_all_eq (v_i, v_g));
+ CHECK_INVARIANT (j == i_1);
+ CHECK_INVARIANT (vx.x == vx_g.x && vec_all_eq(vx.v, vx_g.v) && vx.y == vx_g.y);
+ CHECK_INVARIANT (k == i_1);
+ CHECK_INVARIANT (vec_all_eq (v2_i, v2_g));
+ CHECK_INVARIANT (l == i_1);
+ CHECK_INVARIANT (vx2.x == vx2_g.x && vec_all_eq(vx2.v, vx2_g.v) && vx2.y == vx2_g.y);
+}
+
+void quux (int i, ... )
+{
+ __vector signed int v_i, v2_i;
+ union u vi, v2i;
+ va_list ap;
+ va_start(ap, i);
+ v_i = va_arg(ap, __vector signed int);
+ v2_i = va_arg(ap, __vector signed int);
+ va_end(ap);
+ vi.v = v_i;
+ v2i.v = v2_i;
+
+ CHECK_INVARIANT (vec_all_eq (v_i, v_g));
+ CHECK_INVARIANT (vec_all_eq (v2_i, v_g));
+ CHECK_INVARIANT (vec_all_eq (vi.v, v_g));
+ CHECK_INVARIANT (vec_all_eq (v2i.v, v_g));
+}
+
+void baz2 (int i, ... )
+{
+ struct vfoo vx;
+ union u vxi;
+ va_list ap;
+ va_start(ap, i);
+ vx = va_arg(ap, struct vfoo);
+ va_end(ap);
+ vxi.v = vx.v;
+
+ CHECK_INVARIANT (vx.x == vx_g.x && vec_all_eq(vx.v, vx_g.v) && vx.y == vx_g.y);
+ CHECK_INVARIANT (vec_all_eq (vxi.v, vx_g.v));
+}
+
+int main(void)
+{
+ CHECK_INVARIANT (sizeof(struct foo) == 8 && sizeof(struct vfoo) == 48);
+
+ bar(i_1, x_g, (short)i_2, (float)d_2, ld_1, (char)i_1, d_3);
+ baz(i_1, v_g, i_1, vx_g, i_1, v2_g, i_1, vx2_g);
+ quux(i_1, v_g, v_g);
+ baz2(i_1, vx_g);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/altivec-19.c b/gcc/testsuite/gcc.apple/altivec-19.c
new file mode 100644
index 00000000000..857962f9f2e
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-19.c
@@ -0,0 +1,15 @@
+/* APPLE LOCAL entire file */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec -pedantic" } */
+
+int main()
+ {
+ typedef unsigned char UC;
+ typedef vector unsigned char VUC;
+
+ const UC kBar = 7;
+ VUC vBar1 = (VUC)(kBar);
+ VUC vBar2 = {kBar};
+ VUC vBar3 = (VUC){kBar};
+ return 0;
+ }
diff --git a/gcc/testsuite/gcc.apple/altivec-2.c b/gcc/testsuite/gcc.apple/altivec-2.c
new file mode 100644
index 00000000000..23eaf3d230d
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-2.c
@@ -0,0 +1,22 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+/* Check whether AltiVec allows for 'bool'
+ and 'pixel' to be #defined to mean other things. */
+
+extern void abort (void);
+#define CHECK_IF(E) if(!(E)) abort()
+
+#define bool char
+#define pixel unsigned char
+
+int main(void) {
+ bool x1;
+ pixel x2;
+
+ CHECK_IF(sizeof(x1) == 1);
+ CHECK_IF(sizeof(x2) == 1);
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/altivec-20.c b/gcc/testsuite/gcc.apple/altivec-20.c
new file mode 100644
index 00000000000..63cc2dba6d8
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-20.c
@@ -0,0 +1,7 @@
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#define vector __attribute__((vector_size(16)))
+
+vector long long vbl; /* { dg-error "use of 'long long' in AltiVec types is invalid" } */
+
diff --git a/gcc/testsuite/gcc.apple/altivec-3.c b/gcc/testsuite/gcc.apple/altivec-3.c
new file mode 100644
index 00000000000..09579468c9b
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-3.c
@@ -0,0 +1,14 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+int main(void)
+{
+ bool b; /* { dg-error ".bool. undeclared" } */
+ /* { dg-error "is reported only once" "" { target *-*-* } 7 } */
+ /* { dg-error "function it appears in" "" { target *-*-* } 7 } */
+ /* { dg-error "(parse|syntax) error" "" { target *-*-* } 7 } */
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/altivec-4.c b/gcc/testsuite/gcc.apple/altivec-4.c
new file mode 100644
index 00000000000..c81cc7676aa
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-4.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+extern void abort();
+
+#include <stdio.h>
+int main()
+{
+ int i;
+ union u {
+ vector signed short uv;
+ signed short val[8];
+ } v;
+
+ vector signed short SpecialConstants = (vector signed short)( 1, 2, 3, 4, 5, 6,7,8);
+ v.uv = SpecialConstants;
+ for (i=0; i < 8; i++)
+ if (v.val[i] != i+1)
+ abort();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/altivec-5.c b/gcc/testsuite/gcc.apple/altivec-5.c
new file mode 100644
index 00000000000..cd9e1888af2
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-5.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file AltiVec 3840704 */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+/* { dg-final { scan-assembler-not "stvx" } } */
+
+void *memset(void *, int, unsigned long int);
+
+struct tm
+{
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+ long tm_gmtoff;
+ char *tm_zone;
+};
+
+
+int asl_send()
+{
+ char *str, *out;
+ unsigned int i, len, level, outstatus;
+ struct tm gtime;
+
+ memset(&gtime, 0, sizeof(struct tm)); /* { dg-warning "disabled" } */
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/altivec-faltivec-1.c b/gcc/testsuite/gcc.apple/altivec-faltivec-1.c
new file mode 100644
index 00000000000..f624187d56e
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-faltivec-1.c
@@ -0,0 +1,135 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-O3 -finline-limit=9999 -faltivec -Wa,-force_cpusubtype_ALL -fdump-ipa-cgraph -S" } */
+/* Inliner should not inline AltiVec(tm) functions when -faltivec is on. */
+/* <rdar://problem/3837835> Selective inlining of functions that use Altivec */
+#include <Carbon/Carbon.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+/* #include <altivec.h> */
+
+#define N 400
+#define N4 ((N+3)/4)
+#define N8 ((N+7)/8)
+
+typedef union
+{
+ signed short sInt[8];
+ vector signed short vInt;
+} IntegerToVector;
+
+static signed long vIntDotProduct (vector signed short [], vector signed short [], long int);
+static int mainInt();
+static Ptr getMemory (size_t);
+
+static int
+mainInt()
+{
+ long int n = N, n8 = N8, m, i, j;
+ signed long vDotProduct, sDotProduct;
+ signed short *sx, *sy;
+ vector signed short *x, *y;
+ IntegerToVector *sX, *sY;
+
+ sx = (short *) getMemory( 4*(n+3) );
+ if (sx == nil)
+ return 0;
+ sy = (short *) getMemory( 4*(n+3) );
+ if (sy == nil)
+ return 0;
+
+ x = (vector signed short *) getMemory( n8*16 );
+ if ( x == nil)
+ return 0;
+ y = (vector signed short *) getMemory( n8*16 );
+ if ( y == nil)
+ return 0;
+
+ sX = (IntegerToVector *) getMemory( n8*16 );
+ if (sX == nil)
+ return 0;
+ sY = (IntegerToVector *) getMemory( n8*16 );
+ if (sY == nil)
+ return 0;
+
+ for ( i = 0; i < n; i++ )
+ {
+ sx[i] = ( signed short ) scalb(( M_PI * ( double ) ( i ) / ( double ) n ), 8) + 0.5;
+ sy[i] = ( signed short ) scalb(( M_PI * ( double ) ( n - i ) / ( double ) n ), 8) + 0.5;
+ }
+
+ m = n % 8;
+ if (m != 0)
+ for (i = n; i < n + 8 - m; i++)
+ {
+ sx[i] = 0.0;
+ sy[i] = 0.0;
+ }
+
+ for ( i = 0; i < n8; i++ )
+ for ( j = 0; j < 8; j++ )
+ {
+ sX[i].sInt[j] = sx[i*8+j];
+ sY[i].sInt[j] = sy[i*8+j];
+ }
+
+ for ( i = 0; i < n8; i++ )
+ {
+ x[i] = sX[i].vInt;
+ y[i] = sY[i].vInt;
+ }
+
+ vDotProduct = vIntDotProduct ( x, y, n8 );
+
+ printf ( "\nVector dot product = %10d\n", (int) vDotProduct );
+
+ return 0;
+}
+
+static Ptr
+getMemory ( size_t amount )
+{
+ Ptr ptr;
+
+ ptr = malloc(amount);
+ if (ptr == nil)
+ printf ("\nUnable to allocate sufficient memory.");
+ return (ptr);
+}
+
+signed long
+vIntDotProduct ( vector signed short x[], vector signed short y[], long int n )
+{
+
+ typedef union
+ {
+ signed long xElem[4];
+ vector signed int vWord;
+ } WordToVector;
+
+ long int i;
+
+ vector signed int partialProduct, zero = ( vector signed int ) { 0,0,0,0 };
+ WordToVector sum;
+
+ partialProduct = zero;
+
+ for ( i = 0; i < n ; i++ )
+ partialProduct = vec_msums ( x[i], y[i], partialProduct );
+
+ sum.vWord = vec_sums( partialProduct, zero);
+
+ return sum.xElem[3];
+}
+
+int
+main()
+{
+ mainInt();
+ exit(0);
+}
+
+/* { dg-final { scan-tree-dump-times "callee has AltiVec" 2 "cgraph" } } */
+/* { dg-final { scan-assembler-not "vIntDotProduct" } } */
+/* { dg-final { scan-assembler "mainInt" } } */
diff --git a/gcc/testsuite/gcc.apple/altivec-faltivec-2.c b/gcc/testsuite/gcc.apple/altivec-faltivec-2.c
new file mode 100644
index 00000000000..fe376397d6c
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-faltivec-2.c
@@ -0,0 +1,135 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-O3 -finline-limit=9999 -faltivec -Wa,-force_cpusubtype_ALL -fdump-ipa-cgraph -S" } */
+/* Inliner should inline always-inline AltiVec(tm) functions when -faltivec is on. */
+/* <rdar://problem/3837835> Selective inlining of functions that use Altivec */
+#include <Carbon/Carbon.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+/* #include <altivec.h> */
+
+#define N 400
+#define N4 ((N+3)/4)
+#define N8 ((N+7)/8)
+
+typedef union
+{
+ signed short sInt[8];
+ vector signed short vInt;
+} IntegerToVector;
+
+static signed long __attribute__ ((always_inline)) vIntDotProduct (vector signed short [], vector signed short [], long int);
+static int __attribute__ ((always_inline)) mainInt();
+static Ptr getMemory (size_t);
+
+static int __attribute__ ((always_inline))
+mainInt()
+{
+ long int n = N, n8 = N8, m, i, j;
+ signed long vDotProduct, sDotProduct;
+ signed short *sx, *sy;
+ vector signed short *x, *y;
+ IntegerToVector *sX, *sY;
+
+ sx = (short *) getMemory( 4*(n+3) );
+ if (sx == nil)
+ return 0;
+ sy = (short *) getMemory( 4*(n+3) );
+ if (sy == nil)
+ return 0;
+
+ x = (vector signed short *) getMemory( n8*16 );
+ if ( x == nil)
+ return 0;
+ y = (vector signed short *) getMemory( n8*16 );
+ if ( y == nil)
+ return 0;
+
+ sX = (IntegerToVector *) getMemory( n8*16 );
+ if (sX == nil)
+ return 0;
+ sY = (IntegerToVector *) getMemory( n8*16 );
+ if (sY == nil)
+ return 0;
+
+ for ( i = 0; i < n; i++ )
+ {
+ sx[i] = ( signed short ) scalb(( M_PI * ( double ) ( i ) / ( double ) n ), 8) + 0.5;
+ sy[i] = ( signed short ) scalb(( M_PI * ( double ) ( n - i ) / ( double ) n ), 8) + 0.5;
+ }
+
+ m = n % 8;
+ if (m != 0)
+ for (i = n; i < n + 8 - m; i++)
+ {
+ sx[i] = 0.0;
+ sy[i] = 0.0;
+ }
+
+ for ( i = 0; i < n8; i++ )
+ for ( j = 0; j < 8; j++ )
+ {
+ sX[i].sInt[j] = sx[i*8+j];
+ sY[i].sInt[j] = sy[i*8+j];
+ }
+
+ for ( i = 0; i < n8; i++ )
+ {
+ x[i] = sX[i].vInt;
+ y[i] = sY[i].vInt;
+ }
+
+ vDotProduct = vIntDotProduct ( x, y, n8 );
+
+ printf ( "\nVector dot product = %10d\n", (int) vDotProduct );
+
+ return 0;
+}
+
+static Ptr
+getMemory ( size_t amount )
+{
+ Ptr ptr;
+
+ ptr = malloc(amount);
+ if (ptr == nil)
+ printf ("\nUnable to allocate sufficient memory.");
+ return (ptr);
+}
+
+signed long __attribute__ ((always_inline))
+vIntDotProduct ( vector signed short x[], vector signed short y[], long int n )
+{
+
+ typedef union
+ {
+ signed long xElem[4];
+ vector signed int vWord;
+ } WordToVector;
+
+ long int i;
+
+ vector signed int partialProduct, zero = ( vector signed int ) { 0,0,0,0 };
+ WordToVector sum;
+
+ partialProduct = zero;
+
+ for ( i = 0; i < n ; i++ )
+ partialProduct = vec_msums ( x[i], y[i], partialProduct );
+
+ sum.vWord = vec_sums( partialProduct, zero);
+
+ return sum.xElem[3];
+}
+
+int
+main()
+{
+ mainInt();
+ exit(0);
+}
+
+/* { dg-final { scan-tree-dump-times "callee has AltiVec" 0 "cgraph" } } */
+/* { dg-final { scan-assembler-not "vIntDotProduct" } } */
+/* { dg-final { scan-assembler-not "mainInt" } } */
diff --git a/gcc/testsuite/gcc.apple/altivec-maltivec-1.c b/gcc/testsuite/gcc.apple/altivec-maltivec-1.c
new file mode 100644
index 00000000000..52181bde5be
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-maltivec-1.c
@@ -0,0 +1,135 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-O3 -finline-limit=9999 -maltivec -Wa,-force_cpusubtype_ALL -fdump-ipa-cgraph -S" } */
+/* Inliner should inline AltiVec(tm) functions normally when -maltivec is on. */
+/* <rdar://problem/3837835> Selective inlining of functions that use Altivec */
+#include <Carbon/Carbon.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <altivec.h>
+
+#define N 400
+#define N4 ((N+3)/4)
+#define N8 ((N+7)/8)
+
+typedef union
+{
+ signed short sInt[8];
+ vector signed short vInt;
+} IntegerToVector;
+
+static signed long vIntDotProduct (vector signed short [], vector signed short [], long int);
+static int mainInt();
+static Ptr getMemory ( size_t amount );
+
+static int
+mainInt()
+{
+ long int n = N, n8 = N8, m, i, j;
+ signed long vDotProduct, sDotProduct;
+ signed short *sx, *sy;
+ vector signed short *x, *y;
+ IntegerToVector *sX, *sY;
+
+ sx = (short *) getMemory( 4*(n+3) );
+ if (sx == nil)
+ return 0;
+ sy = (short *) getMemory( 4*(n+3) );
+ if (sy == nil)
+ return 0;
+
+ x = (vector signed short *) getMemory( n8*16 );
+ if ( x == nil)
+ return 0;
+ y = (vector signed short *) getMemory( n8*16 );
+ if ( y == nil)
+ return 0;
+
+ sX = (IntegerToVector *) getMemory( n8*16 );
+ if (sX == nil)
+ return 0;
+ sY = (IntegerToVector *) getMemory( n8*16 );
+ if (sY == nil)
+ return 0;
+
+ for ( i = 0; i < n; i++ )
+ {
+ sx[i] = ( signed short ) scalb(( M_PI * ( double ) ( i ) / ( double ) n ), 8) + 0.5;
+ sy[i] = ( signed short ) scalb(( M_PI * ( double ) ( n - i ) / ( double ) n ), 8) + 0.5;
+ }
+
+ m = n % 8;
+ if (m != 0)
+ for (i = n; i < n + 8 - m; i++)
+ {
+ sx[i] = 0.0;
+ sy[i] = 0.0;
+ }
+
+ for ( i = 0; i < n8; i++ )
+ for ( j = 0; j < 8; j++ )
+ {
+ sX[i].sInt[j] = sx[i*8+j];
+ sY[i].sInt[j] = sy[i*8+j];
+ }
+
+ for ( i = 0; i < n8; i++ )
+ {
+ x[i] = sX[i].vInt;
+ y[i] = sY[i].vInt;
+ }
+
+ vDotProduct = vIntDotProduct ( x, y, n8 );
+
+ printf ( "\nVector dot product = %10d\n", (int) vDotProduct );
+
+ return 0;
+}
+
+static Ptr
+getMemory ( size_t amount )
+{
+ Ptr ptr;
+
+ ptr = malloc(amount);
+ if (ptr == nil)
+ printf ("\nUnable to allocate sufficient memory.");
+ return (ptr);
+}
+
+static signed long
+vIntDotProduct ( vector signed short x[], vector signed short y[], long int n )
+{
+
+ typedef union
+ {
+ signed long xElem[4];
+ vector signed int vWord;
+ } WordToVector;
+
+ long int i;
+
+ vector signed int partialProduct, zero = ( vector signed int ) { 0,0,0,0 };
+ WordToVector sum;
+
+ partialProduct = zero;
+
+ for ( i = 0; i < n ; i++ )
+ partialProduct = vec_msums ( x[i], y[i], partialProduct );
+
+ sum.vWord = vec_sums( partialProduct, zero);
+
+ return sum.xElem[3];
+}
+
+int
+main()
+{
+ mainInt();
+ exit(0);
+}
+
+/* { dg-final { scan-tree-dump-times "callee has AltiVec" 0 "cgraph" } } */
+/* { dg-final { scan-assembler-not "vIntDotProduct" } } */
+/* { dg-final { scan-assembler-not "mainInt" } } */
diff --git a/gcc/testsuite/gcc.apple/altivec-test-macro.c b/gcc/testsuite/gcc.apple/altivec-test-macro.c
new file mode 100644
index 00000000000..6d5a2dc894d
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/altivec-test-macro.c
@@ -0,0 +1,30 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+#define TYPE unsigned int
+union U {
+ TYPE ui[4];
+ vector TYPE uv;
+} data;
+
+extern void abort();
+
+int main( void )
+{
+ vector unsigned int v = {1,2,3,4};
+ vector TYPE UUUUUU = {10,10,10,10};
+ int i;
+
+ v = vec_add( v, UUUUUU );
+
+ data.uv = v;
+
+ for (i=0; i < 4; i++)
+ if (data.ui[i] != (10+i+1))
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-1.c b/gcc/testsuite/gcc.apple/apple-altivec-1.c
new file mode 100644
index 00000000000..81a5bc1beab
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-1.c
@@ -0,0 +1,64 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec" } */
+
+static vector int x, y;
+
+static vector signed int i,j;
+static vector signed short s,t;
+static vector signed char c,d;
+static vector float f,g;
+static vector unsigned short us;
+
+static vector unsigned char uc;
+
+static vector signed int *pi;
+
+static int int1, int2;
+
+void
+b()
+{
+ vec_add (x, y);
+
+ /* Make sure the predicates accept correct argument types. */
+
+ int1 = vec_all_in (f, g);
+ int1 = vec_all_ne (f, g);
+ int1 = vec_all_ne (c, d);
+ int1 = vec_all_ne (s, t);
+ int1 = vec_all_ne (i, j);
+ int1 = vec_all_nge (f, g);
+ int1 = vec_all_ngt (f, g);
+ int1 = vec_all_ge (c, d);
+ int1 = vec_all_ge (s, t);
+ int1 = vec_all_ge (i, j);
+ int1 = vec_all_ge (c, d);
+ int1 = vec_all_ge (s, t);
+ int1 = vec_all_ge (i, j);
+
+ vec_mtvscr (i);
+ vec_dssall ();
+ us = vec_mfvscr ();
+ vec_dss (3);
+
+ vec_dst (pi, int1 + int2, 3);
+ vec_dstst (pi, int1 + int2, 3);
+ vec_dststt (pi, int1 + int2, 3);
+ vec_dstt (pi, int1 + int2, 3);
+
+ uc = vec_lvsl (int1 + 69, pi);
+ uc = vec_lvsr (int1 + 69, pi);
+
+ c = vec_lde (int1, (vector bool char *)pi);
+ s = vec_lde (int1, (vector pixel *)pi);
+ i = vec_lde (int1, pi);
+ i = vec_ldl (int1, pi);
+ i = vec_ld (int1, pi);
+
+ vec_st (i, int2, pi);
+ vec_ste (c, int2, (vector unsigned char *)pi);
+ vec_ste (s, int2, (vector bool short *)pi);
+ vec_ste (i, int2, pi);
+ vec_stl (i, int2, pi);
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-10.c b/gcc/testsuite/gcc.apple/apple-altivec-10.c
new file mode 100644
index 00000000000..12afefa4c1c
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-10.c
@@ -0,0 +1,81 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+extern void abort();
+
+#include <stdio.h>
+
+int main()
+{
+ char str[128];
+ vector unsigned char
+ vuchar = (vector unsigned char)((vector unsigned int)(0x001f001d, 0x001f001d, 0x001f001d, 0x001f001d));
+
+ vector unsigned short
+ vushort = (vector unsigned short)((vector unsigned int)(0x001f001d, 0x001f001d, 0x001f001d, 0x001f001d));
+
+ vector unsigned char
+ vushort_to_char = (vector unsigned char)
+ ((vector unsigned short)(0x001f,0x001d, 0x001f,0x001d, 0x001f,0x001d, 0x001f,0x001d));
+
+ vector signed char
+ vschar = (vector signed char)((vector signed int)(0x001f001d, 0x001f001d, 0x001f001d, 0x001f001d));
+
+ vector signed short
+ vsshort = (vector signed short)((vector signed int)(0x001f001d, 0x001f001d, 0x001f001d, 0x001f001d));
+
+ vector signed char
+ vsshort_to_char = (vector signed char)
+ ((vector signed short)(0x001f,0x001d, 0x001f,0x001d, 0x001f,0x001d, 0x001f,0x001d));
+
+ vector unsigned int
+ vui = (vector unsigned int)((vector unsigned short)(0x011f,0x021d, 0x031f,0x041d, 0x051f,0x061d, 0x071f,0x081d));
+
+ vector unsigned int
+ vui1 = (vector unsigned int)
+ ((vector unsigned char)(0x01,0x1f,0x02,0x1d, 0x03,0x1f,0x04,0x1d,
+ 0x05,0x1f,0x06,0x1d, 0x07,0x1f,0x08,0x1d));
+
+ vector unsigned short
+ vus = (vector unsigned short)
+ ((vector unsigned char)(0x01,0x1f,0x02,0x1d, 0x03,0x1f,0x04,0x1d,
+ 0x05,0x1f,0x06,0x1d, 0x07,0x1f,0x08,0x1d));
+
+ vector float
+ vf = (vector float)
+ ((vector unsigned int)(0x001f001d, 0x001f001d, 0x001f001d, 0x001f001d));
+
+ sprintf(str, "%vhu", vuchar);
+ if (strcmp (str, "31 29 31 29 31 29 31 29"))
+ abort();
+ sprintf(str, "%vhu", vushort);
+ if (strcmp (str, "31 29 31 29 31 29 31 29"))
+ abort();
+ sprintf(str, "%vhu", vushort_to_char);
+ if (strcmp (str, "31 29 31 29 31 29 31 29"))
+ abort();
+ sprintf(str, "%vhu", vschar);
+ if (strcmp (str, "31 29 31 29 31 29 31 29"))
+ abort();
+ sprintf(str, "%vhu", vsshort);
+ if (strcmp (str, "31 29 31 29 31 29 31 29"))
+ abort();
+ sprintf(str, "%vhu", vsshort_to_char);
+ if (strcmp (str, "31 29 31 29 31 29 31 29"))
+ abort();
+ sprintf(str, "%vd", vui);
+ if (strcmp (str, "1 31 2 29 3 31 4 29 5 31 6 29 7 31 8 29"))
+ abort();
+ sprintf(str, "%vd", vui1);
+ if (strcmp (str, "1 31 2 29 3 31 4 29 5 31 6 29 7 31 8 29"))
+ abort();
+ sprintf(str, "%vd", vus);
+ if (strcmp (str, "1 31 2 29 3 31 4 29 5 31 6 29 7 31 8 29"))
+ abort();
+ sprintf(str, "%vhu", vf);
+ if (strcmp (str, "31 29 31 29 31 29 31 29"))
+ abort();
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-11.c b/gcc/testsuite/gcc.apple/apple-altivec-11.c
new file mode 100644
index 00000000000..6224923c1be
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-11.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+extern void abort();
+
+vector signed int
+vandc(vector signed int a, vector signed int b)
+{
+ return vec_andc(a, b);
+}
+
+int main ()
+{
+ char buf [1024];
+ vector signed int a1 = (vector signed int) (0XFFFFFFFF);
+ vector signed int b1 = (vector signed int) (0X0);
+
+ if (!vec_all_eq (vandc (a1, b1), a1))
+ abort();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-12.c b/gcc/testsuite/gcc.apple/apple-altivec-12.c
new file mode 100644
index 00000000000..c4553368fdd
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-12.c
@@ -0,0 +1,395 @@
+/* APPLE LOCAL file AltiVec */
+/* Check for presence of AltiVec PIM "specific operations". */
+
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec -Wall" } */
+
+vector signed int
+specific_operations( signed int *p)
+{
+ vector unsigned int vui1, vui2;
+ vector unsigned short vus1, vus2;
+ vector unsigned char vuc1, vuc2;
+ vector signed int vsi1, vsi2;
+ vector signed short vss1, vss2;
+ vector signed char vsc1, vsc2;
+ vector bool int vbi1, vbi2;
+ vector bool short vbs1, vbs2;
+ vector bool char vbc1, vbc2;
+ vector float vf1, vf2;
+ vector pixel vp1, vp2;
+
+ vuc1 = vec_lvebx (8, (unsigned char *)p);
+ vss1 = vec_lvehx (4, (short *)p);
+ vf1 = vec_lvewx (2, (float *)p);
+
+ vsi1 = vec_lvx (1, (vector signed int *)p);
+ vp1 = vec_lvxl (16, (vector pixel *)p);
+
+ vec_stvebx (vuc1, 2, (char *)p);
+ vec_stvehx (vp1, 4, (unsigned short *)p);
+ vec_stvewx (vf1, 1, (float *)p);
+
+ vec_stvx (vbi1, 12, (vector int bool *)p);
+ vec_stvxl (vp1, 11, (vector pixel *)p);
+
+ vui1 = vec_vaddcuw (vui1, vui2);
+ vf1 = vec_vaddfp (vf1, vf2);
+
+ vsc1 = vec_vaddsbs (vsc1, vsc2);
+ vss1 = vec_vaddshs (vss1, vss2);
+ vsi1 = vec_vaddsws (vsi1, vsi2);
+ vuc1 = vec_vaddubs (vuc1, vuc2);
+ vus1 = vec_vadduhs (vus1, vus2);
+ vui1 = vec_vadduws (vui1, vui2);
+ vuc1 = vec_vaddubm (vuc1, vuc2);
+ vus1 = vec_vadduhm (vus1, vus2);
+ vui1 = vec_vadduwm (vui1, vui2);
+
+ vsc1 = vec_vand (vsc1, vsc2);
+ vss1 = vec_vandc (vss1, vss2);
+
+ vsc1 = vec_vavgsb (vsc1, vsc2);
+ vss1 = vec_vavgsh (vss1, vss2);
+ vsi1 = vec_vavgsw (vsi1, vsi2);
+ vuc1 = vec_vavgub (vuc1, vuc2);
+ vus1 = vec_vavguh (vus1, vus2);
+ vui1 = vec_vavguw (vui1, vui2);
+
+ vf1 = vec_vcfsx (vsi1, 4);
+ vf2 = vec_vcfux (vui1, 3);
+
+ vsi1 = vec_vcmpbfp (vf1, vf2);
+ vbi1 = vec_vcmpeqfp (vf1, vf2);
+
+ vbc1 = vec_vcmpequb (vuc1, vuc2);
+ vbs2 = vec_vcmpequh (vus1, vus2);
+ vbi1 = vec_vcmpequw (vui1, vui2);
+
+ vbi1 = vec_vcmpgefp (vf1, vf2);
+ vbi2 = vec_vcmpgtfp (vf1, vf2);
+
+ vbc1 = vec_vcmpgtsb (vsc1, vsc2);
+ vbs1 = vec_vcmpgtsh (vss1, vss2);
+ vbi1 = vec_vcmpgtsw (vsi1, vsi2);
+
+ vbc1 = vec_vcmpgtub (vuc1, vuc2);
+ vbs1 = vec_vcmpgtuh (vus1, vus2);
+ vbi1 = vec_vcmpgtuw (vui1, vui2);
+
+ vsi1 = vec_vctsxs (vf1, 22);
+ vui1 = vec_vctuxs (vf2, 30);
+
+ vf2 = vec_vexptefp (vf1);
+ vf1 = vec_vlogefp (vf2);
+ vf2 = vec_vmaddfp (vf1, vf2, vf2);
+
+ vf1 = vec_vmaxfp (vf1, vf2);
+ vsc1 = vec_vmaxsb (vsc1, vsc2);
+ vss1 = vec_vmaxsh (vss1, vss2);
+ vsi1 = vec_vmaxsw (vsi1, vsi2);
+ vuc1 = vec_vmaxub (vuc1, vuc2);
+ vus1 = vec_vmaxuh (vus1, vus2);
+ vui1 = vec_vmaxuw (vui1, vui2);
+
+ vbc1 = vec_vmrghb (vbc1, vbc2);
+ vp1 = vec_vmrghh (vp1, vp2);
+ vf2 = vec_vmrghw (vf2, vf1);
+
+ vbc1 = vec_vmrglb (vbc1, vbc2);
+ vp1 = vec_vmrglh (vp1, vp2);
+ vf2 = vec_vmrglw (vf2, vf1);
+
+ vf1 = vec_vminfp (vf1, vf2);
+ vsc1 = vec_vminsb (vsc1, vsc2);
+ vss1 = vec_vminsh (vss1, vss2);
+ vsi1 = vec_vminsw (vsi1, vsi2);
+ vuc1 = vec_vminub (vuc1, vuc2);
+ vus1 = vec_vminuh (vus1, vus2);
+ vui1 = vec_vminuw (vui1, vui2);
+
+ vss1 = vec_vmhaddshs (vss1, vss2, vss2);
+ vss2 = vec_vmhraddshs (vss1, vss2, vss2);
+ vus1 = vec_vmladduhm (vus1, vus1, vus2);
+ vui1 = vec_vmsumubm (vuc1, vuc2, vui1);
+ vsi1 = vec_vmsummbm (vsc1, vuc2, vsi1);
+ vsi2 = vec_vmsumshm (vss1, vss2, vsi1);
+ vui1 = vec_vmsumuhm (vus1, vus2, vui2);
+ vui2 = vec_vmsumuhs (vus1, vus2, vui1);
+ vsi2 = vec_vmsumshs (vss1, vss1, vsi2);
+
+ vus1 = vec_vmuleub (vuc1, vuc2);
+ vss1 = vec_vmulesb (vsc1, vsc2);
+ vui1 = vec_vmuleuh (vus1, vus2);
+ vsi1 = vec_vmulesh (vss1, vss2);
+
+ vus2 = vec_vmuloub (vuc1, vuc2);
+ vss2 = vec_vmulosb (vsc1, vsc2);
+ vui2 = vec_vmulouh (vus1, vus2);
+ vsi2 = vec_vmulosh (vss1, vss2);
+
+ vf1 = vec_vnmsubfp (vf1, vf2, vf1);
+
+ vp1 = vec_vnor (vp1, vp2);
+ vf2 = vec_vor (vf2, vbi1);
+ vf2 = vec_vxor (vf2, vbi1);
+
+ vsc1 = vec_vpkuhum (vss1, vss2);
+ vbs1 = vec_vpkuwum (vbi1, vbi2);
+ vp1 = vec_vpkpx (vui1, vui2);
+ vuc1 = vec_vpkuhus (vus1, vus1);
+ vsc1 = vec_vpkshss (vss1, vss2);
+ vus1 = vec_vpkuwus (vui1, vui2);
+ vss2 = vec_vpkswss (vsi1, vsi1);
+ vuc1 = vec_vpkshus (vss1, vss2);
+ vus1 = vec_vpkswus (vsi1, vsi1);
+
+ vp1 = vec_vperm (vp1, vp2, vuc1);
+
+ vf1 = vec_vrefp (vf2);
+ vf2 = vec_vrfin (vf1);
+ vf1 = vec_vrsqrtefp (vf2);
+
+ vuc1 = vec_vrlb (vuc1, vuc2);
+ vss1 = vec_vrlh (vss2, vss1);
+ vui2 = vec_vrlw (vui2, vui1);
+
+ vf1 = vec_vsel (vf2, vf1, vbi1);
+
+ vuc1 = vec_vslb (vuc1, vuc2);
+ vss1 = vec_vslh (vss2, vss1);
+ vui2 = vec_vslw (vui2, vui1);
+
+ vp1 = vec_vsldoi (vp2, vp1, 14);
+ vp2 = vec_vsl (vp1, vuc1);
+ vp1 = vec_vslo (vp2, vuc1);
+
+ vbc1 = vec_vspltb (vbc1, 9);
+ vp2 = vec_vsplth (vp1, 7);
+ vf1 = vec_vspltw (vf2, 31);
+ vsc2 = vec_vspltisb (30);
+ vss1 = vec_vspltish (29);
+ vsi1 = vec_vspltisw (28);
+
+ vuc1 = vec_vsrb (vuc1, vuc2);
+ vss1 = vec_vsrh (vss2, vss1);
+ vui2 = vec_vsrw (vui2, vui1);
+ vuc2 = vec_vsrab (vuc1, vuc2);
+ vss2 = vec_vsrah (vss2, vss1);
+ vui1 = vec_vsraw (vui2, vui1);
+ vp2 = vec_vsr (vp1, vuc1);
+ vp1 = vec_vsro (vp2, vuc1);
+
+ vui1 = vec_vsubcuw (vui1, vui2);
+ vf1 = vec_vsubfp (vf1, vf2);
+ vsc1 = vec_vsubsbs (vsc1, vsc2);
+ vss1 = vec_vsubshs (vss1, vss2);
+ vsi1 = vec_vsubsws (vsi1, vsi2);
+ vuc1 = vec_vsububs (vuc1, vuc2);
+ vus1 = vec_vsubuhs (vus1, vus2);
+ vui1 = vec_vsubuws (vui1, vui2);
+ vuc1 = vec_vsububm (vuc1, vuc2);
+ vus1 = vec_vsubuhm (vus1, vus2);
+ vui1 = vec_vsubuwm (vui1, vui2);
+
+ vui2 = vec_vsum4ubs (vuc1, vui1);
+ vsi1 = vec_vsum4sbs (vsc2, vsi1);
+ vsi1 = vec_vsum2sws (vsi1, vsi1);
+ vsi2 = vec_vsumsws (vsi2, vsi1);
+
+ vf2 = vec_vrfiz (vf1);
+
+ vbs1 = vec_vupkhsb (vbc1);
+ vui1 = vec_vupkhpx (vp1);
+ vbi1 = vec_vupkhsh (vbs1);
+
+ vss1 = vec_vupklsb (vsc1);
+ vui1 = vec_vupklpx (vp2);
+ vbi1 = vec_vupklsh (vbs1);
+
+ return vsi1;
+}
+
+/* { dg-final { scan-assembler "\tlvebx " } } */
+/* { dg-final { scan-assembler "\tlvehx " } } */
+/* { dg-final { scan-assembler "\tlvewx " } } */
+/* { dg-final { scan-assembler "\tlvx " } } */
+/* { dg-final { scan-assembler "\tlvxl " } } */
+/* { dg-final { scan-assembler "\tstvebx " } } */
+/* { dg-final { scan-assembler "\tstvehx " } } */
+/* { dg-final { scan-assembler "\tstvewx " } } */
+/* { dg-final { scan-assembler "\tstvx " } } */
+/* { dg-final { scan-assembler "\tstvxl " } } */
+
+/* { dg-final { scan-assembler "\tvaddcuw " } } */
+/* { dg-final { scan-assembler "\tvaddfp " } } */
+/* { dg-final { scan-assembler "\tvaddsbs " } } */
+/* { dg-final { scan-assembler "\tvaddshs " } } */
+/* { dg-final { scan-assembler "\tvaddsws " } } */
+/* { dg-final { scan-assembler "\tvaddubs " } } */
+/* { dg-final { scan-assembler "\tvadduhs " } } */
+/* { dg-final { scan-assembler "\tvadduws " } } */
+/* { dg-final { scan-assembler "\tvaddubm " } } */
+/* { dg-final { scan-assembler "\tvadduhm " } } */
+/* { dg-final { scan-assembler "\tvadduwm " } } */
+
+/* { dg-final { scan-assembler "\tvand " } } */
+/* { dg-final { scan-assembler "\tvandc " } } */
+
+/* { dg-final { scan-assembler "\tvavgsb " } } */
+/* { dg-final { scan-assembler "\tvavgsh " } } */
+/* { dg-final { scan-assembler "\tvavgsw " } } */
+/* { dg-final { scan-assembler "\tvavgub " } } */
+/* { dg-final { scan-assembler "\tvavguh " } } */
+/* { dg-final { scan-assembler "\tvavguw " } } */
+
+/* { dg-final { scan-assembler "\tvcfsx " } } */
+/* { dg-final { scan-assembler "\tvcfux " } } */
+
+/* { dg-final { scan-assembler "\tvcmpbfp " } } */
+/* { dg-final { scan-assembler "\tvcmpeqfp " } } */
+
+/* { dg-final { scan-assembler "\tvcmpequb " } } */
+/* { dg-final { scan-assembler "\tvcmpequh " } } */
+/* { dg-final { scan-assembler "\tvcmpequw " } } */
+
+/* { dg-final { scan-assembler "\tvcmpgefp " } } */
+/* { dg-final { scan-assembler "\tvcmpgtfp " } } */
+
+/* { dg-final { scan-assembler "\tvcmpgtsb " } } */
+/* { dg-final { scan-assembler "\tvcmpgtsh " } } */
+/* { dg-final { scan-assembler "\tvcmpgtsw " } } */
+
+/* { dg-final { scan-assembler "\tvcmpgtub " } } */
+/* { dg-final { scan-assembler "\tvcmpgtuh " } } */
+/* { dg-final { scan-assembler "\tvcmpgtuw " } } */
+
+/* { dg-final { scan-assembler "\tvctsxs " } } */
+/* { dg-final { scan-assembler "\tvctuxs " } } */
+
+/* { dg-final { scan-assembler "\tvexptefp " } } */
+/* { dg-final { scan-assembler "\tvlogefp " } } */
+/* { dg-final { scan-assembler "\tvmaddfp " } } */
+
+/* { dg-final { scan-assembler "\tvmaxfp " } } */
+/* { dg-final { scan-assembler "\tvmaxsb " } } */
+/* { dg-final { scan-assembler "\tvmaxsh " } } */
+/* { dg-final { scan-assembler "\tvmaxsw " } } */
+/* { dg-final { scan-assembler "\tvmaxub " } } */
+/* { dg-final { scan-assembler "\tvmaxuh " } } */
+/* { dg-final { scan-assembler "\tvmaxuw " } } */
+
+/* { dg-final { scan-assembler "\tvmrghb " } } */
+/* { dg-final { scan-assembler "\tvmrghh " } } */
+/* { dg-final { scan-assembler "\tvmrghw " } } */
+
+/* { dg-final { scan-assembler "\tvmrglb " } } */
+/* { dg-final { scan-assembler "\tvmrglh " } } */
+/* { dg-final { scan-assembler "\tvmrglw " } } */
+
+/* { dg-final { scan-assembler "\tvminfp " } } */
+/* { dg-final { scan-assembler "\tvminsb " } } */
+/* { dg-final { scan-assembler "\tvminsh " } } */
+/* { dg-final { scan-assembler "\tvminsw " } } */
+/* { dg-final { scan-assembler "\tvminub " } } */
+/* { dg-final { scan-assembler "\tvminuh " } } */
+/* { dg-final { scan-assembler "\tvminuw " } } */
+
+/* { dg-final { scan-assembler "\tvmhaddshs " } } */
+/* { dg-final { scan-assembler "\tvmhraddshs " } } */
+/* { dg-final { scan-assembler "\tvmladduhm " } } */
+/* { dg-final { scan-assembler "\tvmsumubm " } } */
+/* { dg-final { scan-assembler "\tvmsummbm " } } */
+/* { dg-final { scan-assembler "\tvmsumshm " } } */
+/* { dg-final { scan-assembler "\tvmsumuhm " } } */
+/* { dg-final { scan-assembler "\tvmsumuhs " } } */
+/* { dg-final { scan-assembler "\tvmsumshs " } } */
+
+/* { dg-final { scan-assembler "\tvmuleub " } } */
+/* { dg-final { scan-assembler "\tvmulesb " } } */
+/* { dg-final { scan-assembler "\tvmuleuh " } } */
+/* { dg-final { scan-assembler "\tvmulesh " } } */
+
+/* { dg-final { scan-assembler "\tvmuloub " } } */
+/* { dg-final { scan-assembler "\tvmulosb " } } */
+/* { dg-final { scan-assembler "\tvmulouh " } } */
+/* { dg-final { scan-assembler "\tvmulosh " } } */
+
+/* { dg-final { scan-assembler "\tvnmsubfp " } } */
+
+/* { dg-final { scan-assembler "\tvnor " } } */
+/* { dg-final { scan-assembler "\tvor " } } */
+/* { dg-final { scan-assembler "\tvxor " } } */
+
+/* { dg-final { scan-assembler "\tvpkuhum " } } */
+/* { dg-final { scan-assembler "\tvpkuwum " } } */
+/* { dg-final { scan-assembler "\tvpkpx " } } */
+/* { dg-final { scan-assembler "\tvpkuhus " } } */
+/* { dg-final { scan-assembler "\tvpkshss " } } */
+/* { dg-final { scan-assembler "\tvpkuwus " } } */
+/* { dg-final { scan-assembler "\tvpkswss " } } */
+/* { dg-final { scan-assembler "\tvpkshus " } } */
+/* { dg-final { scan-assembler "\tvpkswus " } } */
+
+/* { dg-final { scan-assembler "\tvperm " } } */
+
+/* { dg-final { scan-assembler "\tvrefp " } } */
+/* { dg-final { scan-assembler "\tvrfin " } } */
+/* { dg-final { scan-assembler "\tvrsqrtefp " } } */
+
+/* { dg-final { scan-assembler "\tvrlb " } } */
+/* { dg-final { scan-assembler "\tvrlh " } } */
+/* { dg-final { scan-assembler "\tvrlw " } } */
+
+/* { dg-final { scan-assembler "\tvsel " } } */
+
+/* { dg-final { scan-assembler "\tvslb " } } */
+/* { dg-final { scan-assembler "\tvslh " } } */
+/* { dg-final { scan-assembler "\tvslw " } } */
+
+/* { dg-final { scan-assembler "\tvsldoi " } } */
+/* { dg-final { scan-assembler "\tvsl " } } */
+/* { dg-final { scan-assembler "\tvslo " } } */
+
+/* { dg-final { scan-assembler "\tvspltb " } } */
+/* { dg-final { scan-assembler "\tvsplth " } } */
+/* { dg-final { scan-assembler "\tvspltw " } } */
+/* { dg-final { scan-assembler "\tvspltisb " } } */
+/* { dg-final { scan-assembler "\tvspltish " } } */
+/* { dg-final { scan-assembler "\tvspltisw " } } */
+
+/* { dg-final { scan-assembler "\tvsrb " } } */
+/* { dg-final { scan-assembler "\tvsrh " } } */
+/* { dg-final { scan-assembler "\tvsrw " } } */
+/* { dg-final { scan-assembler "\tvsrab " } } */
+/* { dg-final { scan-assembler "\tvsrah " } } */
+/* { dg-final { scan-assembler "\tvsraw " } } */
+/* { dg-final { scan-assembler "\tvsr " } } */
+/* { dg-final { scan-assembler "\tvsro " } } */
+
+/* { dg-final { scan-assembler "\tvsubcuw " } } */
+/* { dg-final { scan-assembler "\tvsubfp " } } */
+/* { dg-final { scan-assembler "\tvsubsbs " } } */
+/* { dg-final { scan-assembler "\tvsubshs " } } */
+/* { dg-final { scan-assembler "\tvsubsws " } } */
+/* { dg-final { scan-assembler "\tvsububs " } } */
+/* { dg-final { scan-assembler "\tvsubuhs " } } */
+/* { dg-final { scan-assembler "\tvsubuws " } } */
+/* { dg-final { scan-assembler "\tvsububm " } } */
+/* { dg-final { scan-assembler "\tvsubuhm " } } */
+/* { dg-final { scan-assembler "\tvsubuwm " } } */
+
+/* { dg-final { scan-assembler "\tvsum4ubs " } } */
+/* { dg-final { scan-assembler "\tvsum4sbs " } } */
+/* { dg-final { scan-assembler "\tvsum2sws " } } */
+/* { dg-final { scan-assembler "\tvsumsws " } } */
+
+/* { dg-final { scan-assembler "\tvrfiz " } } */
+
+/* { dg-final { scan-assembler "\tvupkhsb " } } */
+/* { dg-final { scan-assembler "\tvupkhpx " } } */
+/* { dg-final { scan-assembler "\tvupkhsh " } } */
+
+/* { dg-final { scan-assembler "\tvupklsb " } } */
+/* { dg-final { scan-assembler "\tvupklpx " } } */
+/* { dg-final { scan-assembler "\tvupklsh " } } */
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-13.c b/gcc/testsuite/gcc.apple/apple-altivec-13.c
new file mode 100644
index 00000000000..f680d20eb7a
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-13.c
@@ -0,0 +1,43 @@
+/* APPLE LOCAL file AltiVec */
+/* Additional AltiVec PIM argument type combinations. */
+
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec -Wall" } */
+
+vector signed int
+LoadUnalignedSI( signed int *p)
+{
+ vector signed int vload1 = vec_ld( 0, (vector signed int *)p);
+ if ( ((int)p) * 0xF){
+ vector signed int vload2 = vec_ld( 16, (vector signed int *)p);
+ vector unsigned char vperm = vec_ldl( 0, p);
+
+ vload1 = vec_perm(vload1, vload2, vperm);
+ }
+ return vload1;
+}
+
+inline vector float Reciprocal( vector float v )
+{
+
+ vector float estimate = vec_re( v );
+
+ return vec_madd( vec_nmsub( estimate, v, (vector float) (1.0) ), estimate, estimate );
+}
+
+void foo(void) {
+ vector bool char vbc1 = (vector bool char)(255);
+ vector pixel vp1, vp2;
+ vector float vf1, vf2;
+ vector unsigned char vuc1;
+ vector unsigned short vus1, vus2;
+ vector bool short vbs1, vbs2;
+ vector signed short vss1;
+ vector signed int vsi1, vsi2;
+ vbc1 = vec_splat (vbc1, 9);
+ vp2 = vec_splat (vp1, 7);
+ vf1 = vec_splat (vf2, 31);
+ vuc1 = vec_pack (vus1, vus2);
+ vbc1 = vec_pack (vbs1, vbs2);
+ vss1 = vec_pack (vsi1, vsi2);
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-14.c b/gcc/testsuite/gcc.apple/apple-altivec-14.c
new file mode 100644
index 00000000000..0bb1dcd1d3a
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-14.c
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+/* Existing AltiVec PIM implementations allow numeric literals with
+ any number of bits, so long as the value is within allowed range. */
+int foo(void)
+{
+ vector unsigned char amask = vec_splat_u8 ( 0xFFFFFFF3L );
+ vector signed short bmask = vec_splat_s16 ( 0xFFFFFFFFFFFFFFF1LL );
+}
+
+
+/* { dg-final { scan-assembler "vspltisb.+\\-13" } } */
+/* { dg-final { scan-assembler "vspltish.+\\-15" } } */
+
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-15.c b/gcc/testsuite/gcc.apple/apple-altivec-15.c
new file mode 100644
index 00000000000..96bee290c9b
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-15.c
@@ -0,0 +1,39 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+union agg_def {
+ vector unsigned int v ;
+ unsigned int i;
+};
+
+extern void abort();
+
+int my_vec_all_eq(union agg_def a, union agg_def b);
+int compare(int d1, int d2);
+
+int main() {
+ union agg_def a, b, d1, d2;
+
+ d1.i = 0;
+ d2.i = 1;
+ a.v = (vector unsigned int) (2,3,4,5);
+ b.v = (vector unsigned int) (2,3,4,5);
+
+ d1.i = my_vec_all_eq(a, b);
+ d2.i = vec_all_eq(a.v, b.v);
+
+ if (compare(d1.i, d2.i))
+ return 0;
+ else
+ abort();
+}
+
+int my_vec_all_eq(union agg_def a, union agg_def b) {
+ return vec_all_eq(a.v, b.v);
+}
+
+int compare(int d1, int d2) {
+ return (d1 == d2);
+}
+
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-2.c b/gcc/testsuite/gcc.apple/apple-altivec-2.c
new file mode 100644
index 00000000000..dddf761b670
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-2.c
@@ -0,0 +1,95 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec" } */
+
+/* Program to test PowerPC AltiVec instructions. */
+
+#include "../gcc.dg/altivec_check.h"
+
+extern void abort (void);
+#define CHECK_IF(E) if(!(E)) abort()
+
+vector int a1 = (vector int)( 100, 200, 300, 400 );
+vector int a2 = (vector int)( 500, 600, 700, 800 );
+vector int addi = (vector int)( 600, 800, 1000, 1200 );
+vector int avgi = (vector int)( 300, 400, 500, 600 );
+
+vector float f1 = (vector float)( 1.0, 2.0, 3.0, 4.0 );
+vector float f2 = (vector float)( 5.0, 6.0, 7.0, 8.0 );
+vector float f3;
+vector float addf1 = (vector float)( 6.0, 8.0, 10.0, 12.0 );
+vector float addf2 = (vector float)( 6.1, 8.1, 10.1, 12.1 );
+vector float addf3 = (vector float)( 6.0, 8.0, 9.9, 12.1 );
+vector int k;
+vector float f, g, h;
+
+int main ()
+{
+
+ altivec_check(); /* Exit if AltiVec not available. */
+
+ k = vec_add (a1, a2);
+ CHECK_IF (vec_all_eq (addi, k));
+ CHECK_IF (vec_all_ge (addi, k));
+ CHECK_IF (vec_all_le (addi, k));
+ CHECK_IF (vec_any_eq (addi, k));
+ CHECK_IF (vec_any_ge (addi, k));
+ CHECK_IF (vec_any_le (addi, k));
+ CHECK_IF (!vec_any_ne (addi, k));
+ CHECK_IF (!vec_any_lt (addi, k));
+ CHECK_IF (!vec_any_gt (addi, k));
+ CHECK_IF (!vec_any_ne (addi, k));
+ CHECK_IF (!vec_any_lt (addi, k));
+ CHECK_IF (!vec_any_gt (addi, k));
+
+ k = vec_avg (a1, a2);
+ CHECK_IF (vec_all_eq (k, avgi));
+
+ h = vec_add (f1, f2);
+ CHECK_IF (vec_all_eq (h, addf1));
+ CHECK_IF (vec_all_ge (h, addf1));
+ CHECK_IF (vec_all_le (h, addf1));
+ CHECK_IF (vec_any_eq (h, addf1));
+ CHECK_IF (vec_any_ge (h, addf1));
+ CHECK_IF (vec_any_le (h, addf1));
+ CHECK_IF (!vec_any_ne (h, addf1));
+ CHECK_IF (!vec_any_lt (h, addf1));
+ CHECK_IF (!vec_any_gt (h, addf1));
+ CHECK_IF (!vec_any_ne (h, addf1));
+ CHECK_IF (!vec_any_lt (h, addf1));
+ CHECK_IF (!vec_any_gt (h, addf1));
+
+ CHECK_IF (vec_all_gt (addf2, addf1));
+ CHECK_IF (vec_any_gt (addf2, addf1));
+ CHECK_IF (vec_all_ge (addf2, addf1));
+ CHECK_IF (vec_any_ge (addf2, addf1));
+ CHECK_IF (vec_all_ne (addf2, addf1));
+ CHECK_IF (vec_any_ne (addf2, addf1));
+ CHECK_IF (!vec_all_lt (addf2, addf1));
+ CHECK_IF (!vec_any_lt (addf2, addf1));
+ CHECK_IF (!vec_all_le (addf2, addf1));
+ CHECK_IF (!vec_any_le (addf2, addf1));
+ CHECK_IF (!vec_all_eq (addf2, addf1));
+ CHECK_IF (!vec_any_eq (addf2, addf1));
+
+ CHECK_IF (vec_any_eq (addf3, addf1));
+ CHECK_IF (vec_any_ne (addf3, addf1));
+ CHECK_IF (vec_any_lt (addf3, addf1));
+ CHECK_IF (vec_any_le (addf3, addf1));
+ CHECK_IF (vec_any_gt (addf3, addf1));
+ CHECK_IF (vec_any_ge (addf3, addf1));
+ CHECK_IF (!vec_all_eq (addf3, addf1));
+ CHECK_IF (!vec_all_ne (addf3, addf1));
+ CHECK_IF (!vec_all_lt (addf3, addf1));
+ CHECK_IF (!vec_all_le (addf3, addf1));
+ CHECK_IF (!vec_all_gt (addf3, addf1));
+ CHECK_IF (!vec_all_ge (addf3, addf1));
+
+ CHECK_IF (vec_all_numeric (addf3));
+ CHECK_IF (vec_all_in (addf1, addf2));
+
+ CHECK_IF (vec_step (vector bool char) == 16);
+ CHECK_IF (vec_step (addf3) == 4);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-3.c b/gcc/testsuite/gcc.apple/apple-altivec-3.c
new file mode 100644
index 00000000000..1112913de1b
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-3.c
@@ -0,0 +1,14 @@
+/* APPLE LOCAL file AltiVec */
+/* Providing '-maltivec' should ensure that AltiVec codegen for block copies is enabled,
+ even if '-faltivec' is also specified. */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec -maltivec" } */
+typedef struct { vector int a; vector int b; } Scld1;
+
+void testvaScld1 (int n, Scld1);
+
+void foo ()
+{
+ Scld1 g1sScld1;
+ testvaScld1 (1, g1sScld1); /* { dg-bogus "disabled" } */
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-4.c b/gcc/testsuite/gcc.apple/apple-altivec-4.c
new file mode 100644
index 00000000000..d05aac5fedc
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-4.c
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file AltiVec */
+/* Additional AltiVec PIM argument type combinations. */
+
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec" } */
+
+typedef float R;
+typedef vector float V;
+V gV = (vector float)(0.3, 0.4, 0.5, 0.6);
+
+void foo(int ovs) {
+ vector float vFGravity1, vFGravity2, vCombined1OverR_12 = (vector float)(0.3);
+ V v; R *x = (R *)&gV;
+
+ vFGravity1 = vec_mergeh(vCombined1OverR_12, vCombined1OverR_12);
+ vFGravity2 = vec_mergel(vCombined1OverR_12, vCombined1OverR_12);
+
+ vec_ste (v, 0, x);
+ vec_ste (v, 4 + ovs, x);
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-5.c b/gcc/testsuite/gcc.apple/apple-altivec-5.c
new file mode 100644
index 00000000000..0c7dd9bcb60
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-5.c
@@ -0,0 +1,31 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+extern void abort();
+
+int main()
+{
+ vector float tiny = (vector float) ((vector unsigned int) (0x00800000, 0xBF800000, 0x3E800000, 0));
+ unsigned int af[4] = {
+ (unsigned int)(unsigned int)0x00800000,
+ (unsigned int)(unsigned int)0xBF800000,
+ (unsigned int)(unsigned int)0x3E800000,
+ (unsigned int)(unsigned int)0};
+
+ union u {
+ vector float vf;
+ unsigned int ai[4];
+ }vu;
+ int i;
+
+ vu.vf = tiny;
+
+ for (i=0; i < 4; i++)
+ if (af[i] != vu.ai[i])
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-6.c b/gcc/testsuite/gcc.apple/apple-altivec-6.c
new file mode 100644
index 00000000000..09e1f6861bf
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-6.c
@@ -0,0 +1,31 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+extern void abort();
+
+int main()
+{
+ vector unsigned int tiny = (vector unsigned int) ((vector signed int) (0x00800000, 0xBF800000, 0x3E800000, 0));
+ unsigned int af[4] = {
+ (signed int)0x00800000,
+ (signed int)0xBF800000,
+ (signed int)0x3E800000,
+ (signed int)0};
+
+ union u {
+ vector unsigned int vf;
+ unsigned int ai[4];
+ }vu;
+ int i;
+
+ vu.vf = tiny;
+
+ for (i=0; i < 4; i++)
+ if (af[i] != vu.ai[i])
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-7.c b/gcc/testsuite/gcc.apple/apple-altivec-7.c
new file mode 100644
index 00000000000..ffbb408aadd
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-7.c
@@ -0,0 +1,34 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec" } */
+
+#include <altivec.h>
+
+extern void abort();
+
+int main()
+{
+
+ static vector float vINF =
+ ( vector float ) ( ( vector unsigned int ) ( 0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000 ) );
+
+ unsigned int af[4] = {
+ (unsigned int)0x7F800000,
+ (unsigned int)0x7F800000,
+ (unsigned int)0x7F800000,
+ (unsigned int)0x7F800000};
+
+ union u {
+ vector float vf;
+ unsigned int ai[4];
+ }vu;
+
+ int i;
+
+ vu.vf = vINF;
+
+ for (i=0; i < 4; i++)
+ if (af[i] != vu.ai[i])
+ abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-8.c b/gcc/testsuite/gcc.apple/apple-altivec-8.c
new file mode 100644
index 00000000000..fb2389526d2
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-8.c
@@ -0,0 +1,36 @@
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-maltivec -O2" } */
+
+/* ICEs at -O1 or more */
+
+#include <altivec.h>
+
+extern void abort();
+
+int main()
+{
+
+ const static vector float vINF =
+ ( vector float ) ( ( vector unsigned int ) ( 0x7F800000, 0x7F800000, 0x7F800000, 0x7F800000 ) );
+
+ unsigned int af[4] = {
+ (unsigned int)0x7F800000,
+ (unsigned int)0x7F800000,
+ (unsigned int)0x7F800000,
+ (unsigned int)0x7F800000};
+
+ union u {
+ vector float vf;
+ unsigned int ai[4];
+ }vu;
+
+ int i;
+
+ vu.vf = vINF;
+
+ for (i=0; i < 4; i++)
+ if (af[i] != vu.ai[i])
+ abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-9.c b/gcc/testsuite/gcc.apple/apple-altivec-9.c
new file mode 100644
index 00000000000..938baca5356
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-9.c
@@ -0,0 +1,9 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec -ftrapping-math" } */
+
+int vConvert_PlanarFtoPlanar16F( )
+{
+ vector float twoP10 = (vector float) (0x1.0p+10f, 0x1.0p+24f, 0x1.0p+102f, 1.0f/0.0f );
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-abi-test.c b/gcc/testsuite/gcc.apple/apple-altivec-abi-test.c
new file mode 100644
index 00000000000..5361cc7d314
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-abi-test.c
@@ -0,0 +1,39 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-O -faltivec" } */
+/* { dg-final { scan-assembler "vspltisw v2,1" } } */
+/* { dg-final { scan-assembler "vspltisw v3,2" } } */
+/* { dg-final { scan-assembler "vspltisw v4,3" } } */
+/* { dg-final { scan-assembler "vspltisw v5,4" } } */
+/* { dg-final { scan-assembler "vspltisw v6,5" } } */
+/* { dg-final { scan-assembler "vspltisw v7,6" } } */
+/* { dg-final { scan-assembler "vspltisw v8,7" } } */
+/* { dg-final { scan-assembler "vspltisw v9,8" } } */
+/* { dg-final { scan-assembler "vspltisw v10,9" } } */
+/* { dg-final { scan-assembler "vspltisw v11,10" } } */
+/* { dg-final { scan-assembler "vspltisw v12,11" } } */
+/* { dg-final { scan-assembler "vspltisw v13,12" } } */
+
+void
+foo (vector signed int v0, vector signed int v1, vector signed int v2,
+ vector signed int v3, vector signed int v4, vector signed int v5,
+ vector signed int v6, vector signed int v7, vector signed int v8,
+ vector signed int v9, vector signed int v10, vector signed int v11,
+ vector signed int v12,
+ int z, double u);
+
+int main(void)
+{
+ foo ((vector signed int) ( 1 ), (vector signed int) ( 2 ),
+ (vector signed int) ( 3 ),
+ (vector signed int) ( 4 ), (vector signed int) ( 5 ),
+ (vector signed int) ( 6 ), (vector signed int) ( 7 ),
+ (vector signed int) ( 8 ), (vector signed int) ( 9 ),
+ (vector signed int) ( 10 ), (vector signed int) ( 11 ),
+ (vector signed int) ( 12 ), (vector signed int) ( 13 ),
+ 20, 3.0);
+}
+
+
+
+
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-abi.c b/gcc/testsuite/gcc.apple/apple-altivec-abi.c
new file mode 100644
index 00000000000..264791801c9
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-abi.c
@@ -0,0 +1,66 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+#include <stdio.h>
+
+typedef vector signed int VSI;
+
+VSI VI(
+ VSI v2,
+ int gpr3,
+ VSI v3,
+ int gpr4,
+ VSI v4,
+ int gpr5,
+ VSI v5,
+ int gpr6,
+ int gpr7,
+ int gpr8,
+ int gpr9,
+ VSI v6,
+ int gpr10, /* gpr3-gpr10 in registers */
+ VSI v7,
+ VSI v8,
+ VSI v9,
+ VSI v10,
+ VSI v11,
+ VSI v12,
+ VSI v13, /* All in v2-v13 */
+ volatile VSI v14,
+ int gpr11,
+ int gpr12,
+ int gpr13,
+ int gpr14,
+ VSI v15,
+ VSI v16, int* sum)
+{
+ *sum = gpr3 + gpr4 + gpr5 + gpr6 + gpr7 + gpr8 + gpr9 + gpr10 + gpr11 + gpr12 + gpr13 + gpr14;
+ return v2+v3+v4+v5+v6+v7+v8+v9+v10+v11+v12+v13+v14+v15+v16;
+}
+
+extern void abort();
+
+int main()
+{
+ union u {
+ VSI uv;
+ int val[4];
+ } union_var;
+
+ int i;
+
+ int sum;
+ union_var.uv =
+ VI((VSI){1,1,1,1},3,(VSI){1,1,1,1},4,(VSI){1,1,1,1},5,(VSI){1,1,1,1},6,7,8,9,
+ (VSI){1,1,1,1},10,(VSI){1,1,1,1},(VSI){1,1,1,1},(VSI){1,1,1,1},(VSI){1,1,1,1},
+ (VSI){1,1,1,1},(VSI){1,1,1,1},(VSI){1,1,1,1},(VSI){1,1,1,1},11,12,13,14,
+ (VSI){1,1,1,1},(VSI){1,1,1,1}, &sum);
+ if (sum != 102)
+ abort();
+
+ for (i=0; i < 4; i++)
+ if (union_var.val[i] != 15)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/apple-altivec-builtin-nanf.c b/gcc/testsuite/gcc.apple/apple-altivec-builtin-nanf.c
new file mode 100644
index 00000000000..fb9253929f2
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/apple-altivec-builtin-nanf.c
@@ -0,0 +1,8 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-faltivec" } */
+
+void _sqrt()
+{
+ __vector float vNAN = (__vector float)(__builtin_nanf("0x7fc00000"));
+}
diff --git a/gcc/testsuite/gcc.apple/applecc.c b/gcc/testsuite/gcc.apple/applecc.c
new file mode 100644
index 00000000000..757ad573272
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/applecc.c
@@ -0,0 +1,14 @@
+/* APPLE LOCAL file Apple version */
+/* { dg-do compile } */
+
+#if __APPLE_CC__ < 1000
+#error build number too small
+#endif
+#if __APPLE_CC__ > 32768
+#error build number too big
+#endif
+#if ! ( __APPLE_CC__ > 1000)
+#error build number not really a number
+#endif
+
+int x = __APPLE_CC__;
diff --git a/gcc/testsuite/gcc.apple/asm-block-1.c b/gcc/testsuite/gcc.apple/asm-block-1.c
new file mode 100644
index 00000000000..3ad73fb12f7
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-block-1.c
@@ -0,0 +1,75 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test asm-syntax blocks within functions. */
+
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+void abort(void);
+
+int
+foo (int argx, int argy)
+{
+ register int locx = argx, locy = argy, rslt;
+ asm {
+ add rslt,locx,locy
+ }
+ return rslt;
+}
+
+/* Exercise corners of syntax. */
+
+int
+bar ()
+{
+ register int rslt = 100;
+ asm {
+ // Combos of instructions on a line
+
+ nop
+ ;
+ nop
+ nop ;
+ ; nop
+ nop ; nop
+ ; nop ;;; li r3,95 ; nop ;
+ // '.' in an opcode
+ add. r6,r6,r5
+ }
+ return rslt;
+}
+
+int baz ()
+{
+ register int rslt = 1;
+ asm {
+ li r8,29+(2 * 3);
+ add rslt,rslt,r8;
+ b @192
+ @34
+ nop
+ ble+ @34
+ b forward
+ abc:
+ b abc
+ @abc:
+ b @abc
+ forward: ; @192:
+ nop
+ ;
+ sameline: nop
+ x1: @x2 @x3: nop ; @x4 x5:
+ }
+ return rslt;
+}
+
+int
+main ()
+{
+ if (foo (22, 23) != 45)
+ abort ();
+ if (bar () != 100)
+ abort ();
+ if (baz () != 36)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/asm-block-2.c b/gcc/testsuite/gcc.apple/asm-block-2.c
new file mode 100644
index 00000000000..586f2c73357
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-block-2.c
@@ -0,0 +1,88 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test structure refs in asm-syntax blocks within functions. */
+
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+void abort(void);
+
+
+typedef struct astruct {
+ int arr[40];
+ char charfield;
+ int fieldx;
+ int fieldy;
+} atypedef;
+
+union aunion {
+ int field1;
+ int field2;
+};
+
+int fun1 (struct astruct *x)
+{
+ int loc;
+ asm {
+ lwz loc, astruct.fieldx(x)
+ addi loc, loc, 42
+ stw loc, astruct.fieldx+4(x)
+ }
+ return loc;
+}
+
+int fun2 (atypedef *x)
+{
+ int loc;
+
+ asm {
+ lwz loc, atypedef.fieldx(r3)
+ addi loc, loc, 43
+ stw loc, 4 + astruct.fieldx(x)
+ }
+ return loc;
+}
+
+int fun3(int arg)
+{
+ int loc;
+
+ asm {
+ mr loc, r3
+ addi loc, loc, aunion.field1
+ }
+ return loc;
+}
+
+int fun4 (struct astruct *arg)
+{
+ int loc;
+ asm {
+ lbz loc, arg->charfield
+ addi loc, loc, 1
+ }
+ return loc;
+}
+
+struct astruct glob;
+union uglob;
+
+int
+main ()
+{
+ glob.charfield = 'b';
+ glob.fieldx = 22;
+ if (fun1 (&glob) != 64)
+ abort ();
+ if (glob.fieldy != 64)
+ abort ();
+ if (fun2 (&glob) != 65)
+ abort ();
+ if (glob.fieldy != 65)
+ abort ();
+ if (fun3 (89) != 89)
+ abort ();
+ if (fun4 (&glob) != 'c')
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/asm-block-3.c b/gcc/testsuite/gcc.apple/asm-block-3.c
new file mode 100644
index 00000000000..c3071dceaf2
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-block-3.c
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test single line asms */
+
+/* { dg-do compile } */
+/* { dg-options "-fasm-blocks" } */
+
+void
+bar ()
+{
+ asm { nop };
+}
diff --git a/gcc/testsuite/gcc.apple/asm-function-1.c b/gcc/testsuite/gcc.apple/asm-function-1.c
new file mode 100644
index 00000000000..9a031f27386
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-1.c
@@ -0,0 +1,51 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test whole asm functions. */
+
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+void abort(void);
+
+asm int
+foo (register int argx, register int argy)
+{
+ add r3, argx, argy
+}
+
+#define rsltreg r3
+
+asm int
+foo1 (register int argx, register int argy)
+{
+ register int loc1, loc2;
+ nop
+ li loc1, 100
+ li rsltreg,0
+ b @a34
+ add rsltreg, argx, argy
+@a34
+ add rsltreg, rsltreg, loc1
+ blr
+}
+
+extern asm int foo2(int x, float y)
+{
+#pragma unused(x)
+#pragma unused(x,y)
+ li rsltreg, 48;
+#pragma unused(y)
+ nop
+#pragma unused(x)
+}
+
+int
+main ()
+{
+ if (foo (22, 23) != 45)
+ abort ();
+ if (foo1 (1, 2) != 100)
+ abort ();
+ if (foo2 (100, 1.2) != 48)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/asm-function-10.c b/gcc/testsuite/gcc.apple/asm-function-10.c
new file mode 100644
index 00000000000..46c5cb09591
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-10.c
@@ -0,0 +1,16 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+asm void foo()
+{
+ lis r1,(kUndefindedConstant<<10)|(3<<5)|(7)
+ rlwinm r0,r2,16+kUndefindedConstant,31 /* { dg-error "block assembly operand not recognized" } */
+ cmpwi cr7,r1,kUndefindedConstant-1 /* { dg-error "block assembly operand not recognized" } */
+} /* { dg-error "block assembly operand not recognized" } */
+
+int main (int argc, char * const argv[])
+{
+ foo();
+}
+
diff --git a/gcc/testsuite/gcc.apple/asm-function-11.c b/gcc/testsuite/gcc.apple/asm-function-11.c
new file mode 100644
index 00000000000..e75f3c132f8
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-11.c
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+struct tDummyStruct
+{
+ unsigned long fDummy;
+ unsigned long fSample;
+};
+
+asm void foo()
+{
+ lwz r1,-8+tDummyStruct.fSample(r2)
+ stw r1,-8+tDummyStruct.fSample(r2)
+ lwz r1,-8-(tDummyStruct.fSample-tDummyStruct.fDummy)(r2)
+ stw r1,-8-(tDummyStruct.fSample-tDummyStruct.fDummy)(r2)
+}
+
+int main (int argc, char * const argv[])
+{
+ foo();
+}
+
+
diff --git a/gcc/testsuite/gcc.apple/asm-function-12.c b/gcc/testsuite/gcc.apple/asm-function-12.c
new file mode 100644
index 00000000000..5a1a3d6af55
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-12.c
@@ -0,0 +1,18 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+asm void foo()
+{
+ b .+8
+ bl .+24
+ b .-8
+ bl .-32
+ andi. r1,r0,2
+}
+
+int main (int argc, char * const argv[])
+{
+ foo();
+}
+
diff --git a/gcc/testsuite/gcc.apple/asm-function-13.c b/gcc/testsuite/gcc.apple/asm-function-13.c
new file mode 100644
index 00000000000..ace3cba12ef
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-13.c
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+asm void foo()
+{
+ .align 15
+ andi. r1,r2, 3
+ .align 10
+ b .+8
+ .align 4
+ b .-16
+ .align 3
+ lha r1, 4(r3)
+ .align 4
+ add r1,r2,r3
+ .align 3
+ .align 4
+}
+
+int main (int argc, char * const argv[])
+{
+ foo();
+}
+
+
diff --git a/gcc/testsuite/gcc.apple/asm-function-14.c b/gcc/testsuite/gcc.apple/asm-function-14.c
new file mode 100644
index 00000000000..56458390f4c
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-14.c
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file CW asm blocks */
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+asm void foo()
+{
+ dcbst r0,r5 /* { dg-error "r0 not allowed for parameter 1" } */
+
+ li r1, kUndefindedConstant /* { dg-error "expression must be absolute" } */
+
+}
diff --git a/gcc/testsuite/gcc.apple/asm-function-2.c b/gcc/testsuite/gcc.apple/asm-function-2.c
new file mode 100644
index 00000000000..9ac177eff08
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-2.c
@@ -0,0 +1,73 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test whole asm functions. */
+
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+void abort(void);
+
+asm void normal_fn ()
+{
+ nop
+}
+
+asm void nofralloc_fn ()
+{
+ nofralloc
+ nop
+ blr
+}
+
+asm void fralloc_fn ()
+{
+ fralloc
+ nop
+}
+
+asm int fralloc_fn_1 ()
+{
+ fralloc
+ mr r4,r1
+ frfree
+ sub r3,r4,r1
+ blr
+}
+
+asm int fralloc_fn_2 ()
+{
+ fralloc 1000
+ nop
+ frfree
+ blr
+}
+
+asm int fralloc_fn_3 ()
+{
+ int loc1, loc2;
+ fralloc 41
+ nop
+ mr r3, loc2
+ frfree
+ mr r3, loc1
+ blr
+}
+
+asm int f6 ()
+{
+ opword 0x386004d2 /* li r3,1234 */
+}
+
+main()
+{
+ normal_fn ();
+ nofralloc_fn ();
+ fralloc_fn ();
+ /*
+ fralloc_fn_1 ();
+ fralloc_fn_2 ();
+ fralloc_fn_3 ();
+ */
+ if (f6 () != 1234)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/asm-function-3.c b/gcc/testsuite/gcc.apple/asm-function-3.c
new file mode 100644
index 00000000000..944900fb75b
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-3.c
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file CW asm blocks */
+/* More tests of asm functions. */
+
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+void abort(void);
+
+/* Return 0 if xer and spr1 both have the same data. */
+
+asm int
+test_spr ()
+{
+ mfspr r5,xer
+ mfspr r4,spr1
+ sub r3,r4,r5
+}
+
+int
+main ()
+{
+ if (test_spr ())
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/asm-function-4.c b/gcc/testsuite/gcc.apple/asm-function-4.c
new file mode 100644
index 00000000000..f3889a413bd
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-4.c
@@ -0,0 +1,62 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test asm with macros. */
+
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+void abort(void);
+
+#define mac1 add r3, argx, argy
+
+asm int
+foo (register int argx, register int argy)
+{
+ mac1
+}
+
+#define rsltreg r3
+#define mac2(x,y) add rsltreg,x,y
+
+asm int
+foo1 (register int argx, register int argy)
+{
+ register int loc1, loc2;
+ nop
+ li loc1, 100
+ li rsltreg,0
+ b @a34
+ mac2(argx,argy)
+@a34
+ mac2(rsltreg,loc1)
+ blr
+}
+
+#define limac li
+#define num 48
+
+asm int foo2(int x, float y)
+{
+#pragma unused(x)
+#pragma unused(x,y)
+ limac rsltreg, num;
+#define mac3(zzz) \
+ limac r4, zzz
+#pragma unused(y)
+ nop
+ mac3(num)
+#pragma unused(x)
+ add r3,r3,r4
+}
+
+int
+main ()
+{
+ if (foo (22, 23) != 45)
+ abort ();
+ if (foo1 (1, 2) != 100)
+ abort ();
+ if (foo2 (100, 1.2) != 2 * num)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/asm-function-5.c b/gcc/testsuite/gcc.apple/asm-function-5.c
new file mode 100644
index 00000000000..7808daaa81b
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-5.c
@@ -0,0 +1,49 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test function calls in asm functions. */
+
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+void abort(void);
+
+int glob = 0;
+
+int other ();
+int stubfn ();
+int localfn () { return other (); }
+
+asm void foo(int arg)
+{
+ nofralloc
+ mflr r0
+ stmw r30,-8(r1)
+ stw r0,8(r1)
+ stwu r1,-80(r1)
+ bl stubfn
+ /* bl L_stubfn$stub */
+ lwz r0,88(r1)
+ addi r1,r1,80
+ mtlr r0
+ lmw r30,-8(r1)
+ b localfn
+}
+
+void bar (int arg)
+{
+ stubfn ();
+ localfn ();
+}
+
+int stubfn () { return other(); }
+
+int other () { return ++glob; }
+
+int main ()
+{
+ bar(34);
+ foo(92);
+ if (glob != 4)
+ abort ();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/asm-function-6.c b/gcc/testsuite/gcc.apple/asm-function-6.c
new file mode 100644
index 00000000000..1ff272e183e
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-6.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test entry points in asm functions. */
+
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks -O2" } */
+
+void abort(void);
+
+int entry1(int);
+int entry2(int);
+int entry3(int);
+
+asm int foo(int x)
+{
+ addi r3,r3,45
+ entry entry1
+ addi r3,r3,1
+ entry static entry2
+ addi r3,r3,1
+ entry extern entry3
+ addi r3,r3,1
+}
+
+int main ()
+{
+ if (entry1(0) != 3)
+ abort();
+ if (entry2(89) != 91)
+ abort();
+ if (entry3(100) != 101)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/asm-function-7.c b/gcc/testsuite/gcc.apple/asm-function-7.c
new file mode 100644
index 00000000000..c182fd05c1e
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-7.c
@@ -0,0 +1,17 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test la16(TABLE), lo16(TABLE), and bdnz+. */
+
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+double TABLE[4]={2.0, 1./2., 3., 1.};
+
+asm void SQRT()
+{
+ lis r3,ha16(TABLE)
+ addi r3,r3,lo16(TABLE)
+@cycle:
+ fmul fp6,fp1,fp1
+ bdnz+ @cycle
+ blr
+}
diff --git a/gcc/testsuite/gcc.apple/asm-function-8.c b/gcc/testsuite/gcc.apple/asm-function-8.c
new file mode 100644
index 00000000000..2e559043308
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-8.c
@@ -0,0 +1,14 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test lo16(foo)(v) and ha16(foo). */
+
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+int foo;
+
+asm int fun1 ()
+{
+ int v;
+ addis v,0,ha16(foo)
+ lwz r3,lo16(foo)(v)
+}
diff --git a/gcc/testsuite/gcc.apple/asm-function-9.c b/gcc/testsuite/gcc.apple/asm-function-9.c
new file mode 100644
index 00000000000..7b5e3101b68
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/asm-function-9.c
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file CW asm blocks */
+/* Test macros with . in the opcode. */
+
+/* { dg-do assemble { target powerpc*-*-* } } */
+/* { dg-options "-fasm-blocks" } */
+
+#define foodef() rlwinm. r4,r4,31,16,31
+
+asm void foo (void)
+{
+ foodef()
+}
diff --git a/gcc/testsuite/gcc.apple/const-cfstring-1.c b/gcc/testsuite/gcc.apple/const-cfstring-1.c
new file mode 100644
index 00000000000..3e8c1194d20
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/const-cfstring-1.c
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file constant CFStrings */
+/* Test whether the __builtin__CFStringMakeConstantString
+ "function" fails gracefully when handed a non-constant
+ argument. This will only work on MacOS X 10.1.2 and later. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fconstant-cfstrings" } */
+
+typedef const struct __CFString *CFStringRef;
+
+#ifdef __CONSTANT_CFSTRINGS__
+#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString (STR))
+#else
+#error __CONSTANT_CFSTRINGS__ not defined
+#endif
+
+extern int cond;
+extern const char *func(void);
+
+const CFStringRef s0 = CFSTR("Hello" "there");
+
+int main(void) {
+ CFStringRef s1 = CFSTR("Str1");
+ CFStringRef s2 = CFSTR(cond? "Str2": "Str3"); /* { dg-error "literal expression is not constant" } */
+ CFStringRef s3 = CFSTR(func()); /* { dg-error "literal expression is not constant" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/const-cfstring-2.c b/gcc/testsuite/gcc.apple/const-cfstring-2.c
new file mode 100644
index 00000000000..cbf09d3a977
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/const-cfstring-2.c
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file constant CFStrings */
+/* Test whether the __builtin__CFStringMakeConstantString
+ "function" fails gracefully when used without the
+ -fconstant-cfstrings flag. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-options "-fno-constant-cfstrings" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+typedef const struct __CFString *CFStringRef;
+
+const CFStringRef S = ((CFStringRef)__builtin___CFStringMakeConstantString("Testing"));
+/* { dg-error "built-in" "built-in function .* requires .* flag" { target *-*-* } 12 } */
diff --git a/gcc/testsuite/gcc.apple/const-cfstring-3.c b/gcc/testsuite/gcc.apple/const-cfstring-3.c
new file mode 100644
index 00000000000..aba558b1f8b
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/const-cfstring-3.c
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file constant CFStrings */
+/* Test whether the __builtin__CFStringMakeConstantString
+ "function" generates compile-time objects with the correct layout. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fconstant-cfstrings" } */
+
+typedef const struct __CFString *CFStringRef;
+
+#ifdef __CONSTANT_CFSTRINGS__
+#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString (STR))
+#else
+#error __CONSTANT_CFSTRINGS__ not defined
+#endif
+
+extern int cond;
+extern const char *func(void);
+
+CFStringRef s0 = CFSTR("Hello" "there");
+
+void foo(void) {
+ const CFStringRef s1 = CFSTR("Str1");
+
+ s0 = s1;
+}
+
+/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+4\n" } } */
+/* { dg-final { scan-assembler "\\.long\[ \\t\]+___CFConstantStringClassReference\n\[ \\t\]*\\.long\[ \\t\]+1992\n\[ \\t\]*\\.long\[ \\t\]+LC.*\n\[ \\t\]*\\.long\[ \\t\]+10\n" } } */
diff --git a/gcc/testsuite/gcc.apple/const-cfstring-4.c b/gcc/testsuite/gcc.apple/const-cfstring-4.c
new file mode 100644
index 00000000000..0c7c326100e
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/const-cfstring-4.c
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file */
+/* Test constant cfstring and writabe strings interaction.
+ Radar 3978580. */
+/* Developed by Devang Patel <dpatel@apple.com>. */
+
+/* { dg-do assemble { target *-*-darwin* } } */
+/* { dg-options "-fconstant-cfstrings -fwritable-strings" } */
+
+typedef const struct __CFString *CFStringRef;
+
+#ifdef __CONSTANT_CFSTRINGS__
+#define CFSTR(STR) ((CFStringRef) __builtin___CFStringMakeConstantString (STR))
+#else
+#error __CONSTANT_CFSTRINGS__ not defined
+#endif
+
+extern void bar (const void **);
+
+static void foo()
+{
+ CFStringRef keys[] =
+ {
+ CFSTR("blah1"),
+ CFSTR("blah2")
+ };
+ int count = sizeof(keys) / sizeof(keys[0]);
+
+ bar ((const void **)keys);
+}
+
diff --git a/gcc/testsuite/gcc.apple/cw-altivec-asm-block.c b/gcc/testsuite/gcc.apple/cw-altivec-asm-block.c
new file mode 100644
index 00000000000..1b3baaa6e2f
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/cw-altivec-asm-block.c
@@ -0,0 +1,35 @@
+/* APPLE LOCAL file CW asm blocks with AltiVec insn. */
+/* Test asm-syntax blocks within functions. */
+
+/* { dg-do run { target powerpc*-*-darwin* } } */
+/* { dg-options "-faltivec -fasm-blocks" } */
+
+extern void abort();
+
+int main( void )
+{
+ int i;
+ register vector float a = (vector float) (1.0f);
+ register vector float b = (vector float) (2.0f);
+ register vector float c = (vector float) (3.0f);
+ float result[4] = {5.00, 5.00, 5.00, 5.00};
+ union u {
+ vector float v;
+ float fv[4];
+ } uv;
+
+ asm
+ {
+ vmaddfp c, a, c, b
+ }
+
+ uv.v = c;
+
+ for (i=0; i < 4; i++)
+ if (uv.fv[i] != result[i])
+ abort();
+
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/gcc.apple/darwin-fsel-3.c b/gcc/testsuite/gcc.apple/darwin-fsel-3.c
new file mode 100644
index 00000000000..3c7b19e0453
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/darwin-fsel-3.c
@@ -0,0 +1,12 @@
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-O -mpowerpc-gfxopt" } */
+/* { dg-final { scan-assembler "fsub" } } */
+
+/* This is the same as gcc.dg/ppc-fsel-3.c, which is checking to see
+ that this optimization is *not* done, that is, that
+ -fno-trapping-math is the default. They can't both pass. */
+
+double foo(double a, double b, double c, double d)
+{
+ return a < b ? c : d;
+}
diff --git a/gcc/testsuite/gcc.apple/dg.exp b/gcc/testsuite/gcc.apple/dg.exp
new file mode 100644
index 00000000000..83910af8ac8
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/dg.exp
@@ -0,0 +1,40 @@
+# APPLE LOCAL file testsuite
+# Copyright (C) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Apple-specific GCC testsuite driver.
+# Note that this is basically a clone of gcc.dg/dg.exp, updated
+# whenever the original file changes (which is not very often).
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+# APPLE LOCAL preprocess .s files
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cSs\]]] \
+ "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.apple/execute/bitfield-1.c b/gcc/testsuite/gcc.apple/execute/bitfield-1.c
new file mode 100644
index 00000000000..bd472d28ccb
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/execute/bitfield-1.c
@@ -0,0 +1,52 @@
+/* { dg-do run { target *-*-darwin* } } */
+/* { dg-options "-O2 -fss-const-prop" } */
+/* APPLE LOCAL file bitfield zero initialization */
+/* <rdar://problem/3366203>:Setup Assistant crashes in SetModificationDateToPasteboard */
+/* <rdar://problem/3379022>:GCC compiler error in bitfield handling */
+
+
+typedef struct
+{
+ unsigned int b01 : 1;
+ unsigned int b02 : 2;
+ unsigned int b03 : 1;
+ unsigned int b04 : 1;
+ unsigned int b05 : 1;
+ unsigned int b06 : 1;
+ unsigned int b07 : 3;
+ unsigned int b08 : 3;
+ unsigned int b09 : 3;
+ unsigned int b10 : 3;
+ unsigned int b11 : 8;
+ unsigned int b12 : 1;
+ unsigned int b13 : 4;
+} test_struct;
+
+void func( test_struct* s, int t )
+{
+ s->b12 = 0;
+ s->b02 = 0;
+}
+
+main()
+{
+ test_struct r = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
+
+ func (&r, 42);
+
+ if (r.b01 != 1
+ || r.b03 != 1
+ || r.b04 != 1
+ || r.b05 != 1
+ || r.b06 != 1
+ || r.b07 != 1
+ || r.b08 != 1
+ || r.b09 != 1
+ || r.b10 != 1
+ || r.b11 != 1
+ || r.b13 != 1)
+ {
+ abort();
+ }
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.apple/execute/execute.exp b/gcc/testsuite/gcc.apple/execute/execute.exp
new file mode 100644
index 00000000000..f7b1f5b5eeb
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/execute/execute.exp
@@ -0,0 +1,43 @@
+# Copyright (C) 1991, 1992, 1993, 1995, 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Rob Savoye. (rob@cygnus.com)
+# Modified and maintained by Jeffrey Wheat (cassidy@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
+
+#
+# main test loop
+#
+
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
+ # If we're only testing specific files and this isn't one of them, skip it.
+ if ![runtest_file_p $runtests $src] then {
+ continue
+ }
+
+ c-torture-execute $src
+}
diff --git a/gcc/testsuite/gcc.apple/fenv-minmax-1.c b/gcc/testsuite/gcc.apple/fenv-minmax-1.c
new file mode 100644
index 00000000000..4385ae3ced6
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/fenv-minmax-1.c
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file Radar 3943021 */
+/* { dg-do compile { target powerpc-*-darwin* } } */
+/* { dg-options "-ffast-math" } */
+#pragma GCC fenv
+float size[2], tex_size;
+void
+test_of_pragma_fenv ()
+{
+ size[0] = ((size[0]) < (tex_size) ? (size[0]) : (tex_size));
+}
+
diff --git a/gcc/testsuite/gcc.apple/framework1.c b/gcc/testsuite/gcc.apple/framework1.c
new file mode 100644
index 00000000000..bd0203669c2
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/framework1.c
@@ -0,0 +1,12 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-nostdinc -c -F${srcdir}/gcc.apple" } */
+
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+#include <one/one.h>
+int main()
+{
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/fwritable-strings.c b/gcc/testsuite/gcc.apple/fwritable-strings.c
new file mode 100644
index 00000000000..4cf335a0db3
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/fwritable-strings.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-fwritable-strings" } */
+
+/*#include <stdio.h>*/
+void foo( void *dst)
+{
+ char *ucdst;
+
+ ucdst = (char *)dst;
+ ucdst++;
+ *ucdst = 'X';
+}
+
+int main()
+{
+ char *a = "Hello";
+ foo ((void *) a);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/import.c b/gcc/testsuite/gcc.apple/import.c
new file mode 100644
index 00000000000..110a2d249ed
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/import.c
@@ -0,0 +1,9 @@
+/* APPLE LOCAL file #import not deprecated */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+#import "importee.h"
+
+#import "importee.h"
+
+void foo (bar x) {}
diff --git a/gcc/testsuite/gcc.apple/importee.h b/gcc/testsuite/gcc.apple/importee.h
new file mode 100644
index 00000000000..86fbd11da4d
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/importee.h
@@ -0,0 +1,3 @@
+/* APPLE LOCAL file #import not deprecated */
+
+typedef int bar;
diff --git a/gcc/testsuite/gcc.apple/inttypes-1.c b/gcc/testsuite/gcc.apple/inttypes-1.c
new file mode 100644
index 00000000000..40404e2995b
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/inttypes-1.c
@@ -0,0 +1,21 @@
+/* APPLE LOCAL file test of inttypes.h formatter macros */
+
+/* { dg-do compile } */
+/* { dg-options "-Wall -W" } */
+
+#include <stdio.h>
+#include <inttypes.h>
+#include <stdint.h>
+
+int main ()
+{
+ uint32_t x = 12;
+ int32_t y = 15;
+ printf("x = %" PRIo32 "\n", x);
+ printf("x = %" PRIu32 "\n", x);
+ printf("x = %" PRIx32 "\n", x);
+ printf("x = %" PRIX32 "\n", x);
+ printf("y = %" PRId32 "\n", y);
+ printf("y = %" PRIi32 "\n", y);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/inttypes-2.c b/gcc/testsuite/gcc.apple/inttypes-2.c
new file mode 100644
index 00000000000..7ea63badc58
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/inttypes-2.c
@@ -0,0 +1,45 @@
+/* APPLE LOCAL file test of inttypes.h [U]INT*_C macros */
+
+/* { dg-do compile } */
+/* { dg-options "-Wall -W" } */
+
+#include <stdio.h>
+#include <inttypes.h>
+#include <stdint.h>
+
+#if INT8_C(3) != 3
+#error int8 comparison failed
+#endif
+
+#if INT16_C(-3) != -3
+#error int16 comparison failed
+#endif
+
+#if INT32_C(536870912) != 536870912L
+#error int32 comparison failed
+#endif
+
+#if INT64_C(536870912) != 536870912LL
+#error int64 comparison failed
+#endif
+
+#if UINT8_C(3) != 3
+#error int8 comparison failed
+#endif
+
+#if UINT16_C(3) != 3
+#error int16 comparison failed
+#endif
+
+#if UINT32_C(536870912) != 536870912UL
+#error int32 comparison failed
+#endif
+
+#if UINT64_C(536870912) != 536870912ULL
+#error int64 comparison failed
+#endif
+
+int main()
+{
+ return INT32_C(0);
+}
diff --git a/gcc/testsuite/gcc.apple/inttypes-3.c b/gcc/testsuite/gcc.apple/inttypes-3.c
new file mode 100644
index 00000000000..14fcd0805e0
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/inttypes-3.c
@@ -0,0 +1,51 @@
+/* APPLE LOCAL file test of inttypes.h SCN* and PRI* macros */
+
+/* { dg-do compile } */
+/* { dg-options "-Wall -W" } */
+
+#include <stdint.h>
+#include <stdio.h>
+#include <inttypes.h>
+
+#define TEST(tn, scn, pri) \
+do { \
+ tn x; \
+ scanf ("%" scn "\n", &x); \
+ printf ("%" pri "\n", x); \
+} while (0)
+
+void foo(void)
+{
+ TEST (int8_t, SCNd8, PRId8);
+ TEST (uint8_t, SCNu8, PRIu8);
+ TEST (int16_t, SCNd16, PRId16);
+ TEST (uint16_t, SCNu16, PRIu16);
+ TEST (int32_t, SCNd32, PRId32);
+ TEST (uint32_t, SCNu32, PRIu32);
+ TEST (int64_t, SCNd64, PRId64);
+ TEST (uint64_t, SCNu64, PRIu64);
+
+ TEST (int_least8_t, SCNdLEAST8, PRIdLEAST8);
+ TEST (uint_least8_t, SCNuLEAST8, PRIuLEAST8);
+ TEST (int_least16_t, SCNdLEAST16, PRIdLEAST16);
+ TEST (uint_least16_t, SCNuLEAST16, PRIuLEAST16);
+ TEST (int_least32_t, SCNdLEAST32, PRIdLEAST32);
+ TEST (uint_least32_t, SCNuLEAST32, PRIuLEAST32);
+ TEST (int_least64_t, SCNdLEAST64, PRIdLEAST64);
+ TEST (uint_least64_t, SCNuLEAST64, PRIuLEAST64);
+
+ TEST (int_fast8_t, SCNdFAST8, PRIdFAST8);
+ TEST (uint_fast8_t, SCNuFAST8, PRIuFAST8);
+ TEST (int_fast16_t, SCNdFAST16, PRIdFAST16);
+ TEST (uint_fast16_t, SCNuFAST16, PRIuFAST16);
+ TEST (int_fast32_t, SCNdFAST32, PRIdFAST32);
+ TEST (uint_fast32_t, SCNuFAST32, PRIuFAST32);
+ TEST (int_fast64_t, SCNdFAST64, PRIdFAST64);
+ TEST (uint_fast64_t, SCNuFAST64, PRIuFAST64);
+
+ TEST (intptr_t, SCNdPTR, PRIdPTR);
+ TEST (uintptr_t, SCNuPTR, PRIuPTR);
+
+ TEST (intmax_t, SCNdMAX, PRIdMAX);
+ TEST (uintmax_t, SCNuMAX, PRIuMAX);
+}
diff --git a/gcc/testsuite/gcc.apple/inttypes-4.c b/gcc/testsuite/gcc.apple/inttypes-4.c
new file mode 100644
index 00000000000..4f1029981bb
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/inttypes-4.c
@@ -0,0 +1,43 @@
+/* APPLE LOCAL file stdint.h */
+
+/* { dg-do run } */
+/* { dg-options "-Wall -W" } */
+
+/* Check SIG_ATOMIC_{MIN,MAX}, WINT_{MIN,MAX}. Also check that
+ stdint.h and sys/types.h can be included simultaneously. */
+
+#include <stdint.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <wchar.h>
+#include <stdlib.h>
+
+int main(void)
+{
+ sig_atomic_t s_a;
+ wint_t wi;
+
+ s_a = SIG_ATOMIC_MIN;
+ if (s_a != SIG_ATOMIC_MIN)
+ abort ();
+ if (s_a > 0)
+ abort ();
+ s_a--;
+ if (s_a != SIG_ATOMIC_MAX)
+ abort ();
+ if (s_a <= 0)
+ abort ();
+
+ wi = WINT_MIN;
+ if (wi != WINT_MIN)
+ abort ();
+ if (wi > 0)
+ abort ();
+ wi--;
+ if (wi != WINT_MAX)
+ abort ();
+ if (wi <= 0)
+ abort ();
+
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.apple/inttypes-wchar-1.c b/gcc/testsuite/gcc.apple/inttypes-wchar-1.c
new file mode 100644
index 00000000000..6799c59c5eb
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/inttypes-wchar-1.c
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file test of wchar_t's definition in inttypes.h */
+
+/* { dg-do run } */
+/* { dg-options "-Wall -W" } */
+
+#include <inttypes.h>
+#include <stdint.h>
+
+/* Verify that WCHAR_MAX is the largest positive 32-bit integer */
+#if WCHAR_MAX != 0x7fffffff
+# error WCHAR_MAX has incorrect value
+#endif
+
+/* Verify that WCHAR_MIN is negative and consistent with WCHAR_MAX. */
+#if WCHAR_MIN != (-WCHAR_MAX-1)
+# error WCHAR_MIN has incorrect value
+#endif
+
+int dummy1[5 - sizeof(wchar_t)] = { 0 };
+int dummy2[sizeof(wchar_t) - 3] = { 0 };
+
+int main ()
+{
+ /* Verify that wchar_t is a 32-bit type. */
+ return (sizeof(wchar_t) == 4) ? 0 : 1;
+}
diff --git a/gcc/testsuite/gcc.apple/inttypes-wchar-2.c b/gcc/testsuite/gcc.apple/inttypes-wchar-2.c
new file mode 100644
index 00000000000..0021b3dc0fc
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/inttypes-wchar-2.c
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file test that the definition of wchar_t in
+ inttypes.h gives sizeof(wchar_t) == 2 when using -fshort-wchar. */
+
+/* { dg-do run } */
+/* { dg-options "-Wall -W -fshort-wchar" } */
+
+#include <inttypes.h>
+#include <stdint.h>
+
+/* Verify that WCHAR_MAX is the largest unsigned 16-bit integer. */
+#if WCHAR_MAX != 0xffffU
+# error WCHAR_MAX has incorrect value
+#endif
+
+/* Verify that WCHAR_MIN is 0 */
+#if WCHAR_MIN != 0
+# error WCHAR_MIN has incorrect value
+#endif
+
+int dummy1[3 - sizeof(wchar_t)] = { 0 };
+int dummy2[sizeof(wchar_t) - 1] = { 0 };
+
+int main ()
+{
+ return (sizeof(wchar_t) == 2) ? 0 : 1;
+}
diff --git a/gcc/testsuite/gcc.apple/lazy-ptr-test.c b/gcc/testsuite/gcc.apple/lazy-ptr-test.c
new file mode 100644
index 00000000000..da66b518ff0
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/lazy-ptr-test.c
@@ -0,0 +1,18 @@
+/* { dg-do compile { target powerpc*-apple-darwin* } } */
+/* { dg-options "-S" } */
+
+void f () __attribute__((weak_import));
+
+typedef void PF (void);
+
+void f(void){};
+
+PF* g (void) { return f; }
+
+int main()
+{
+ (*g())();
+ return 0;
+}
+
+/* { dg-final { scan-assembler "non_lazy_ptr" } } */
diff --git a/gcc/testsuite/gcc.apple/mac68k-align-unsup.c b/gcc/testsuite/gcc.apple/mac68k-align-unsup.c
new file mode 100644
index 00000000000..52c0b2e2573
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/mac68k-align-unsup.c
@@ -0,0 +1,9 @@
+/* APPLE LOCAL file 64-bit */
+/* Darwin (Mac OS X) alignment exercises. */
+
+/* { dg-do compile { target powerpc-*-darwin[89]* } } */
+/* { dg-options "-m64 -malign-mac68k" } */
+
+/* { dg-error "-malign-mac68k is not allowed for 64-bit Darwin" "" { target *-*-* } 1 } */
+
+main() {}
diff --git a/gcc/testsuite/gcc.apple/no-math-errno.c b/gcc/testsuite/gcc.apple/no-math-errno.c
new file mode 100644
index 00000000000..cad9edf8be2
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/no-math-errno.c
@@ -0,0 +1,8 @@
+/* APPLE LOCAL math-errno off by default 3619824 */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-mpowerpc-gpopt -O2" } */
+/* { dg-final { scan-assembler-not "fcmpu" } } */
+extern double sqrt(double);
+float foo(float y) {
+ return sqrt(y);
+}
diff --git a/gcc/testsuite/gcc.apple/no-warning.c b/gcc/testsuite/gcc.apple/no-warning.c
new file mode 100644
index 00000000000..9b71d722239
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/no-warning.c
@@ -0,0 +1,8 @@
+/* APPLE LOCAL file -Wno-#warnings */
+
+/* { dg-do compile } */
+/* { dg-options "-Wno-#warnings" } */
+
+#warning "suppress this warning"
+
+int a;
diff --git a/gcc/testsuite/gcc.apple/non-lazy-ptr-test.c b/gcc/testsuite/gcc.apple/non-lazy-ptr-test.c
new file mode 100644
index 00000000000..e496784d32b
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/non-lazy-ptr-test.c
@@ -0,0 +1,40 @@
+/* { dg-do compile { target powerpc*-apple-darwin* } } */
+/* { dg-options "-S" } */
+
+typedef void PF (void);
+
+static void f(void) {
+}
+
+void f1(void) {
+}
+
+extern void f2(void) {
+}
+
+static void f3(void);
+
+__private_extern__ void pe(void)
+{
+}
+
+PF* g (void) { f(); return f; }
+PF* x (void) { return f1; }
+PF* y (void) { f2(); return f2; }
+PF* z (void) { return f3; }
+PF* w (void) { pe(); return pe; }
+
+int main()
+{
+ (*g())();
+ (*x())();
+ (*y())();
+ (*z())();
+ (*w())();
+ return 0;
+}
+
+void f3(void) {
+}
+
+/* { dg-final { scan-assembler-not "non_lazy_ptr" } } */
diff --git a/gcc/testsuite/gcc.apple/notailcall-1.c b/gcc/testsuite/gcc.apple/notailcall-1.c
new file mode 100644
index 00000000000..ee072d283fd
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/notailcall-1.c
@@ -0,0 +1,73 @@
+/* APPLE LOCAL file Radar 3830232 */
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-O2" } */
+/* { dg-final { scan-assembler-not "\(jmp|b\)\[ \\t\]+_*init_iconv_desc" } } */
+/* Contributed by Andrew Pinski 26 Oct 2004 <pinskia@gcc.gnu.org> */
+
+struct cset_converter { int func; int cd; };
+void abort(void); int puts(const char*);
+int f(int i){return i;}
+void g(void){puts("hi");}
+struct conversion
+{
+ int pair;
+ int func;
+ int fake_cd;
+};
+static const struct conversion conversion_tab[] = {
+ { 2, 2, 2 },
+ { 3, 3, 3 }
+};
+static struct cset_converter
+init_iconv_desc (int i)
+{
+ struct cset_converter ret;
+ unsigned i1;
+ char *pair;
+ if (!i)
+ {
+ ret.func = 0;
+ ret.cd = 0;
+ return ret;
+ }
+ pair = __builtin_alloca(i*3);
+ for (i1 = 0; i1 < (sizeof (conversion_tab) / sizeof ((conversion_tab)[0])); i1++)
+ if (i == conversion_tab[i1].pair)
+ {
+ ret.func = conversion_tab[i1].func;
+ ret.cd = conversion_tab[i1].fake_cd;
+ return ret;
+ }
+
+ ret.func = 2;
+ ret.cd = f(i);
+ if (ret.cd == 4)
+ {
+ g();
+ ret.func = 4;
+ }
+ return ret;
+}
+struct f
+{
+ struct cset_converter a;
+ struct cset_converter b;
+};
+
+void ff(struct f *a)
+{
+ a->a = init_iconv_desc(0);
+ /* Compiler was illegally optimizing this call into a tailcall (jmp). Radar 3830232 */
+ a->b = init_iconv_desc(1);
+}
+
+int main(void)
+{
+ struct f a;
+ ff (&a);
+ if (a.a.func!=0 || a.a.cd !=0)
+ abort();
+ if (a.b.func!=2 || a.b.cd !=1)
+ abort();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/objcpp.c b/gcc/testsuite/gcc.apple/objcpp.c
new file mode 100644
index 00000000000..64728306efd
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/objcpp.c
@@ -0,0 +1,6 @@
+/* { dg-options "-x objc++-cpp-output $srcdir/gcc.apple/objcpp.c" } */
+
+/* Radar 3981486 */
+
+int main() {
+}
diff --git a/gcc/testsuite/gcc.apple/one.framework/Headers/one.h b/gcc/testsuite/gcc.apple/one.framework/Headers/one.h
new file mode 100644
index 00000000000..50c24d3e6c5
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/one.framework/Headers/one.h
@@ -0,0 +1,3 @@
+/* Contributed by Devang Patel <dpatel@apple.com> */
+
+/* Empty header */
diff --git a/gcc/testsuite/gcc.apple/pascal-strings-1.c b/gcc/testsuite/gcc.apple/pascal-strings-1.c
new file mode 100644
index 00000000000..c4e2d86ddc9
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/pascal-strings-1.c
@@ -0,0 +1,46 @@
+/* APPLE LOCAL file pascal strings */
+/* Positive C test cases. */
+/* Origin: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do run } */
+/* { dg-options "-std=iso9899:1999 -fpascal-strings" } */
+
+typedef __WCHAR_TYPE__ wchar_t;
+typedef __SIZE_TYPE__ size_t;
+
+extern void abort (void);
+extern size_t strlen (const char *s);
+
+const unsigned char *pascalStr1 = "\pHello, World!";
+const unsigned char *concat1 = "\pConcatenated" "string" "\pliteral";
+
+const unsigned char msg1[] = "\pHello"; /* ok */
+const unsigned char *msg2 = "\pHello"; /* ok */
+const signed char msg3[] = "\pHello"; /* ok */
+const char msg4[] = "\pHello"; /* ok */
+unsigned char msg5[] = "\pHello"; /* ok */
+signed char msg7[] = "\pHello"; /* ok */
+char msg8[] = "\pHello"; /* ok */
+
+int
+main (void)
+{
+ const unsigned char *pascalStr2 = "\pGood-bye!";
+
+ if (strlen ((const char *)pascalStr1) != 14)
+ abort ();
+ if (*pascalStr1 != 13)
+ abort (); /* the length byte does not include trailing null */
+
+ if (strlen ((const char *)pascalStr2) != 10)
+ abort ();
+ if (*pascalStr2 != 9)
+ abort ();
+
+ if (strlen ((const char *)concat1) != 26)
+ abort ();
+ if (*concat1 != 25)
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/pascal-strings-2.c b/gcc/testsuite/gcc.apple/pascal-strings-2.c
new file mode 100644
index 00000000000..b25c6cf8013
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/pascal-strings-2.c
@@ -0,0 +1,45 @@
+/* APPLE LOCAL file pascal strings */
+/* Negative C test cases. */
+/* Origin: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999 -Wwrite-strings -fpascal-strings" } */
+
+typedef __WCHAR_TYPE__ wchar_t;
+
+const wchar_t *pascalStr1 = L"\pHi!"; /* { dg-warning "unknown escape sequence" } */
+const wchar_t *pascalStr2 = L"Bye\p!"; /* { dg-warning "unknown escape sequence" } */
+
+const wchar_t *initErr0 = "\pHi"; /* { dg-warning "incompatible pointer type" } */
+const wchar_t initErr0a[] = "\pHi"; /* { dg-error "initialized from non-wide string" } */
+const wchar_t *initErr1 = "Bye"; /* { dg-warning "incompatible pointer type" } */
+const wchar_t initErr1a[] = "Bye"; /* { dg-error "initialized from non-wide string" } */
+
+const char *initErr2 = L"Hi"; /* { dg-warning "incompatible pointer type" } */
+const char initErr2a[] = L"Hi"; /* { dg-error "initialized from wide string" } */
+const signed char *initErr3 = L"Hi"; /* { dg-warning "incompatible pointer type" } */
+const signed char initErr3a[] = L"Hi"; /* { dg-error "initialized from wide string" } */
+const unsigned char *initErr4 = L"Hi"; /* { dg-warning "incompatible pointer type" } */
+const unsigned char initErr4a[] = L"Hi"; /* { dg-error "initialized from wide string" } */
+
+const char *pascalStr3 = "Hello\p, World!"; /* { dg-warning "unknown escape sequence" } */
+
+const char *concat2 = "Hi" "\pthere"; /* { dg-warning "unknown escape sequence" } */
+const char *concat3 = "Hi" "there\p"; /* { dg-warning "unknown escape sequence" } */
+
+const unsigned char *s2 = "\pGoodbye!"; /* ok */
+unsigned char *s3 = "\pHi!"; /* { dg-warning "initialization discards qualifiers" } */
+char *s4 = "\pHi"; /* { dg-warning "initialization discards qualifiers" } */
+signed char *s5 = "\pHi"; /* { dg-warning "initialization discards qualifiers" } */
+const signed char *s6 = "\pHi"; /* { dg-warning "differ in signedness" } */
+
+/* the maximum length of a Pascal literal is 255. */
+const unsigned char *almostTooLong =
+ "\p12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "123456789012345"; /* ok */
+const unsigned char *definitelyTooLong =
+ "\p12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "12345678901234567890123456789012345678901234567890123456789012345678901234567890"
+ "1234567890123456"; /* { dg-error "too long" } */
diff --git a/gcc/testsuite/gcc.apple/pascal-strings-3.c b/gcc/testsuite/gcc.apple/pascal-strings-3.c
new file mode 100644
index 00000000000..477b94bbff2
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/pascal-strings-3.c
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file pascal strings */
+/* Ensure that there are no warnings or errors issued when a Pascal string is used to
+ initialize an array and the NUL terminator does not fit. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-fpascal-strings" } */
+
+typedef unsigned char Str15[16];
+
+Str15 ggg = "\p012345678901234";
+Str15 hhh = "\p0123456789012345"; /* { dg-warning "initializer.string for array of chars is too long" } */
+
+int foo(void)
+{
+ Str15 sss = "\p012345678901234";
+ Str15 ttt = "\p0123456789012345"; /* { dg-warning "initializer.string for array of chars is too long" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.apple/power-align-unsup.c b/gcc/testsuite/gcc.apple/power-align-unsup.c
new file mode 100644
index 00000000000..63d86853a97
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/power-align-unsup.c
@@ -0,0 +1,8 @@
+/* Darwin (Mac OS X) alignment exercises. */
+
+/* { dg-do compile { target powerpc-*-darwin[89]* } } */
+/* { dg-options "-m64 -malign-power" } */
+
+/* { dg-error "-malign-power is not supported for 64-bit Darwin" "" { target *-*-* } 1 } */
+
+main() {}
diff --git a/gcc/testsuite/gcc.apple/ppc-ignored-options.c b/gcc/testsuite/gcc.apple/ppc-ignored-options.c
new file mode 100644
index 00000000000..e08634f4fe5
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/ppc-ignored-options.c
@@ -0,0 +1,11 @@
+/* Test options to ignore. */
+
+/* { dg-do run { target powerpc-*-darwin* } } */
+/* { dg-options "-msse -msse2 -march=pentium4 -mcpu=pentium4" } */
+
+int
+main ()
+{
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.apple/ppc_intrinsics-1.c b/gcc/testsuite/gcc.apple/ppc_intrinsics-1.c
new file mode 100644
index 00000000000..3df118853ca
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/ppc_intrinsics-1.c
@@ -0,0 +1,35 @@
+/* { dg-options "-I ${srcdir}/../../more-hdrs" } */
+/* { dg-do compile { target "powerpc*-*-darwin*" } } */
+/* Radar 3208244 */
+#include "ppc_intrinsics.h"
+#include <stdlib.h>
+
+int main( void )
+{
+ int i,j;
+ int value;
+ register int temp;
+ double a,b,c,d;
+ a = 1.;b=2.;c=3.;
+
+ d = __fmadd(a,b,c);
+ a = __fmadd(c,b,d);
+ d = __fmadd(a,b,c);
+
+ __lwsync();
+ __nop();
+ __lwsync();
+ __nop();
+ d = __fctidz(a);
+ d = __fctidz(d);
+ b = __fctid(a);
+ b = __fctid(b);
+ c = __fcfid(a);
+ c = __fcfid(c);
+ __dcbzl(32,&value);
+ __dcbzl(&value,0);
+
+ return a+b+c+d;
+}
+
+
diff --git a/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c b/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c
new file mode 100644
index 00000000000..2f5698fc685
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/ppc_intrinsics-2.c
@@ -0,0 +1,66 @@
+/* { dg-options "-I ${srcdir}/../../more-hdrs -Wshorten-64-to-32 -Wno-long-long" } */
+/* { dg-do run { target "powerpc*-*-darwin*" } } */
+#include "ppc_intrinsics.h"
+#include <stdlib.h>
+
+int main( void )
+{
+ int intconst = 0x5;
+ long long longlongconst = 0x5;
+ int intloc, intloc1, intloc2;
+ unsigned int uintloc, uintloc1, uintloc2;
+ long longloc;
+ long long longlongloc;
+ int fails = 0;
+
+ intloc = __cntlzw(intconst);
+ if (intloc != 29)
+ ++fails;
+
+ longlongloc = __cntlzd(longlongconst);
+ if (longlongloc != 61)
+ ++fails;
+
+ intloc = 0xffff;
+ __rlwimi(intloc, 0x21876543, 8, 0, 23);
+ if (intloc != 0x876543ff)
+ ++fails;
+
+ intloc = __rlwinm(0x21876543, 8, 0, 31);
+ if (intloc != 0x87654321)
+ ++fails;
+
+ longloc = __rlwinm(0x45, 5, 24, 31);
+ if (longloc != 0xa0)
+ ++fails;
+
+ longloc = __rlwnm(0x47, 5, 24, 31);
+ if (longloc != 0xe0)
+ ++fails;
+
+ intloc1 = 1 << 20;
+ intloc2 = 1 << 21;
+ intloc = __mulhw (intloc1, intloc2);
+ if (intloc != (1 << 9))
+ ++fails;
+
+ intloc1 = 0xfffe0000;
+ intloc2 = 0xfffc0000;
+ intloc = __mulhw (intloc1, intloc2);
+ if (intloc != 8)
+ ++fails;
+
+ uintloc1 = 0xffffffff;
+ uintloc2 = 0xfffffffe;
+ uintloc = __mulhwu (uintloc1, uintloc2);
+ if (uintloc != 0xfffffffd)
+ ++fails;
+
+ uintloc1 = 0xfffe0000;
+ uintloc2 = 0xfffc0000;
+ uintloc = __mulhwu (uintloc1, uintloc2);
+ if (uintloc != 0xfffa0008)
+ ++fails;
+
+ return fails;
+}
diff --git a/gcc/testsuite/gcc.apple/preprocess.s b/gcc/testsuite/gcc.apple/preprocess.s
new file mode 100644
index 00000000000..897f2a7d6b1
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/preprocess.s
@@ -0,0 +1,16 @@
+/* APPLE LOCAL file preprocess .s files */
+
+/* Regression test - in assembly language, # may have some significance
+ other than 'stringize macro argument' and therefore must be preserved
+ in the output, and should not be warned about. */
+
+/* { dg-do preprocess } */
+
+#define foo() mov r0, #5 /* { dg-bogus "not followed" "spurious warning" } */
+
+entry:
+ foo()
+
+/* Check we don't EOF on an unknown directive. */
+#unknown directive
+#error a later diagnostic /* { dg-error "diagnostic" } */
diff --git a/gcc/testsuite/gcc.apple/shorten.c b/gcc/testsuite/gcc.apple/shorten.c
new file mode 100644
index 00000000000..842979b4ed9
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/shorten.c
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file 64bit shorten warning 3865314 */
+/* { dg-do compile } */
+/* { dg-options "-Wshorten-64-to-32" } */
+/* Radar 3865314 */
+
+long long ll;
+int i;
+char c;
+
+void bar (int);
+
+void foo() {
+ c = i;
+ c = ll;
+ i = (int) ll;
+ i = ll; /* { dg-warning "implicit conversion shortens 64-bit value into a 32-bit value" } */
+ i += ll; /* { dg-warning "implicit conversion shortens 64-bit value into a 32-bit value" } */
+ i = i ? ll : i;/* { dg-warning "implicit conversion shortens 64-bit value into a 32-bit value" } */
+ bar (ll); /* { dg-warning "implicit conversion shortens 64-bit value into a 32-bit value" } */
+}
diff --git a/gcc/testsuite/gcc.apple/special/liblongcall.c b/gcc/testsuite/gcc.apple/special/liblongcall.c
new file mode 100644
index 00000000000..6a952281ecd
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/special/liblongcall.c
@@ -0,0 +1,10 @@
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-mlongcall" } */
+#include <stdio.h>
+
+int
+dy_foo (char *str, int i)
+{
+ printf ("dy_foo (\"%s\", %d)\n", str, i);
+ return i + 1;
+}
diff --git a/gcc/testsuite/gcc.apple/special/longcall-prog.c b/gcc/testsuite/gcc.apple/special/longcall-prog.c
new file mode 100644
index 00000000000..5cbb8c0e4ee
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/special/longcall-prog.c
@@ -0,0 +1,18 @@
+#include <stdlib.h>
+#include <stdio.h>
+
+/* declare all externally visible functions in libweak.c */
+int dy_foo (char *, int);
+
+main ()
+{
+ int answer, x=41;
+ char *str = "foostr";
+ printf ("%s begins:\n", __FILE__);
+ answer = dy_foo (str, x);
+ printf ("dy_foo (\"%s\", %d) = %d", str, x, answer);
+ if (answer != 42)
+ printf (" (error!)");
+ printf ("\n%s done.\n", __FILE__);
+ exit (answer != 42);
+}
diff --git a/gcc/testsuite/gcc.apple/special/longcall.exp b/gcc/testsuite/gcc.apple/special/longcall.exp
new file mode 100644
index 00000000000..d9ebd1270ea
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/special/longcall.exp
@@ -0,0 +1,69 @@
+# APPLE LOCAL file testsuite
+# Copyright (C) 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Initialize `dg'.
+dg-init
+
+set timeout 30
+
+set prms_id 0
+set bug_id 0
+
+set testfile "longcall-prog"
+set binfile ${objdir}/${subdir}/${testfile}
+set srcfile ${srcdir}/${subdir}/${testfile}.c
+
+set libfilestem "longcall"
+set libfile "lib${libfilestem}"
+set libbinfile ${objdir}/${subdir}/${libfile}.dylib
+set libsrcfile ${srcdir}/${subdir}/${libfile}.c
+
+file mkdir ${objdir}/${subdir}
+
+set test "longcall/dylib"
+
+proc note_result {success diagnostic} {
+ set verb [expr {($success) ? "pass" : "fail"}]
+ eval {$verb $diagnostic}
+}
+
+set whine "building $test library"
+set additional_flags "additional_flags=-dynamiclib -mlongcall"
+set result [expr {[gcc_target_compile "${libsrcfile}" "${libbinfile}" executable [list debug $additional_flags]] == ""}]
+note_result $result $whine
+
+set whine "building $test test program"
+set additional_flags "additional_flags=-L${objdir}/${subdir} -l${libfilestem}"
+set result [expr {[gcc_target_compile "${srcfile}" "${binfile}" executable [list debug $additional_flags]] == ""}]
+note_result $result $whine
+
+set result [gcc_load "$binfile" "" ""]
+set status [lindex $result 0]
+set output [lindex $result 1];
+if {$status == "pass" } {
+ pass $test
+ file delete $libbinfile $binfile
+} else {
+ fail $test
+}
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.apple/special/special.exp b/gcc/testsuite/gcc.apple/special/special.exp
new file mode 100644
index 00000000000..5344a4817b7
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/special/special.exp
@@ -0,0 +1,42 @@
+# APPLE LOCAL file testsuite
+# Copyright (C) 2002 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# Initialize `dg'.
+dg-init
+
+# Test the zerofill support by seeing if a file with a large array
+# compiled -fno-common has a small size on disk.
+
+gcc_target_compile "$srcdir/$subdir/zerofill.c" "zerofill.o" object \
+ "additional_flags=-fno-common"
+
+set size [ exec wc -c < zerofill.o ]
+
+if { $size < 100000 } {
+ pass "zerofill"
+} else {
+ fail "zerofill"
+}
+
+file delete zerofill.o
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.apple/special/zerofill.c b/gcc/testsuite/gcc.apple/special/zerofill.c
new file mode 100644
index 00000000000..e4bd84c816f
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/special/zerofill.c
@@ -0,0 +1,5 @@
+/* APPLE LOCAL file zerofill */
+
+int arr[40000];
+
+foo() {}
diff --git a/gcc/testsuite/gcc.apple/string-insns.c b/gcc/testsuite/gcc.apple/string-insns.c
new file mode 100644
index 00000000000..aee058d5548
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/string-insns.c
@@ -0,0 +1,9 @@
+/* APPLE LOCAL Disable string insns with -Os on Darwin (radar 3509006) */
+/* { dg-do compile { target powerpc*-apple-darwin* } } */
+/* { dg-options "-Os" } */
+/* On ppc at Apple, -Os should not use string instructions. 3509006. */
+struct s { int a; int b; int c; };
+int foo (struct s* p, struct s* q) {
+ *p = *q;
+}
+/* { dg-final { scan-assembler-not "lswi" } } */
diff --git a/gcc/testsuite/gcc.apple/test-ldouble.c b/gcc/testsuite/gcc.apple/test-ldouble.c
new file mode 100644
index 00000000000..fe85d86e0e1
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/test-ldouble.c
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+/* { dg-options "-Os" } */
+
+extern void __inline_x80told(long double *x);
+extern double rint( double );
+
+extern unsigned long AECreateDesc(const void * dataPtr);
+
+unsigned long aeCoercePtrToMagnitude()
+{
+ unsigned long err = 0;
+ unsigned long magValue;
+ double doubleValue;
+ long double longDoubleValue;
+
+ __inline_x80told(&longDoubleValue);
+ doubleValue = longDoubleValue;
+ if (doubleValue < 0)
+ err = 2;
+ else
+ magValue = (unsigned long) rint(doubleValue);
+ err = AECreateDesc(&magValue);
+ return err;
+}
diff --git a/gcc/testsuite/gcc.apple/test-local-static-longlong.c b/gcc/testsuite/gcc.apple/test-local-static-longlong.c
new file mode 100644
index 00000000000..19afa53c016
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/test-local-static-longlong.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { dg-options "-Wno-long-long" } */
+
+#include <stdlib.h>
+
+long long foo()
+{
+ static long long rat = (1LL<<62);
+ return rat;
+}
+
+int main()
+{
+
+ if (foo() != (1LL<<62))
+ abort();
+ exit(0);
+}
+
diff --git a/gcc/testsuite/gcc.apple/x86-ignored-options.c b/gcc/testsuite/gcc.apple/x86-ignored-options.c
new file mode 100644
index 00000000000..d48919758bf
--- /dev/null
+++ b/gcc/testsuite/gcc.apple/x86-ignored-options.c
@@ -0,0 +1,11 @@
+/* Test options to ignore. */
+
+/* { dg-do run { target i?86-*-darwin* } } */
+/* { dg-options "-faltivec -mno-fused-madd -mlong-branch -mlongcall -mcpu=G4 -mcpu=G5" } */
+
+int
+main ()
+{
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20050303-1.c b/gcc/testsuite/gcc.c-torture/compile/20050303-1.c
new file mode 100644
index 00000000000..005a8c50ea4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20050303-1.c
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file mainline */
+void crc()
+{
+ int toread;
+ long long nleft;
+ unsigned char buf[(128 * 1024)];
+
+ nleft = 0;
+ while (toread = (nleft < (2147483647 * 2U + 1U)) ? nleft: (2147483647 * 2U + 1U) )
+ ;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-4.x b/gcc/testsuite/gcc.c-torture/compile/simd-4.x
new file mode 100644
index 00000000000..0ab59899f66
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/simd-4.x
@@ -0,0 +1,4 @@
+# APPLE LOCAL file vector instructions are not supported except with -faltivec
+
+if { [istarget "*-apple-darwin*"] } { set options "-faltivec" }
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/pr17133.c b/gcc/testsuite/gcc.c-torture/execute/pr17133.c
new file mode 100644
index 00000000000..6357d03a54f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/pr17133.c
@@ -0,0 +1,28 @@
+/* APPLE LOCAL file mainline */
+extern void abort (void);
+
+int foo = 0;
+void *bar = 0;
+unsigned int baz = 100;
+
+void *pure_alloc ()
+{
+ void *res;
+
+ while (1)
+ {
+ res = (void *) ((((unsigned int) (foo + bar))) & ~1);
+ foo += 2;
+ if (foo < baz)
+ return res;
+ foo = 0;
+ }
+}
+
+int main ()
+{
+ pure_alloc ();
+ if (!foo)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/simd-1.x b/gcc/testsuite/gcc.c-torture/execute/simd-1.x
new file mode 100644
index 00000000000..927ee563529
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/simd-1.x
@@ -0,0 +1,7 @@
+# APPLE LOCAL file vector instructions are not supported except with -faltivec
+
+if { [istarget "*-apple-darwin*"] } {
+ set torture_compile_xfail "*-apple-darwin*"
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/simd-2.x b/gcc/testsuite/gcc.c-torture/execute/simd-2.x
new file mode 100644
index 00000000000..927ee563529
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/simd-2.x
@@ -0,0 +1,7 @@
+# APPLE LOCAL file vector instructions are not supported except with -faltivec
+
+if { [istarget "*-apple-darwin*"] } {
+ set torture_compile_xfail "*-apple-darwin*"
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.dg/c99-tgmath-1.c b/gcc/testsuite/gcc.dg/c99-tgmath-1.c
new file mode 100644
index 00000000000..e4890226511
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c99-tgmath-1.c
@@ -0,0 +1,248 @@
+/* APPLE LOCAL file radar 2872232 */
+/* Test for <tgmath.h> in C99. */
+/* Origin: Matt Austern <austern@apple.com>
+/* { dg-do preprocess } */
+/* { dg-options "-std=iso9899:1999" } */
+
+/* Test that tgmath defines the macros it's supposed to. */
+#include <tgmath.h>
+
+#ifndef acos
+#error acos undefined
+#endif
+
+#ifndef asin
+#error asin undefined
+#endif
+
+#ifndef atan
+#error atan undefined
+#endif
+
+#ifndef acosh
+#error acosh undefined
+#endif
+
+#ifndef asinh
+#error asinh undefined
+#endif
+
+#ifndef atanh
+#error atanh undefined
+#endif
+
+#ifndef cos
+#error cos undefined
+#endif
+
+#ifndef sin
+#error sin undefined
+#endif
+
+#ifndef tan
+#error tan undefined
+#endif
+
+#ifndef cosh
+#error cosh undefined
+#endif
+
+#ifndef sinh
+#error sinh undefined
+#endif
+
+#ifndef tanh
+#error tanh undefined
+#endif
+
+#ifndef exp
+#error exp undefined
+#endif
+
+#ifndef log
+#error log undefined
+#endif
+
+#ifndef pow
+#error pow undefined
+#endif
+
+#ifndef sqrt
+#error sqrt undefined
+#endif
+
+#ifndef fabs
+#error fabs undefined
+#endif
+
+#ifndef atan2
+#error atan2 undefined
+#endif
+
+#ifndef cbrt
+#error cbrt undefined
+#endif
+
+#ifndef ceil
+#error ceil undefined
+#endif
+
+#ifndef copysign
+#error copysign undefined
+#endif
+
+#ifndef erf
+#error erf undefined
+#endif
+
+#ifndef erfc
+#error erfc undefined
+#endif
+
+#ifndef exp2
+#error exp2 undefined
+#endif
+
+#ifndef expm1
+#error expm1 undefined
+#endif
+
+#ifndef fdim
+#error fdim undefined
+#endif
+
+#ifndef floor
+#error floor undefined
+#endif
+
+#ifndef fma
+#error fma undefined
+#endif
+
+#ifndef fmax
+#error fmax undefined
+#endif
+
+#ifndef fmin
+#error fmin undefined
+#endif
+
+#ifndef fmod
+#error fmod undefined
+#endif
+
+#ifndef frexp
+#error frexp undefined
+#endif
+
+#ifndef hypot
+#error hypot undefined
+#endif
+
+#ifndef ilogb
+#error ilogb undefined
+#endif
+
+#ifndef ldexp
+#error ldexp undefined
+#endif
+
+#ifndef lgamma
+#error lgamma undefined
+#endif
+
+#ifndef llrint
+#error llrint undefined
+#endif
+
+#ifndef llround
+#error llround undefined
+#endif
+
+#ifndef log10
+#error log10 undefined
+#endif
+
+#ifndef log1p
+#error log1p undefined
+#endif
+
+#ifndef log2
+#error log2 undefined
+#endif
+
+#ifndef logb
+#error logb undefined
+#endif
+
+#ifndef lrint
+#error lrint undefined
+#endif
+
+#ifndef lround
+#error lround undefined
+#endif
+
+#ifndef nearbyint
+#error nearbyint undefined
+#endif
+
+#ifndef nextafter
+#error nextafter undefined
+#endif
+
+#ifndef nexttoward
+#error nexttoward undefined
+#endif
+
+#ifndef remainder
+#error remainder undefined
+#endif
+
+#ifndef remquo
+#error remquo undefined
+#endif
+
+#ifndef rint
+#error rint undefined
+#endif
+
+#ifndef round
+#error round undefined
+#endif
+
+#ifndef scalbn
+#error scalbn undefined
+#endif
+
+#ifndef scalbln
+#error scalbln undefined
+#endif
+
+#ifndef tgamma
+#error tgamma undefined
+#endif
+
+#ifndef trunc
+#error trunc undefined
+#endif
+
+#ifndef carg
+#error carg undefined
+#endif
+
+#ifndef cimag
+#error cimag undefined
+#endif
+
+#ifndef conj
+#error conj undefined
+#endif
+
+#ifndef cproj
+#error cproj undefined
+#endif
+
+#ifndef creal
+#error creal undefined
+#endif
diff --git a/gcc/testsuite/gcc.dg/c99-tgmath-2.c b/gcc/testsuite/gcc.dg/c99-tgmath-2.c
new file mode 100644
index 00000000000..35978cc8469
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c99-tgmath-2.c
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file radar 2872232 */
+/* Test for <tgmath.h> in C99. */
+/* Origin: Matt Austern <austern@apple.com>
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999" } */
+
+/* Test that invoking type-generic sin on a float invokes sinf. */
+#include <tgmath.h>
+
+float foo(float x)
+{
+ return sin(x);
+}
+
+/* {dg-final {scan-assembler "sinf" } } */
diff --git a/gcc/testsuite/gcc.dg/c99-tgmath-3.c b/gcc/testsuite/gcc.dg/c99-tgmath-3.c
new file mode 100644
index 00000000000..9d164095a70
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c99-tgmath-3.c
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file radar 2872232 */
+/* Test for <tgmath.h> in C99. */
+/* Origin: Matt Austern <austern@apple.com>
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999" } */
+
+/* Test that invoking type-generic exp on a complex invokes cexp. */
+#include <tgmath.h>
+
+complex double foo(complex double x)
+{
+ return exp(x);
+}
+
+/* {dg-final {scan-assembler "cexp" } } */
diff --git a/gcc/testsuite/gcc.dg/c99-tgmath-4.c b/gcc/testsuite/gcc.dg/c99-tgmath-4.c
new file mode 100644
index 00000000000..dbb8d1c341c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/c99-tgmath-4.c
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file radar 2872232 */
+/* Test for <tgmath.h> in C99. */
+/* Origin: Matt Austern <austern@apple.com>
+/* { dg-do compile } */
+/* { dg-options "-std=iso9899:1999" } */
+
+/* Test that invoking type-generic pow on complex float invokes cpowf. */
+#include <tgmath.h>
+
+complex double foo(complex float x, float y)
+{
+ return pow(x, y);
+}
+
+/* {dg-final {scan-assembler "cpowf" } } */
diff --git a/gcc/testsuite/gcc.dg/cast-lvalue-2.c b/gcc/testsuite/gcc.dg/cast-lvalue-2.c
index ed6a2e69fe8..0d52a6253c7 100644
--- a/gcc/testsuite/gcc.dg/cast-lvalue-2.c
+++ b/gcc/testsuite/gcc.dg/cast-lvalue-2.c
@@ -1,7 +1,8 @@
/* Test for error on casts as lvalues. Casts to same type. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
-/* { dg-options "" } */
+/* APPLE LOCAL non lvalue assign */
+/* { dg-options "-fno-non-lvalue-assign" } */
int x;
@@ -10,4 +11,5 @@ foo (void)
{
(int) x = 1; /* { dg-bogus "warning" "warning in place of error" } */
}
-/* { dg-error "lvalue" "cast as lvalue" { target *-*-*} 11 } */
+/* APPLE LOCAL non lvalue assign */
+/* { dg-error "lvalue" "cast as lvalue" { target *-*-*} 12 } */
diff --git a/gcc/testsuite/gcc.dg/cast-ptr-1.c b/gcc/testsuite/gcc.dg/cast-ptr-1.c
new file mode 100644
index 00000000000..cb42d13ac48
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cast-ptr-1.c
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file pointer casts */
+/* Test that casts of pointer to unsigned long long aren't sign extended */
+/* Author: Matt Austern <austern@apple.com> */
+/* { dg-do run } */
+/* { dg-options "-Wno-error -w" } */
+
+int main () {
+ /* Note: test assumes sizeof(long long) >= sizeof(void*) */
+
+ unsigned long x1 = 0x80000000ul;
+ void* p = (void*) x1;
+ unsigned long long x2 = (unsigned long long) p;
+
+ return !(x1 == x2);
+}
diff --git a/gcc/testsuite/gcc.dg/cond-lvalue-1.c b/gcc/testsuite/gcc.dg/cond-lvalue-1.c
index f2605af6ad6..8c7595bd591 100644
--- a/gcc/testsuite/gcc.dg/cond-lvalue-1.c
+++ b/gcc/testsuite/gcc.dg/cond-lvalue-1.c
@@ -1,7 +1,8 @@
/* Test for deprecation of conditional expressions as lvalues. */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
-/* { dg-options "" } */
+/* APPLE LOCAL non lvalue assign */
+/* { dg-options "-fno-non-lvalue-assign" } */
int x, y, z;
@@ -10,4 +11,5 @@ foo (void)
{
(x ? y : z) = 1; /* { dg-bogus "warning" "warning in place of error" } */
}
-/* { dg-error "lvalue" "conditional expression as lvalue" { target *-*-* } 11 } */
+/* APPLE LOCAL non lvalue assign */
+/* { dg-error "lvalue" "conditional expression as lvalue" { target *-*-* } 12 } */
diff --git a/gcc/testsuite/gcc.dg/cpp/c++98-pedantic.cc b/gcc/testsuite/gcc.dg/cpp/c++98-pedantic.cc
new file mode 100644
index 00000000000..1e8c160a96f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/c++98-pedantic.cc
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file rename for HFS */
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98 -pedantic" } */
+
+/* This file is for testing the preprocessor in -std=c++98 -pedantic mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL /* { dg-warning "long long" } */
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/c++98.cc b/gcc/testsuite/gcc.dg/cpp/c++98.cc
new file mode 100644
index 00000000000..a9843b878fd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/c++98.cc
@@ -0,0 +1,11 @@
+/* APPLE LOCAL file rename for HFS */
+/* Copyright (C) 2000 Free Software Foundation, Inc. */
+
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98" } */
+
+/* This file is for testing the preprocessor in -std=c++98 mode.
+ Neil Booth, 2 Dec 2000. */
+
+#if 1LL
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/cpp.exp b/gcc/testsuite/gcc.dg/cpp/cpp.exp
index 960a29182d0..d1ed5e8c981 100644
--- a/gcc/testsuite/gcc.dg/cpp/cpp.exp
+++ b/gcc/testsuite/gcc.dg/cpp/cpp.exp
@@ -23,6 +23,13 @@ if [is_remote host] {
}
}
+# APPLE LOCAL begin headermaps
+file mkdir d
+foreach header { A.h bA.h c.h d/d.h } {
+ remote_download host $srcdir/$subdir/inc/$header $header
+}
+# APPLE LOCAL end headermaps
+
# Load support procs.
load_lib gcc-dg.exp
diff --git a/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c b/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c
index d5c6eb960e6..0b2124bd512 100644
--- a/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c
+++ b/gcc/testsuite/gcc.dg/cpp/endif-pedantic2.c
@@ -3,6 +3,8 @@
/* { dg-do preprocess } */
/* { dg-options "-Wno-endif-labels -pedantic" } */
+/* APPLE LOCAL -Wextra-tokens */
+/* { dg-options "-Wextra-tokens -Wno-endif-labels -pedantic" { target *-apple-darwin* } } */
/* Tests combinations of -pedantic and -Wno-endif-labels; see extratokens2.c
for more general tests. */
diff --git a/gcc/testsuite/gcc.dg/cpp/extratokens.c b/gcc/testsuite/gcc.dg/cpp/extratokens.c
index c06a41d4c2b..125a9bdf805 100644
--- a/gcc/testsuite/gcc.dg/cpp/extratokens.c
+++ b/gcc/testsuite/gcc.dg/cpp/extratokens.c
@@ -1,7 +1,8 @@
/* Copyright (C) 2000 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
-/* { dg-options "-fno-show-column" } */
+/* APPLE LOCAL -Wextra-tokens */
+/* { dg-options "-fno-show-column -Wextra-tokens" } */
/* Tests all directives that do not permit excess tokens at the end of
the line. */
diff --git a/gcc/testsuite/gcc.dg/cpp/headermap-1.c b/gcc/testsuite/gcc.dg/cpp/headermap-1.c
new file mode 100644
index 00000000000..bb8e1f4cd2c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/headermap-1.c
@@ -0,0 +1,17 @@
+/* APPLE LOCAL file headermaps */
+/* Copyright (C) 2005 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-I $srcdir/gcc.dg/cpp/headermap.hmap" } */
+
+#define COUNT 1
+#include <A.h>
+#include <bA.h>
+#include <c.h>
+#import <d.h>
+#import <d.h>
+#import <A.h>
+
+#if COUNT != 5
+ #error COUNT not 5 in headermap-1
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/headermap-2.c b/gcc/testsuite/gcc.dg/cpp/headermap-2.c
new file mode 100644
index 00000000000..b6a748bc83a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/headermap-2.c
@@ -0,0 +1,15 @@
+/* APPLE LOCAL file headermaps */
+/* Copyright (C) 2005 Free Software Foundation, Inc. */
+
+/* { dg-do compile } */
+/* { dg-options "-I $srcdir/gcc.dg/cpp/headermap.hmap" } */
+
+#define COUNT 1
+#include <a.h> /* { dg-warning "mismatched case" } */
+#include <Ba.h> /* { dg-warning "mismatched case" } */
+#include <C.h> /* { dg-warning "mismatched case" } */
+#import <c.h>
+
+#if COUNT != 4
+ #error COUNT not 4 in headermap-d21
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/headermap.hmap b/gcc/testsuite/gcc.dg/cpp/headermap.hmap
new file mode 100644
index 00000000000..f9b70b5cce5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/headermap.hmap
Binary files differ
diff --git a/gcc/testsuite/gcc.dg/cpp/if-2.c b/gcc/testsuite/gcc.dg/cpp/if-2.c
index 8bca251b46b..8237112078d 100644
--- a/gcc/testsuite/gcc.dg/cpp/if-2.c
+++ b/gcc/testsuite/gcc.dg/cpp/if-2.c
@@ -1,5 +1,7 @@
/* { dg-do preprocess } */
/* { dg-options -pedantic-errors } */
+/* APPLE LOCAL -Wfour-char-constants */
+/* { dg-options "-Wfour-char-constants" { target *-apple-darwin* } } */
#if 'a' != 'a' || '\001' != 1 || '\x12' != 0x12
#error a,1,0x12 /* { dg-bogus "#error" "basic charconst recognition" } */
diff --git a/gcc/testsuite/gcc.dg/cpp/inc/A.h b/gcc/testsuite/gcc.dg/cpp/inc/A.h
new file mode 100644
index 00000000000..a1a6ef851c3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/inc/A.h
@@ -0,0 +1,6 @@
+/* APPLE LOCAL file headermaps */
+#if COUNT != 1
+ #error COUNT not 1
+#endif
+#undef COUNT
+#define COUNT 2
diff --git a/gcc/testsuite/gcc.dg/cpp/inc/bA.h b/gcc/testsuite/gcc.dg/cpp/inc/bA.h
new file mode 100644
index 00000000000..4ba328017bf
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/inc/bA.h
@@ -0,0 +1,6 @@
+/* APPLE LOCAL file headermaps */
+#if COUNT != 2
+ #error COUNT not 2 in bA
+#endif
+#undef COUNT
+#define COUNT 3
diff --git a/gcc/testsuite/gcc.dg/cpp/inc/c.h b/gcc/testsuite/gcc.dg/cpp/inc/c.h
new file mode 100644
index 00000000000..48a738aa7cd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/inc/c.h
@@ -0,0 +1,6 @@
+/* APPLE LOCAL file headermaps */
+#if COUNT != 3
+ #error COUNT not 3 in c
+#endif
+#undef COUNT
+#define COUNT 4
diff --git a/gcc/testsuite/gcc.dg/cpp/inc/d/d.h b/gcc/testsuite/gcc.dg/cpp/inc/d/d.h
new file mode 100644
index 00000000000..29173816d0a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/inc/d/d.h
@@ -0,0 +1,7 @@
+/* APPLE LOCAL file headermaps */
+#if COUNT != 4
+ #error COUNT not 4 in d
+#endif
+#undef COUNT
+#define COUNT 5
+
diff --git a/gcc/testsuite/gcc.dg/cpp/include2.c b/gcc/testsuite/gcc.dg/cpp/include2.c
index 60edfccb0cd..f4f6ab41f9d 100644
--- a/gcc/testsuite/gcc.dg/cpp/include2.c
+++ b/gcc/testsuite/gcc.dg/cpp/include2.c
@@ -1,10 +1,10 @@
/* Copyright (C) 2000 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
-
+/* APPLE LOCAL begin -Wextra-tokens */
/* Tests that #include does not allow the terminating '>' or '"' to be
escaped, as per the standard. */
-
+/* { dg-options "-Wextra-tokens" } */
/* Source: Neil Booth, 4 Nov 2000. */
#include <silly\>> /* { dg-warning "extra tokens" "" } */
@@ -13,4 +13,4 @@
/* These error is No such file or directory, just once. However, this
message is locale-dependent, so don't test for it. */
/* { dg-error "silly" "" { target *-*-* } 10 } */
-
+/* APPLE LOCAL end */
diff --git a/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c b/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c
new file mode 100644
index 00000000000..e3dca859b32
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/mac-eol-at-eof.c
@@ -0,0 +1 @@
+/* APPLE LOCAL file mainline 2005-03-04 */ /* Test no newline at eof warning when Mac line ending is used*/ /* { dg-do compile } */ int main() { return 0; } \ No newline at end of file
diff --git a/gcc/testsuite/gcc.dg/cpp/skipping2.c b/gcc/testsuite/gcc.dg/cpp/skipping2.c
index 3b0d0f32c8e..61428c2b989 100644
--- a/gcc/testsuite/gcc.dg/cpp/skipping2.c
+++ b/gcc/testsuite/gcc.dg/cpp/skipping2.c
@@ -1,6 +1,8 @@
/* Copyright (C) 2001 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
+/* APPLE LOCAL -Wextra-tokens */
+/* { dg-options "-Wextra-tokens" } */
/* Tests that excess tokens in skipped conditional blocks don't warn. */
diff --git a/gcc/testsuite/gcc.dg/lvalue-cast-1.c b/gcc/testsuite/gcc.dg/lvalue-cast-1.c
new file mode 100644
index 00000000000..e434baf6e7e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lvalue-cast-1.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file non lvalue assign */
+/* { dg-do compile } */
+/* { dg-options "-fnon-lvalue-assign -faltivec" } */
+
+int foo(void) {
+
+ char *p;
+ long l;
+ short s;
+ vector unsigned int vui;
+ volatile int *pvi;
+
+ (long *)p = &l; /* { dg-warning "target of assignment not really an lvalue" } */
+ ((long *)p)++; /* { dg-warning "target of assignment not really an lvalue" } */
+ (short)l = 2; /* { dg-error "invalid lvalue" } */
+ (long)s = 3; /* { dg-error "invalid lvalue" } */
+ (int)pvi = 4; /* { dg-warning "target of assignment not really an lvalue" } */
+ (int)pvi &= 5; /* { dg-warning "target of assignment not really an lvalue" } */
+
+ (vector float)vui = (vector float)(1.0, 2.0, 3.0, 4.0); /* { dg-warning "target of assignment not really an lvalue" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lvalue-cast-2.c b/gcc/testsuite/gcc.dg/lvalue-cast-2.c
new file mode 100644
index 00000000000..bfd2e29e52c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lvalue-cast-2.c
@@ -0,0 +1,14 @@
+/* APPLE LOCAL file non lvalue assign */
+/* Allow lvalue casts in conjunction with '&'. */
+/* { dg-do compile } */
+/* { dg-options "-fnon-lvalue-assign" } */
+
+int foo (void **ptr) {
+ return 1;
+}
+
+int bar (void) {
+ char *string;
+
+ return foo ((void **)&((char *)string)); /* { dg-warning "argument to .&. not really an lvalue" } */
+}
diff --git a/gcc/testsuite/gcc.dg/lvalue-cond-1.c b/gcc/testsuite/gcc.dg/lvalue-cond-1.c
new file mode 100644
index 00000000000..9f48adbdfe2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/lvalue-cond-1.c
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file non lvalue assign */
+/* Allow assignments to conditional expressions, as long as the second and third
+ operands are already lvalues. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-options "-fnon-lvalue-assign" } */
+/* { dg-do run } */
+
+#include <stdlib.h>
+
+int g1 = 3, g2 = 5;
+
+void assign_val1 (int which, int value) {
+ (which ? g1 : g2) = value; /* { dg-warning "target of assignment not really an lvalue" } */
+}
+
+void assign_val2 (int which) {
+ (which ? g1 : g2)++; /* { dg-warning "target of assignment not really an lvalue" } */
+}
+
+int main(void) {
+ assign_val1 (0, 15);
+ if (g1 != 3 || g2 != 15)
+ abort ();
+
+ assign_val2 (1);
+ if (g1 != 4 || g2 != 15)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/lvalue1.c b/gcc/testsuite/gcc.dg/lvalue1.c
index 7e21608ab36..36fb9d8e0a5 100644
--- a/gcc/testsuite/gcc.dg/lvalue1.c
+++ b/gcc/testsuite/gcc.dg/lvalue1.c
@@ -1,5 +1,7 @@
/* PR c/5225 */
/* { dg-do compile } */
+/* APPLE LOCAL non lvalue assign */
+/* { dg-options "-fno-non-lvalue-assign" } */
int main()
{
diff --git a/gcc/testsuite/gcc.dg/mac68k-pragma-unsup-1.c b/gcc/testsuite/gcc.dg/mac68k-pragma-unsup-1.c
new file mode 100644
index 00000000000..2250d0edfed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/mac68k-pragma-unsup-1.c
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file 64-bit mainline */
+/* 64-bit Darwin officially doesn't like the mac68k alignment pragma. */
+
+/* { dg-do compile { target powerpc*-*-darwin[89]* } } */
+/* { dg-options "-m64" } */
+
+#pragma options align=mac68k /* { dg-warning "mac68k alignment pragma is deprecated for 64-bit Darwin" } */
+
+#pragma options align=reset /* this shouldn't error out */
+
+
+
diff --git a/gcc/testsuite/gcc.dg/pch/apple-altivec-1.c b/gcc/testsuite/gcc.dg/pch/apple-altivec-1.c
new file mode 100644
index 00000000000..5f2e93f365e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/apple-altivec-1.c
@@ -0,0 +1,126 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc-*-darwin* } } */
+/* { dg-options "-faltivec -I." } */
+
+#include "apple-altivec-1.h"
+
+/* Test for correct handling of AltiVec constants passed
+ through '...' (va_arg). */
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define CHECK_INVARIANT(expr) \
+ if (!(expr)) { \
+ printf ("ASSERT FAILED: %d: %s\n", __LINE__, #expr); \
+ abort (); \
+ }
+
+struct foo { int x; int y; };
+struct vfoo { int x; __vector signed int v; int y; };
+union u { __vector signed int v; signed int i[4]; };
+
+struct foo x_g = { 3, 4};
+struct vfoo vx_g = { 10, (vector signed int)(11, 12, 13, 14), 15 };
+__vector signed int v_g = (vector signed int) (22, 23, 24, 25);
+struct vfoo vx2_g = { 30, (vector signed int)(31, 32, 33, 34), 35 };
+__vector signed int v2_g = (vector signed int)(40, 41, 42, 43);
+int i_1 = 99, i_2 = 33;
+double d_2 = 1.5, d_3 = 1.75;
+long double ld_1 = 1.25;
+
+void bar (int i, ... )
+{
+ struct foo xi;
+ double d;
+ long double ld;
+ float f;
+ char c;
+ short s;
+ va_list ap;
+ va_start(ap, i);
+ xi = va_arg(ap, struct foo);
+ s = (short)va_arg(ap, int);
+ f = (float)va_arg(ap, double);
+ ld = va_arg(ap, long double);
+ c = (char)va_arg(ap, int);
+ d = va_arg(ap, double);
+ va_end(ap);
+
+ CHECK_INVARIANT (xi.x == x_g.x && xi.y == x_g.y);
+ CHECK_INVARIANT (s == (short)i_2);
+ CHECK_INVARIANT (f == (float)d_2);
+ CHECK_INVARIANT (ld == ld_1);
+ CHECK_INVARIANT (c == (char)i_1);
+ CHECK_INVARIANT (d == d_3);
+}
+
+void baz (int i, ... )
+{
+ struct vfoo vx, vx2;
+ __vector signed int v_i, v2_i;
+ int j, k, l;
+ va_list ap;
+ va_start(ap, i);
+ v_i = va_arg(ap, __vector signed int);
+ j = va_arg(ap, int);
+ vx = va_arg(ap, struct vfoo);
+ k = va_arg(ap, int);
+ v2_i = va_arg(ap, __vector signed int);
+ l = va_arg(ap, int);
+ vx2 = va_arg(ap, struct vfoo);
+ va_end(ap);
+
+ CHECK_INVARIANT (vec_all_eq (v_i, v_g));
+ CHECK_INVARIANT (j == i_1);
+ CHECK_INVARIANT (vx.x == vx_g.x && vec_all_eq(vx.v, vx_g.v) && vx.y == vx_g.y);
+ CHECK_INVARIANT (k == i_1);
+ CHECK_INVARIANT (vec_all_eq (v2_i, v2_g));
+ CHECK_INVARIANT (l == i_1);
+ CHECK_INVARIANT (vx2.x == vx2_g.x && vec_all_eq(vx2.v, vx2_g.v) && vx2.y == vx2_g.y);
+}
+
+void quux (int i, ... )
+{
+ __vector signed int v_i, v2_i;
+ union u vi, v2i;
+ va_list ap;
+ va_start(ap, i);
+ v_i = va_arg(ap, __vector signed int);
+ v2_i = va_arg(ap, __vector signed int);
+ va_end(ap);
+ vi.v = v_i;
+ v2i.v = v2_i;
+
+ CHECK_INVARIANT (vec_all_eq (v_i, v_g));
+ CHECK_INVARIANT (vec_all_eq (v2_i, v_g));
+ CHECK_INVARIANT (vec_all_eq (vi.v, v_g));
+ CHECK_INVARIANT (vec_all_eq (v2i.v, v_g));
+}
+
+void baz2 (int i, ... )
+{
+ struct vfoo vx;
+ union u vxi;
+ va_list ap;
+ va_start(ap, i);
+ vx = va_arg(ap, struct vfoo);
+ va_end(ap);
+ vxi.v = vx.v;
+
+ CHECK_INVARIANT (vx.x == vx_g.x && vec_all_eq(vx.v, vx_g.v) && vx.y == vx_g.y);
+ CHECK_INVARIANT (vec_all_eq (vxi.v, vx_g.v));
+}
+
+int main(void)
+{
+ CHECK_INVARIANT (sizeof(struct foo) == 8 && sizeof(struct vfoo) == 48);
+
+ bar(i_1, x_g, (short)i_2, (float)d_2, ld_1, (char)i_1, d_3);
+ baz(i_1, v_g, i_1, vx_g, i_1, v2_g, i_1, vx2_g);
+ quux(i_1, v_g, v_g);
+ baz2(i_1, vx_g);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/pch/apple-altivec-1.hs b/gcc/testsuite/gcc.dg/pch/apple-altivec-1.hs
new file mode 100644
index 00000000000..156bdf74eba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/apple-altivec-1.hs
@@ -0,0 +1,2 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-options "-faltivec" } */
diff --git a/gcc/testsuite/gcc.dg/pch/faltivec-1.c b/gcc/testsuite/gcc.dg/pch/faltivec-1.c
new file mode 100644
index 00000000000..5824d4155cc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/faltivec-1.c
@@ -0,0 +1,17 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-do compile { target powerpc-*-darwin* } } */
+/* { dg-options "-faltivec -I. -mcpu=G5" } */
+
+#include "faltivec-1.h"
+/* { dg-error "No such file or directory" "" { target *-*-* } 5 } */
+/* { dg-error "one or more PCH files were found" "" { target *-*-* } 5 } */
+/* { dg-error "use -Winvalid-pch for more information" "" { target *-*-* } 5 } */
+
+/* Test for correct PCH validation of -faltivec. */
+void foo()
+{
+ const vector signed short vconst = (vector signed short) (0,0,0,0,0,0,0,0);
+ const vector signed short vconst2 = vec_splat(vconst, 0);
+ bar();
+}
+
diff --git a/gcc/testsuite/gcc.dg/pch/faltivec-1.hs b/gcc/testsuite/gcc.dg/pch/faltivec-1.hs
new file mode 100644
index 00000000000..c24c35cefae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pch/faltivec-1.hs
@@ -0,0 +1,3 @@
+/* APPLE LOCAL file AltiVec */
+/* { dg-options " -mcpu=G5" } */
+extern void bar();
diff --git a/gcc/testsuite/gcc.dg/pch/pch.exp b/gcc/testsuite/gcc.dg/pch/pch.exp
index 79fd9e77139..7f6334efbce 100644
--- a/gcc/testsuite/gcc.dg/pch/pch.exp
+++ b/gcc/testsuite/gcc.dg/pch/pch.exp
@@ -26,6 +26,29 @@ dg-init
set old_dg_do_what_default "${dg-do-what-default}"
+# APPLE LOCAL begin
+# Test MACOSX_DEPLOYMENT_TARGET
+set macosx_deployment_target env(MACOSX_DEPLOYMENT_TARGET)
+setenv MACOSX_DEPLOYMENT_TARGET 10.2
+set test "cfstring-1.c"
+set f [open $test w]
+set v 0
+puts $f "#include \"cfstring-1.h\""
+puts $f "/* { dg-options \"-I./ -Winvalid-pch -save-temps\" } */"
+puts $f "void foo\(\) { x = 0; }"
+puts $f ""
+close $f
+set testh "cfstring-1.hs"
+set f [open $testh w]
+puts $f "int x;"
+puts $f ""
+close $f
+dg-pch $subdir $test [concat [list {-O0 -g}] $torture_without_loops] ".h"
+set MACOSX_DEPLOYMENT_TARGET $macosx_deployment_target
+file delete $test
+file delete $testh
+# APPLE LOCAL end
+
# Main loop.
foreach test [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
global torture_without_loops
diff --git a/gcc/testsuite/gcc.dg/pr20216.c b/gcc/testsuite/gcc.dg/pr20216.c
new file mode 100644
index 00000000000..8baba44a030
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr20216.c
@@ -0,0 +1,16 @@
+/* APPLE LOCAL file why is this local? */
+/* { dg-do compile } */
+/* { dg-options "-O1" } */
+
+static unsigned int *buffer;
+
+void FUNC (void)
+{
+ unsigned int *base;
+ int i, j;
+
+ for (i = 0; i < 4; i++)
+ for (j = 0; j < 1600000; j++)
+ *base++ = buffer[j];
+}
+
diff --git a/gcc/testsuite/gcc.dg/pragma-darwin.c b/gcc/testsuite/gcc.dg/pragma-darwin.c
index da70c8918a0..7d5d22bb667 100644
--- a/gcc/testsuite/gcc.dg/pragma-darwin.c
+++ b/gcc/testsuite/gcc.dg/pragma-darwin.c
@@ -14,20 +14,30 @@ extern void abort(void);
#pragma options 23 /* { dg-error "malformed '#pragma options'" } */
#pragma options align /* { dg-error "malformed '#pragma options'" } */
-#pragma options align mac68k /* { dg-error "malformed '#pragma options'" } */
+/* APPLE LOCAL 64-bit mainline */
+#pragma options align natural /* { dg-error "malformed '#pragma options'" } */
#pragma options align=45 /* { dg-error "malformed '#pragma options'" } */
#pragma options align=foo /* { dg-error "malformed '#pragma options align" } */
+/* APPLE LOCAL 64-bit mainline */
+#ifndef __LP64__
#pragma options align=mac68k
struct s1 { short f1; int f2; };
+/* APPLE LOCAL 64-bit mainline */
+#endif
#pragma options align=power
struct s2 { short f1; int f2; };
+/* APPLE LOCAL 64-bit mainline */
+#ifndef __LP64__
#pragma options align=mac68k
struct s3 { short f1; int f2; };
+/* APPLE LOCAL 64-bit mainline */
+#endif
#pragma options align=reset
struct s4 { short f1; int f2; };
-#pragma options align=mac68k foo /* { dg-warning "junk at end of '#pragma options'" } */
+/* APPLE LOCAL 64-bit mainline */
+#pragma options align=natural foo /* { dg-warning "junk at end of '#pragma options'" } */
/* Segment pragmas don't do anything anymore. */
@@ -39,12 +49,20 @@ main ()
int x, z; /* { dg-warning "unused variable" } */
#pragma unused (x, y)
+/* APPLE LOCAL 64-bit mainline */
+#ifndef __LP64__
if (sizeof (struct s1) != 6)
abort ();
+/* APPLE LOCAL 64-bit mainline */
+#endif
if (sizeof (struct s2) != 8)
abort ();
+/* APPLE LOCAL 64-bit mainline */
+#ifndef __LP64__
if (sizeof (struct s3) != 6)
abort ();
+/* APPLE LOCAL 64-bit mainline */
+#endif
if (sizeof (struct s4) != 8)
abort ();
return 0;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/20040216-1.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/20040216-1.c
new file mode 100644
index 00000000000..1d1784e011b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/20040216-1.c
@@ -0,0 +1,27 @@
+/* APPLE LOCAL file lno */
+/* Test dependence graph. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-test -c -fdump-tree-all" } */
+
+#define N 16
+void bar(int *);
+void foo()
+{
+ int i,j;
+ int A[N];
+ int X[N];
+ int Y[N];
+ int Z[N];
+
+ for (i=2; i<9; i++)
+ {
+ X[i] = Y[i] + Z[i];
+ A[i] = X[i-1] + 1;
+ }
+
+ bar (A);
+}
+
+/* Find 4 Dependence nodes */
+/* { dg-final { scan-tree-dump-times "Dependence Node" 4 "lptest"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c
new file mode 100644
index 00000000000..b7ac0083fb4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-01.c
@@ -0,0 +1,36 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int main(void)
+{
+ unsigned a;
+ int b;
+ int c;
+
+ /* loop_1 runs exactly 4 times. */
+ for (a = 22; a < 50; a+=1)
+ {
+ /* loop_2 runs exactly 6 times. On exit, the variable B is equal to 53. */
+ for (b = 23; b < 50; b+=5)
+ {
+ ++a;
+
+ /* loop_3 runs {{77, +, -7}_1, +, -1}_2 times. */
+ for (c = a; c < 100; c++)
+ {
+
+ }
+ }
+ }
+}
+
+/* The analyzer has to detect the following evolution functions:
+ b -> {23, +, 5}_2
+ a -> {{22, +, 7}_1, +, 1}_2
+ c -> {{{23, +, 7}_1, +, 1}_2, +, 1}_3
+*/
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 4" 1 "lptest"} } */
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 6" 1 "lptest"} } */
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-02.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-02.c
new file mode 100644
index 00000000000..2dce3aa1aa6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-02.c
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int main(void)
+{
+ int a;
+ int b;
+ int *c;
+
+ /* The following loop runs exactly 3 times. */
+ for (a = 11; a < 50; a++)
+ {
+ /* The following loop runs exactly 9 times. */
+ for (b = 8; b < 50; b+=5)
+ {
+ c[a + 5] = 5;
+ c[b] = 6;
+ a+=2;
+ }
+ }
+}
+
+/* The analyzer has to detect the following evolution functions:
+ b -> {8, +, 5}_2
+ a -> {{11, +, 19}_1, +, 2}_2
+*/
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 3" 1 "lptest"} } */
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 9" 1 "lptest"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-03.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-03.c
new file mode 100644
index 00000000000..6c8870af942
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-03.c
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-stats" } */
+
+
+int main(void)
+{
+ int a;
+ int b;
+ int *c;
+
+ /* loop_1 runs exactly 5 times. */
+ for (a = 11; a < 50; a++)
+ {
+ /* loop_2 runs exactly 7 times. */
+ for (b = 8; b < 50; b+=5)
+ {
+ c[a++] = 5;
+ c[b++] = 6;
+ }
+ }
+}
+
+/* The analyzer has to detect the following evolution functions:
+ b -> {8, +, 6}_2
+ a -> {{11, +, 8}_1, +, 1}_2
+*/
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 5" 1 "lptest"} } */
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 7" 1 "lptest"} } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-04.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-04.c
new file mode 100644
index 00000000000..0efebb01a3e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-04.c
@@ -0,0 +1,22 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -ftree-elim-checks -fdump-tree-lptest-details -fdump-tree-elck-details -fdump-tree-optimized" } */
+
+void remove_me (void);
+
+int main(void)
+{
+ int a;
+ int b = 22;
+
+ /* loop_1 runs exactly 28 times. */
+ for (a = 22; a < 50; a++) /* a -> {22, +, 1}_1 */
+ {
+ if (a > b) /* This condition is always false. */
+ remove_me ();
+ b = b + 2; /* b -> {22, +, 2}_1 */
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 28" 1 "lptest"} } */
+/* { dg-final { scan-tree-dump-times "remove_me" 0 "optimized"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c
new file mode 100644
index 00000000000..09df0c89050
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-05.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main(void)
+{
+ int a;
+ int b;
+ int c;
+
+ /* nb_iterations 28 */
+ for (a = 22; a < 50; a++)
+ {
+ /* nb_iterations 6 */
+ for (b = 23; b < 50; b+=5)
+ {
+ /* nb_iterations {78, +, -1}_1 */
+ for (c = a; c < 100; c++)
+ {
+
+ }
+ }
+ }
+}
+
+/* The analyzer has to detect the following evolution functions:
+ a -> {22, +, 1}_1
+ b -> {23, +, 5}_2
+ c -> {{22, +, 1}_1, +, 1}_3
+*/
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 28" 1 "lptest"} } */
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 6" 1 "lptest"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-06.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-06.c
new file mode 100644
index 00000000000..a2b9abdcdba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-06.c
@@ -0,0 +1,51 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -ftree-elim-checks -fdump-tree-lptest-details -fdump-tree-optimized" } */
+
+void remove_me (void);
+
+int main(void)
+{
+ int a;
+ int b;
+ int c;
+
+ /* loop_1 runs 2 times. */
+ for (a = 22; a < 83; a+=1) /* a -> {22, +, 60}_1 */
+ {
+ c = a;
+
+ /* loop_2 runs exactly 6 times. */
+ for (b = 23; b < 50; b+=5) /* b -> {23, +, 5}_2 */
+ {
+ ++a;
+ }
+ /* The following stmt exercises the value of B on the exit of the loop.
+ In this case the value of B out of the loop is that of the evolution
+ function of B applied to the number of iterations the inner loop_2 runs.
+ Value (B) = {23, +, 5}_2 (6) = 53. */
+
+ /* At this point, the variable A has the evolution function:
+ {{22, +, 6}_1, +, 1}_2. */
+ if (b != 53
+ || a != c + 6)
+ remove_me ();
+
+ a = a + b;
+ /* At this point, the variable A has the evolution function:
+ {{22, +, 59}_1, +, 1}_2. The evolution of the variable B in
+ the loop_2 does not matter, and is not recorded in the
+ evolution of A. The above statement is equivalent to:
+ "a = a + 53", ie. the scalar value of B on exit of the loop_2. */
+
+ if (a != c + 59)
+ remove_me ();
+
+ /* And finally the a+=1 from the FOR_STMT produces the evolution
+ function: {{22, +, 60}_1, +, 1}_2. */
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 2" 1 "lptest"} } */
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 6" 1 "lptest"} } */
+/* { dg-final { scan-tree-dump-times "remove_me" 0 "optimized"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-07.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-07.c
new file mode 100644
index 00000000000..ca00f4a1c53
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-07.c
@@ -0,0 +1,28 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-elim-checks -fdump-tree-optimized" } */
+
+void remove_me (void);
+
+int main(void)
+{
+ int a = -100;
+ int b = 2;
+ int d = -1;
+ int e = -100;
+
+ while (a)
+ {
+ /* Exercises higher order polynomials. */
+ a = a + b; /* a -> {-100, +, {2, +, 3}_1}_1 */
+ b = b + 3; /* b -> {2, +, 3}_1 */
+
+ d = d + 3; /* d -> {-1, +, 3}_1 */
+ e = e + d; /* e -> {-100, +, {2, +, 3}_1}_1 */
+
+ if (a != e) /* a -> {-98, +, {5, +, 3}_1}_1 */
+ remove_me ();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "remove_me" 0 "optimized"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-08.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-08.c
new file mode 100644
index 00000000000..48296fa46f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-08.c
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-elim-checks -fdump-tree-optimized" } */
+
+void remove_me (void);
+
+int main(void)
+{
+ int a = -100;
+ int b = 2;
+ int c = 3;
+ int d = -5;
+ int e = 3;
+ int f = -100;
+
+ while (a)
+ {
+ /* Exercises higher order polynomials. */
+ a = a + b; /* a -> {-100, +, 2, +, 3, +, 4}_1 */
+ b = b + c; /* b -> {2, +, 3, +, 4}_1 */
+ c = c + 4; /* c -> {3, +, 4}_1 */
+
+ d = d + 4; /* d -> {-5, +, 4}_1 */
+ e = e + d; /* e -> {3, +, -1, +, 4}_1 */
+ f = f + e; /* f -> {-100, +, 2, +, 3, +, 4}_1 */
+
+ if (a != f) /* (a == f) -> {-98, +, 5, +, 7, +, 4}_1 */
+ remove_me ();
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "remove_me" 0 "optimized"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-09.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-09.c
new file mode 100644
index 00000000000..406544f3b7d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-09.c
@@ -0,0 +1,42 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int main(void)
+{
+ int a = -100;
+ int b = 2;
+ int c = 3;
+ int d = 4;
+ int e = 5;
+
+ while (a)
+ {
+ /* Exercises the cycle detector: a -> b -> (c -> d -> e -> c)*. */
+ a += b;
+ b += c;
+ c += d;
+ d += e;
+ e += c;
+ }
+}
+
+/* This is what is commonly called a "mixer". It whirls the data in a
+ strongly connected component. We expect the following evolution
+ functions:
+
+ e -> {5, +, c_13}_1
+ d -> {4, +, {5, +, c_13}_1}_1
+ c -> {3, +, {4, +, {5, +, c_13}_1}_1}_1
+ b -> {2, +, {3, +, {4, +, {5, +, c_13}_1}_1}_1}_1
+ a -> {-100, +, {2, +, {3, +, {4, +, {5, +, c_13}_1}_1}_1}_1}_1
+*/
+
+/* FIXME:
+ For the moment this testcase does not test for anything, but for
+ not ICEing, and for documentation purposes (okay here is the
+ definition of a mixer). However, I'm considering testing something
+ around the lines of ssa-chrec-08.c, ie. build two mixers, and then
+ compare their values. But that is difficult, and low priority. */
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c
new file mode 100644
index 00000000000..7054ebd4513
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c
@@ -0,0 +1,31 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest " } */
+
+void bar (int);
+
+int foo (void)
+{
+ int a;
+ int x;
+ int c[100][100];
+
+ /* loop_1 runs 39 times. */
+ for (a = 11; a < 50; a++)
+ {
+ /* Array access functions have to be analyzed. */
+ x = a + 5;
+ c[x][a+1] = c[x+2][a+3] + c[x-1][a+2];
+ }
+ bar (c[1][2]);
+}
+
+/* The analyzer has to detect the scalar functions:
+ a -> {11, +, 1}_1
+ x -> {16, +, 1}_1
+ x+2 -> {18, +, 1}_1
+ x-1 -> {15, +, 1}_1
+*/
+
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 39" 1 "lptest"} } */
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c.ddall
new file mode 100644
index 00000000000..5cbc752367f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-10.c.ddall
@@ -0,0 +1,59 @@
+;; APPLE LOCAL file lno
+;; Function foo (foo)
+
+(Data Dep (A = 0, B = 2):
+ (subscript 0:
+ access_fn_A: {14, +, 1}_1
+ access_fn_B: {12, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {2, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {18, +, 1}_1
+ access_fn_B: {16, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {2, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(2
+)
+(2
+)
+ )
+)
+(Data Dep (A = 1, B = 2): (no dependence)
+)
+(Data Dep (A = 2, B = 2):
+ (subscript 0:
+ access_fn_A: {12, +, 1}_1
+ access_fn_B: {12, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {16, +, 1}_1
+ access_fn_B: {16, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+(0
+)
+ )
+)
+(Data Dep (A = 2, B = 3): (no dependence)
+)
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-11.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-11.c
new file mode 100644
index 00000000000..7e1779f97b4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-11.c
@@ -0,0 +1,60 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main(void)
+{
+ int a = -100;
+ int b = 2;
+
+ int f = 6;
+ int g = 7;
+ int h = 8;
+
+ /* Exercises complex loop exit conditions.
+ FIXME: This is a strange case where the compiler cc1 and the wrapper gcc
+ don't produce the same representation:
+
+ (with gcc from command line)
+
+ T.1_9 = f_2 | a_1;
+ if (T.1_9 == 0)
+ {
+ goto <UL47e0>;
+ }
+
+ versus (with cc1 called from gdb):
+
+ if (f_2 == 0)
+ {
+ if (a_1 == 0)
+ {
+ goto <ULc7e0>;
+ }
+ else
+ {
+ (void)0
+ }
+ }
+ else
+ {
+ (void)0
+ };
+ */
+ while (f || a)
+ {
+ a += b;
+
+ f += g;
+ g += h;
+ }
+}
+
+/*
+ g -> {7, +, 8}_1
+ f -> {6, +, {7, +, 8}_1}_1
+ a -> {-100, +, 2}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c
new file mode 100644
index 00000000000..067bfcb2474
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-12.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+int foo ()
+{
+ int a = -100;
+ int b = 2;
+ int c = 3;
+ int d = 4;
+
+ while (a)
+ {
+ a = a + b;
+
+ /* Exercises if-phi-nodes. */
+ if (bar ())
+ b = b + c;
+
+ c = c + d;
+ }
+}
+
+/* The analyzer has to detect the following evolution functions:
+ c -> {3, +, 4}_1
+ b -> {2, +, {[0, 3], +, [0, 4]}_1}_1
+ a -> {-100, +, {2, +, {[0, 3], +, [0, 4]}_1}_1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c
new file mode 100644
index 00000000000..cb785d020f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-13.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int foo (void);
+
+int main (void)
+{
+ int a = -100;
+ int b = 2;
+ int c = 3;
+
+ while (a)
+ {
+ /* Exercises if-phi-nodes. */
+ if (foo ())
+ a += b;
+ else
+ a += c;
+
+ b++;
+ c++;
+ }
+}
+
+/* The analyzer has to detect the following evolution function:
+ a -> {-100, +, {[2, 3], +, 1}_1}_1
+*/
+
+/* FIXME. */
+
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c
new file mode 100644
index 00000000000..c0258c81aba
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-14.c
@@ -0,0 +1,37 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int foo (void);
+
+int main (void)
+{
+ int a = -100;
+ int b = 2;
+ int c = 3;
+ int d = 4;
+
+ while (d)
+ {
+ if (foo ())
+ a += b;
+ else
+ a += c;
+
+ b += 1;
+ c += 5;
+
+ /* Exercises the initial condition of A after the if-phi-node. */
+ d = d + a;
+ }
+}
+
+/* The analyzer has to detect the following evolution function:
+ b -> {2, +, 1}_1
+ c -> {3, +, 5}_1
+ a -> {-100, +, {[2, 3], +, [1, 5]}_1}_1
+ d -> {4, +, {[-98, -97], +, {[2, 3], +, [1, 5]}_1}_1}_1
+*/
+
+/* FIXME. */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-15.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-15.c
new file mode 100644
index 00000000000..800866b677b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-15.c
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main (void)
+{
+ int a;
+ int b;
+ int c;
+
+ /* Exercises the MINUS_EXPR. loop_1 runs 50 times. */
+ for (a = 100; a > 50; a--)
+ {
+
+ }
+}
+
+/* The analyzer has to detect the following evolution function:
+ a -> {100, +, -1}_1
+*/
+
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 50" 1 "lptest"} } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-16.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-16.c
new file mode 100644
index 00000000000..a80414abb83
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-16.c
@@ -0,0 +1,27 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main (void)
+{
+ int a = -100;
+ int b = 2;
+ int c = 3;
+ int d = 4;
+
+ /* Determining the number of iterations for the != or == is work in
+ progress. Same for polynomials of degree >= 2, where we have to
+ find the zeros of the polynomial. */
+ while (d)
+ {
+ a += 23;
+ d = a + d;
+ }
+}
+
+/* a -> {-100, +, 23}_1
+ d -> {4, +, {-77, +, 23}_1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-17.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-17.c
new file mode 100644
index 00000000000..1e7ac50e013
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-17.c
@@ -0,0 +1,36 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+void foo ()
+{
+ int a = -100;
+ int b = 2;
+
+ while (b)
+ {
+ if (bar ())
+ a += 3;
+ else
+ a = 2;
+
+ /* Exercises the case when one of the branches of the if-phi-node is a constant.
+ FIXME:
+ - What is the chrec representation of such an evolution?
+ - Does this kind of code exist in real codes? */
+ b += a;
+ }
+}
+
+/* For the moment the analyzer is expected to output a "don't know" answer,
+ both for the initial condition and for the evolution part. This is done
+ in the merge condition branches information.
+
+ a -> [-oo, +oo]
+ b -> {2, +, a_1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c
new file mode 100644
index 00000000000..f72aaa1f542
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-18.c
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+int foo (int x)
+{
+ int a = -100;
+ int b = 2;
+
+ while (b)
+ {
+ if (x)
+ a += 3;
+ else
+ a += bar ();
+
+ /* Exercises the case when one of the branches of the if-phi-node cannot
+ be determined: [-oo, +oo].
+ Since the evolution function is too difficult to handle in the expanded
+ form, we have to keep it in its symbolic form: "b -> {2, +, a_1}_1". */
+ b += a;
+ }
+}
+
+/* a -> {-100, +, [min<t, 3>, max<t, 3>]}_1
+ b -> {2, +, {[min<t, 3>, max<t, 3>] - 100, +, [min<t, 3>, max<t, 3>]}_1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-19.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-19.c
new file mode 100644
index 00000000000..bb3a5b183ae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-19.c
@@ -0,0 +1,21 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int b = 2;
+
+ while (b)
+ {
+ /* Exercises the MULT_EXPR. */
+ b = 2*b;
+ }
+}
+
+/* b -> {2, *, 2}_1
+*/
+
+/* FIXME. */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-20.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-20.c
new file mode 100644
index 00000000000..e5a24d80a8f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-20.c
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 3;
+ int b = 2;
+
+ while (a)
+ {
+ b += 5;
+ a += b;
+
+ /* Exercises the sum of a polynomial of degree 2 with an
+ evolution of degree 1:
+
+ (loop_num = 1, chrec_var = {3, +, 7, +, 5}, to_add = 2).
+ The result should be: {3, +, 9, +, 5}. */
+ a += 2;
+ }
+}
+
+/*
+ b -> {2, +, 5}_1
+ a -> {3, +, {9, +, 5}_1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-21.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-21.c
new file mode 100644
index 00000000000..82c5ccb49db
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-21.c
@@ -0,0 +1,22 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 3;
+ int b = 2;
+
+ while (b)
+ {
+ a *= 4;
+ b *= a;
+ }
+}
+
+/* a -> {3, *, 4}_1
+ b -> {{2, *, 12}_1, *, 4}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-22.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-22.c
new file mode 100644
index 00000000000..a439099e4df
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-22.c
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 2;
+ int b = 4;
+
+ while (a)
+ {
+ a *= 3;
+ a *= b;
+ b *= 5;
+ }
+}
+
+/*
+ b -> {4, *, 5}_1
+ a -> {2, *, {12, *, 5}_1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-23.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-23.c
new file mode 100644
index 00000000000..c12bc4bf469
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-23.c
@@ -0,0 +1,22 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 1;
+ int b = 1;
+
+ while (a)
+ {
+ a *= b;
+ b += 1;
+ }
+}
+
+/* a -> {1, *, {1, +, 1}_1}_1
+*/
+
+/* FIXME. */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-24.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-24.c
new file mode 100644
index 00000000000..96095cd4d4e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-24.c
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+int foo ()
+{
+ int c;
+
+ /* This exercises the initial condition propagator:
+ Interval Copy Constant Propagation (ICCP). */
+ if (bar ())
+ c = 2;
+ else
+ c = 3;
+
+ while (c)
+ {
+ c += 5;
+ }
+}
+
+/*
+ c -> {[2, 3], +, 5}_1
+*/
+
+/* FIXME. */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-25.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-25.c
new file mode 100644
index 00000000000..43b1dc5bd37
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-25.c
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+int foo ()
+{
+ int c = 7;
+
+ /* This exercises the initial condition propagator:
+ Interval Copy Constant Propagation (ICCP). */
+ if (bar ())
+ c = 2;
+ else
+ c += 3;
+
+ while (c)
+ {
+ c += 5;
+ }
+}
+
+/*
+ c -> {[2, 10], +, 5}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-26.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-26.c
new file mode 100644
index 00000000000..f7025534118
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-26.c
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+int foo ()
+{
+ int a = -100;
+ int b = -10;
+
+ /* This exercises a code with two loop nests. */
+
+ while (a)
+ a++;
+
+ while (b)
+ b++;
+}
+
+/* a -> {-100, +, 1}_1
+ b -> {-10, +, 1}_2
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-27.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-27.c
new file mode 100644
index 00000000000..92c627d324c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-27.c
@@ -0,0 +1,41 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+int foo ()
+{
+ int a = -100;
+
+ /* This exercises a code with two loop nests. */
+
+ /* loop_1 runs 100 times. */
+ while (a < 0)
+ a++;
+
+ a -= 77;
+
+ /* loop_2 runs 26 times. */
+ while (a < 0)
+ a+=3;
+}
+
+/* The analyzer sees two loop nests:
+ for the first, it determines the evolution:
+ a -> {-100, +, 1}_1
+
+ and for the second, it determines that the first loop ends at 0 and then:
+ a -> {-77, +, 3}_2
+
+ When the constant propagation is postponed, the analyzer detects
+ for the second loop the evolution function:
+ a -> {a_5, +, 3}_2
+
+*/
+
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 100" 1 "lptest"} } */
+/* { dg-final { scan-tree-dump-times "set_nb_iterations_in_loop = 26" 1 "lptest"} } */
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-28.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-28.c
new file mode 100644
index 00000000000..a05930fb0df
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-28.c
@@ -0,0 +1,40 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+int foo ()
+{
+ int i;
+ int a = 2;
+
+ while (a)
+ {
+ a *= 3;
+
+ for (i = 0; i < 100; i++)
+ a += 4;
+ }
+}
+
+/* FIXME: We have to transform the evolution function of "a" into an infinite
+ sum, a -> {//2, *, 2//}, and then to add the 400 from the inner sum...
+ But this is quite difficult, and cases like this one do not happen often.
+
+ (Francois Irigoin consider that this case falls into the 0.01 percent
+ rule, and it is no worth to implement a solution for this testcase in a
+ production compiler. )
+*/
+
+/* Do nothing for this testcase.
+ The following evolutions are detected:
+
+ i -> {0, +, 1}_2
+ a -> {{2, *, [-oo, +oo]}_1, +, 4}_2
+
+*/
+
+/* FIXME. */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-29.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-29.c
new file mode 100644
index 00000000000..5d639a9dfae
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-29.c
@@ -0,0 +1,41 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int bar (void);
+
+int foo ()
+{
+ int i;
+ int a = 2;
+
+ while (a)
+ {
+ a *= 3;
+ a += 5;
+ }
+}
+
+/* FIXME: This exposes a problem in the representation. Is it
+ possible to have an exponential and a polynomial together?
+
+ The first assignment constructs "a -> {2, *, 3}_1",
+ while the second adds 5 as a polynomial function.
+
+ The following two representations are not correct:
+ "a -> {{2, *, 3}_1, +, 5}_1"
+ "a -> {{2, +, 5}_1, *, 3}_1"
+
+ The right solution is:
+ "a -> {2, *, 3}_1 + {0, +, 5}_1"
+ but this exposes yet again the "exp + poly" problem: the representation
+ is not homogen. Going into a Taylor decomposition could solve this problem.
+
+ This is too difficult for the moment, and does not happen often.
+*/
+
+/* Do nothing for this testcase. */
+
+/* FIXME. */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c
new file mode 100644
index 00000000000..1b511fd0e92
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c
@@ -0,0 +1,22 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+void foo (int);
+
+int main ()
+{
+ int c[100][200];
+ int a;
+ int x;
+
+ for (a = 1; a < 50; a++)
+ {
+ x = a;
+ c[x-7][1] = c[x+2][3] + c[x-1][2];
+ c[x][2] = c[x+2][3];
+ }
+ foo (c[12][13]);
+}
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c.ddall
new file mode 100644
index 00000000000..78404a624fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-30.c.ddall
@@ -0,0 +1,96 @@
+;; APPLE LOCAL file lno
+;; Function main (main)
+
+(Data Dep (A = 0, B = 2): (no dependence)
+)
+(Data Dep (A = 0, B = 4): (no dependence)
+)
+(Data Dep (A = 1, B = 2): (no dependence)
+)
+(Data Dep (A = 1, B = 4):
+ (subscript 0:
+ access_fn_A: 2
+ access_fn_B: 2
+ iterations_that_access_an_element_twice_in_A: 0
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: 0
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {0, +, 1}_1
+ access_fn_B: {1, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {1, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+(-1
+)
+ )
+)
+(Data Dep (A = 2, B = 2):
+ (subscript 0:
+ access_fn_A: 1
+ access_fn_B: 1
+ iterations_that_access_an_element_twice_in_A: 0
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: 0
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {-6, +, 1}_1
+ access_fn_B: {-6, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+(0
+)
+ )
+)
+(Data Dep (A = 2, B = 3): (no dependence)
+)
+(Data Dep (A = 2, B = 4): (no dependence)
+)
+(Data Dep (A = 2, B = 5): (no dependence)
+)
+(Data Dep (A = 3, B = 4): (no dependence)
+)
+(Data Dep (A = 4, B = 4):
+ (subscript 0:
+ access_fn_A: 2
+ access_fn_B: 2
+ iterations_that_access_an_element_twice_in_A: 0
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: 0
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {1, +, 1}_1
+ access_fn_B: {1, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+(0
+)
+ )
+)
+(Data Dep (A = 4, B = 5): (no dependence)
+)
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c
new file mode 100644
index 00000000000..6e1f7167705
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+void bar (short);
+
+#define N 100
+foo (){
+ short a[N];
+ short b[N];
+ short c[N];
+ int i;
+
+ for (i=0; i<N; i++){
+ a[i] = b[i] + c[i];
+ }
+ bar (a[2]);
+}
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c.ddall
new file mode 100644
index 00000000000..636d4f94c48
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-31.c.ddall
@@ -0,0 +1,37 @@
+;; APPLE LOCAL file lno
+;; Function foo (foo)
+
+(Data Dep (A = 0, B = 2): (no dependence)
+)
+(Data Dep (A = 1, B = 2): (no dependence)
+)
+(Data Dep (A = 2, B = 2):
+ (subscript 0:
+ access_fn_A: {0, +, 1}_1
+ access_fn_B: {0, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+ )
+)
+(Data Dep (A = 2, B = 3):
+ (subscript 0:
+ access_fn_A: {0, +, 1}_1
+ access_fn_B: 2
+ iterations_that_access_an_element_twice_in_A: 2
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: 0
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(-2
+)
+ )
+)
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c
new file mode 100644
index 00000000000..25db7da6ba9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c
@@ -0,0 +1,36 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+void bar (short);
+
+#define N 100
+#define NPad 10
+#define M 32
+void foo()
+{
+ short coef[M];
+ short input[N];
+ short output[N];
+
+ int i,j,k;
+ int sum;
+
+ for (i = 0; i < N; i++) {
+ sum = 0;
+ for (j = 0; j < M; j++) {
+ sum += input[i+NPad-j] * coef[j];
+ }
+ output[i] = sum;
+ }
+ bar (sum);
+}
+
+/* The following evolution functions have to be detected:
+
+ i -> {0, +, 1}_1
+ j -> {0, +, 1}_2
+
+*/
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c.ddall
new file mode 100644
index 00000000000..c3e83533cab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-32.c.ddall
@@ -0,0 +1,5 @@
+;; APPLE LOCAL file lno
+;; Function foo (foo)
+
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c
new file mode 100644
index 00000000000..c2879e2faa4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c
@@ -0,0 +1,47 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+void bar (int);
+
+#define N 100
+#define NPad 10
+#define M 32
+
+void foo ()
+{
+ short coefs[2*M];
+ short input[2*N];
+ short output[2*N];
+
+ int sum_real, sum_imag;
+ int i,j,k;
+
+ k = NPad;
+ for (i = 0; i < N; i++)
+ {
+ sum_real = 0;
+ sum_imag = 0;
+ for (j = 0; j < M; j++)
+ {
+ sum_real +=
+ input[2*k-2*j+1]*coefs[2*j+1] - input[2*k-2*j]*coefs[2*j];
+
+ sum_imag +=
+ input[2*k-2*j]*coefs[2*j+1] + input[2*k-2*j+1]*coefs[2*j];
+ }
+ output[2*i+1] = sum_imag;
+ output[2*i] = sum_real;
+ k++;
+ }
+ bar (sum_imag);
+}
+
+/* The following evolution functions have to be detected:
+
+ i -> {0, +, 1}_1
+ j -> {0, +, 1}_2
+
+*/
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c.ddall
new file mode 100644
index 00000000000..c3e83533cab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-33.c.ddall
@@ -0,0 +1,5 @@
+;; APPLE LOCAL file lno
+;; Function foo (foo)
+
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c
new file mode 100644
index 00000000000..f3369502aa1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c
@@ -0,0 +1,34 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+void bar (int);
+
+#define M 16
+#define N 8
+
+short foo (short image[][M], short block[][N]){
+ int sad, diff = 0;
+ int i, j;
+ int tmp;
+
+ for (i = 0; i < N; i++) {
+ sad = 0;
+ for (j = 0; j < N; j++) {
+ tmp = image[i][j] - block[i][j];
+ sad += (tmp < 0) ? -tmp : tmp;
+ }
+ diff += sad;
+ }
+
+ return diff;
+}
+
+/* The following evolution functions have to be detected:
+
+ i -> {0, +, 1}_1
+ j -> {0, +, 1}_2
+
+*/
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c.ddall
new file mode 100644
index 00000000000..c3e83533cab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-34.c.ddall
@@ -0,0 +1,5 @@
+;; APPLE LOCAL file lno
+;; Function foo (foo)
+
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c
new file mode 100644
index 00000000000..e17b5a6c6c1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c
@@ -0,0 +1,35 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+#define L 100
+#define M 100
+#define N 100
+
+int bar (float);
+
+int foo (float A[][M][N])
+{
+ int i, j, k;
+
+ for (i = 0; i < L; i++)
+ for (j = 0; j < M; j++)
+ for (k = 0; k < N; k++)
+ A[i][j][j] = A[i][j][k];
+
+ return bar (A[10][11][12]);
+}
+
+/* The following evolution functions have to be detected:
+
+ i -> {0, +, 1}_1
+ j -> {0, +, 1}_2
+ k -> {0, +, 1}_3
+
+ For the subscript [j] vs. [k], "{0, +, 1}_2" vs. "{0, +, 1}_3"
+ the overlapping elements are respectively located at iterations:
+ {0, +, 1}_3 and {0, +, 1}_2.
+
+*/
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c.ddall
new file mode 100644
index 00000000000..a1039a40f7d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-35.c.ddall
@@ -0,0 +1,59 @@
+;; APPLE LOCAL file lno
+;; Function foo (foo)
+
+(Data Dep (A = 0, B = 1):
+ (subscript 0:
+ access_fn_A: {0, +, 1}_3
+ access_fn_B: {0, +, 1}_2
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_3
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {0, +, 1}_2
+ access_fn_B: {0, +, 1}_2
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+([-oo, +oo]
+)
+(0
+)
+ )
+)
+(Data Dep (A = 1, B = 1):
+ (subscript 0:
+ access_fn_A: {0, +, 1}_2
+ access_fn_B: {0, +, 1}_2
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {0, +, 1}_2
+ access_fn_B: {0, +, 1}_2
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+(0
+)
+ )
+)
+(Data Dep (A = 1, B = 2): (no dependence)
+)
+(Data Dep (A = 1, B = 3): (don't know)
+)
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c
new file mode 100644
index 00000000000..40a71819b6e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c
@@ -0,0 +1,28 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+int foo (int);
+
+int main ()
+{
+ int res;
+ int c[100][200];
+ int a;
+ int x;
+
+ for (a = 1; a < 50; a++)
+ {
+ c[a+1][a] = 2;
+ res += c[a][a];
+
+ /* This case exercises the subscript coupling detection: the dependence
+ detectors have to determine that there is no dependence between
+ c[a+1][a] and c[a][a]. */
+ }
+
+ return res + foo (c[12][13]);
+}
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c.ddall
new file mode 100644
index 00000000000..a355c7f2a32
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-36.c.ddall
@@ -0,0 +1,59 @@
+;; APPLE LOCAL file lno
+;; Function main (main)
+
+(Data Dep (A = 0, B = 0):
+ (subscript 0:
+ access_fn_A: {1, +, 1}_1
+ access_fn_B: {1, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {2, +, 1}_1
+ access_fn_B: {2, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+(0
+)
+ )
+)
+(Data Dep (A = 0, B = 1): (no dependence)
+)
+(Data Dep (A = 0, B = 2):
+ (subscript 0:
+ access_fn_A: {1, +, 1}_1
+ access_fn_B: 13
+ iterations_that_access_an_element_twice_in_A: 12
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: 0
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {2, +, 1}_1
+ access_fn_B: 12
+ iterations_that_access_an_element_twice_in_A: 10
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: 0
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(-12
+)
+(-10
+)
+ )
+)
+(Data Dep (A = 0, B = 3): (don't know)
+)
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-37.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-37.c
new file mode 100644
index 00000000000..746a81e68fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-37.c
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a;
+ int b = 2;
+ int c = 11;
+
+ for (a = -123; a < 0; c += 12, b += 5)
+ {
+ a += b;
+
+ /* The next stmt exercises the add_function_to_loop_evolution
+ (loop_num = 1, chrec_before = {-123, +, {2, +, 5}_1}_1, to_add = {11, +, 12}_1).
+ The result should be: {-123, +, {13, +, 17}_1}_1. */
+ a += c;
+ }
+}
+
+/*
+ b -> {2, +, 5}_1
+ c -> {11, +, 12}_1
+ a -> {-123, +, {13, +, 17}_1}_1
+*/
+
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-38.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-38.c
new file mode 100644
index 00000000000..bdfe8bc6bfd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-38.c
@@ -0,0 +1,49 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 3;
+ int b = 2;
+ int c = 11;
+ int d = -5;
+
+ while (a)
+ {
+ b += 5;
+ a += b;
+
+ for (d = -5; d < 0; d++)
+ {
+ /* Exercises the build_polynomial_evolution_in_loop function in the following context:
+ (add_to_evolution
+ loop_num = 2
+ chrec_before = {3, +, 7, +, 5}_1
+ to_add = {11, +, 12}_1
+ res = {{3, +, 7, +, 5}_1, +, {11, +, 12}_1}_2
+ )
+
+ This also exercises the chrec_apply function in the following context:
+ (chrec_apply
+ var = 2
+ chrec = {0, +, {11, +, 12}_1}_2
+ x = 5
+ res = {55, +, 60}_1
+ )
+ */
+ a += c;
+ }
+ c += 12;
+ }
+}
+
+/*
+ b -> {2, +, 5}_1
+ c -> {11, +, 12}_1
+ d -> {-5, +, 1}_2
+ a -> {{3, +, 62, +, 65}_1, +, {11, +, 12}_1}_2
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c
new file mode 100644
index 00000000000..87d844482e7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-39.c
@@ -0,0 +1,46 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int foo (int ParmN)
+{
+ int a = 3;
+ int b = 2;
+ int d = -5;
+
+ while (a)
+ {
+ b += 25;
+ a += b;
+
+ for (d = -5; d < 0; d++)
+ {
+ /* Exercises the build_polynomial_evolution_in_loop in the following context:
+ (add_to_evolution
+ loop_num = 2
+ chrec_before = {3, +, {27, +, 25}_1}_1
+ to_add = ParmN_15
+ res = {{3, +, {27, +, 25}_1}_1, +, ParmN_15}_2
+ )
+
+ Then it exercises the add_expr_to_loop_evolution in the following context:
+ (add_to_evolution
+ loop_num = 1
+ chrec_before = {{3, +, {27, +, 25}_1}_1, +, ParmN_15}_2
+ to_add = ParmN_15 * 5
+ res = {{3, +, {ParmN_15 * 5 + 27, +, 25}_1}_1, +, ParmN_15}_2
+ )
+ */
+ a += ParmN;
+ }
+ }
+}
+
+/*
+ b -> {2, +, 25}_1
+ d -> {-5, +, 1}_2
+ a -> {{3, +, {ParmN * 5 + 27, +, 25}_1}_1, +, ParmN}_2
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-40.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-40.c
new file mode 100644
index 00000000000..7a1ecf7d5bd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-40.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 1;
+ int b = 1;
+
+ while (a)
+ {
+ a += b;
+ b *= 2;
+ }
+}
+
+/*
+ b -> {1, *, 2}_1
+ a -> {1, +, {1, *, 2}_1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-41.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-41.c
new file mode 100644
index 00000000000..ab93fbcaf98
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-41.c
@@ -0,0 +1,53 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 2;
+ int b = 4;
+ int c = 2;
+
+ while (a)
+ {
+ a *= 3;
+ for (c = -10; c < 0; c++)
+ {
+ /* Exercises the build_exponential_evolution_in_loop function in the following context:
+ (multiply_evolution
+ loop_num = 2
+ chrec_before = {2, *, 3}_1
+ to_mult = {4, *, 5}_1
+ res = {{2, *, 3}_1, *, {4, *, 5}_1}_2
+ )
+
+ Then it exerces the chrec_apply in the following context:
+ (chrec_apply
+ var = 2
+ chrec = {0, +, {4, *, 5}_1}_2
+ x = 10
+ res = {40, *, 5}_1
+ )
+
+ Finally it tests the
+ (add_to_evolution
+ loop_num = 1
+ chrec_before = {{2, *, 3}_1, *, {4, *, 5}_1}_2
+ to_add = {40, *, 5}_1
+ res = {{2, *, {120, *, 5}_1}_1, *, {4, *, 5}_1}_2
+ )
+ */
+ a *= b;
+ }
+ b *= 5;
+ }
+}
+
+/*
+ c -> {-10, +, 1}_2
+ b -> {4, *, 5}_1
+ a -> {{2, *, {120, *, 5}_1}_1, *, {4, *, 5}_1}_2
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-42.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-42.c
new file mode 100644
index 00000000000..33378ddfa9c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-42.c
@@ -0,0 +1,31 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 1;
+ int b = 2;
+ int c = 0;
+ int d = 5;
+
+ while (a)
+ {
+ a += b;
+ a += d;
+
+ b += c;
+ c += 1;
+ d += 9;
+ }
+}
+
+/*
+ c -> {0, +, 1}_1
+ b -> {2, +, 0, +, 1}_1
+ d -> {5, +, 9}_1
+ a -> {1, +, 7, +, 9, +, 1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-43.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-43.c
new file mode 100644
index 00000000000..329f205506f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-43.c
@@ -0,0 +1,65 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+
+int main ()
+{
+ int a = 1;
+ int b = 2;
+ int c = 0;
+ int d = 5;
+ int e;
+
+ while (a)
+ {
+ /* The following statement produces the evolution function:
+ (add_to_evolution
+ loop_num = 1
+ chrec_before = 1
+ to_add = {{2, +, 0}_1, +, 10}_1
+ res = {{{1, +, 2}_1, +, 0}_1, +, 10}_1
+ )
+ Note that the evolution of B in the inner loop_2 is not
+ relevant to the evolution of A in the loop_1. */
+ a += b;
+
+ /* And finally the following statement produces the expected scev:
+ (add_to_evolution
+ loop_num = 1
+ chrec_before = {{{1, +, 2}_1, +, 0}_1, +, 10}_1
+ to_add = {5, +, 9}_1
+ res = {{{1, +, 7}_1, +, 9}_1, +, 10}_1
+ )
+ That ends this not so formal proof ("CQFD" in french ;-). */
+ a += d;
+
+ for (e = 0; e < 10; e++)
+ b += c;
+ /* After having analyzed this loop, the overall effect is added to the evolution of b.
+ This corresponds to the following operation:
+ (add_to_evolution
+ loop_num = 1
+ chrec_before = {2, +, {0, +, 1}_1}_2
+ to_add = {0, +, 10}_1
+ res = {{{2, +, 0}_1, +, 10}_1, +, {0, +, 1}_1}_2
+ ).
+ Note that the variable c has not yet been updated in the loop, and thus its value
+ at this version is "{0, +, 1}_1". Since the loop_2 runs exactly 10 times, the overall
+ effect of the loop is "10 * {0, +, 1}_1": that is the TO_ADD argument.
+ */
+
+ c += 1;
+ d += 9;
+ }
+}
+
+/*
+ c -> {0, +, 1}_1
+ e -> {0, +, 1}_2
+ b -> {{2, +, 0, +, 10}_1, +, {0, +, 1}_1}_2
+ d -> {5, +, 9}_1
+ a -> {1, +, 7, +, 9, +, 10}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-44.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-44.c
new file mode 100644
index 00000000000..86308138d37
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-44.c
@@ -0,0 +1,39 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+/* That's a reduced testcase of one of my favourite simulation programs.
+ This is also known under the name: "Newton's falling apple".
+ The general version is known under the name: "the N-body simulation problem".
+
+ The physics terminology is the best to describe the scalar evolution algorithm:
+ - first determine the initial conditions of the system,
+ - then analyze its evolution.
+*/
+
+double Newton_s_apple ()
+{
+ /* Initial conditions. */
+ double g = -10.0;
+ double speed_z = 0;
+ double altitude = 3000;
+ double delta_t = 0.1;
+ double total_time = 0;
+
+ /* Laws of evolution. */
+ while (altitude > 0.0)
+ {
+ speed_z += g * delta_t;
+ altitude += speed_z * delta_t;
+ total_time += delta_t;
+ }
+
+ return total_time;
+}
+
+/*
+ speed_z -> {0.0, +, -1.0e+0}_1
+ altitude -> {3.0e+3, +, {(0.0 + -1.0e+0) * 1.00000000000000005551115123125782702118158340454e-1, +, -1.0e+0 * 1.00000000000000005551115123125782702118158340454e-1}_1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-45.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-45.c
new file mode 100644
index 00000000000..40f09a236f3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-45.c
@@ -0,0 +1,45 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+/* That's a reduced testcase of one of my favourite simulation programs.
+ This is also known under the name: "Newton's falling apple".
+ The general version is known under the name: "the N-body simulation problem".
+
+ The physics terminology is the best to describe the scalar evolution algorithm:
+ - first determine the initial conditions of the system,
+ - then analyze its evolution.
+*/
+
+double Newton_s_apple ()
+{
+ /* Initial conditions. */
+ double g = 10.0;
+ double speed_z = 0;
+ double altitude = 3000;
+ double delta_t = 0.1;
+ double total_time = 0;
+
+ /* Laws of evolution. */
+ while (altitude > 0.0)
+ {
+ speed_z += g * delta_t;
+ altitude -= speed_z * delta_t;
+ total_time += delta_t;
+ }
+
+ return total_time;
+}
+
+/*
+ speed_z -> {0.0, +, 1.0e+0}_1
+ altitude -> {3.0e+3, +, {(0.0 + 1.0e+0) * 1.00000000000000005551115123125782702118158340454e-1 * -1, +, 1.0e+0 * 1.00000000000000005551115123125782702118158340454e-1 * -1}_1}_1
+
+ When computing evolutions in the "symbolic as long as possible" strategy,
+ the analyzer extracts only the following:
+
+ altitude -> {3.0e+3, +, T.2_11 * -1}_1
+
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-46.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-46.c
new file mode 100644
index 00000000000..b97d6f87fab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-46.c
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int
+foo (int i,
+ int precision)
+{
+ i = precision - i - 1;
+
+ /* At this point the analyzer is confused by the initialisation of "i".
+ It keeps the initial condition under a symbolic form: "i_1". */
+
+ while (--i);
+}
+
+/* i -> {i_1, +, -1}_1 */
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-47.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-47.c
new file mode 100644
index 00000000000..bd5afc50b7e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-47.c
@@ -0,0 +1,36 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int
+foo (int unknown_parm, int a, int b)
+{
+ int p;
+
+ if (unknown_parm)
+ {
+ p = a + 2;
+ }
+ else
+ {
+ p = b + 1;
+ }
+
+ /* At this point the initial condition of "p" is unknown.
+ In this case, the analyzer has to keep the initial condition under a symbolic form. */
+
+ while (p)
+ p--;
+
+}
+
+/*
+ p -> {p_1, +, -1}_1
+
+ or, when the Value Range Propagation does its work:
+
+ p -> {[MIN_EXPR <p_4, p_6>, MAX_EXPR <p_4, p_6>], +, -1}_1
+
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-48.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-48.c
new file mode 100644
index 00000000000..fbd3c98bb29
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-48.c
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int
+foo (int *c)
+{
+ int i;
+ int j = 10;
+
+ for (i = 0; i < 5; i++)
+ {
+ for (j = 10;; j--)
+ {
+ if (j == 0)
+ break;
+
+ *(c + j) = *(c + j) - 1;
+ }
+ }
+
+ return j;
+}
+
+/*
+ j -> {10, +, -1}_2
+ i -> {0, +, 1}_1
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-49.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-49.c
new file mode 100644
index 00000000000..413758aa6f6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-49.c
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int
+foo (int *c)
+{
+ int i = 0;
+ int j = 10;
+
+ while (1)
+ {
+ if (i == j)
+ break;
+
+ i++;
+ j--;
+ }
+
+ return j;
+}
+
+/* i -> {0, +, 1}_1 */
+/* j -> {10, +, -1}_1 */
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-50.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-50.c
new file mode 100644
index 00000000000..b3ea5b5dfb9
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-50.c
@@ -0,0 +1,27 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int
+foo (int *c)
+{
+ int i = 0;
+ int j = 10;
+
+ while (1)
+ {
+ /* This case exercises the number of iterations detector for
+ {0, +, 1}_1 == {10, +, -1}_1
+ */
+ if (i == j)
+ break;
+
+ i++;
+ j--;
+ }
+
+ return j;
+}
+
+/* FIXME. */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-51.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-51.c
new file mode 100644
index 00000000000..c0a7f51f8ff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-51.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int
+foo (int j)
+{
+ int i = 0;
+ int temp_var;
+
+ while (i < 100)
+ {
+ /* This exercises the analyzer on strongly connected
+ components: here "i -> temp_var -> i". */
+ temp_var = i + j;
+ i = temp_var + 2;
+ }
+
+ return i;
+}
+
+/* FIXME. */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c
new file mode 100644
index 00000000000..94f43e3d51a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+int bar (int);
+
+int foo (void)
+{
+ int a;
+ int parm = 11;
+ int x;
+ int c[100];
+
+ for (a = parm; a < 50; a++)
+ {
+ /* Array access functions have to be analyzed. */
+ x = a + 5;
+ c[x] = c[x+2] + c[x-1];
+ }
+ bar (c[1]);
+}
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c.ddall
new file mode 100644
index 00000000000..91beef19c92
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-52.c.ddall
@@ -0,0 +1,49 @@
+;; APPLE LOCAL file lno
+;; Function foo (foo)
+
+(Data Dep (A = 0, B = 2):
+ (subscript 0:
+ access_fn_A: {18, +, 1}_1
+ access_fn_B: {16, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {2, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(2
+)
+ )
+)
+(Data Dep (A = 1, B = 2):
+ (subscript 0:
+ access_fn_A: {15, +, 1}_1
+ access_fn_B: {16, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {1, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(-1
+)
+ )
+)
+(Data Dep (A = 2, B = 2):
+ (subscript 0:
+ access_fn_A: {16, +, 1}_1
+ access_fn_B: {16, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+ )
+)
+(Data Dep (A = 2, B = 3): (no dependence)
+)
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c
new file mode 100644
index 00000000000..3933c21e360
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-53.c
@@ -0,0 +1,129 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details " } */
+
+#define N 16
+
+void fbar (float *);
+void ibar (int *);
+void sbar (short *);
+
+/* Should be vectorized */
+
+foo (int n)
+{
+ float a[N+1];
+ float b[N];
+ float c[N];
+ float d[N];
+ int ia[N];
+ int ib[N];
+ int ic[N];
+ double da[N];
+ double db[N];
+ short sa[N];
+ short sb[N];
+ short sc[N];
+ int i,j;
+ int diff = 0;
+ char cb[N];
+ char cc[N];
+ char image[N][N];
+ char block[N][N];
+
+ /* Not vetorizable yet (unknown loop bound). */
+ for (i = 0; i < n; i++){
+ a[i] = b[i];
+ }
+ fbar (a);
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i];
+ }
+ fbar (a);
+
+ /* Not Vectorizable (mode not supported). */
+ for (i = 0; i < N; i++){
+ da[i] = db[i];
+ }
+ fbar (a);
+
+ /* Not vetorizable yet (constant assignment). */
+ for (i = 0; i < N; i++){
+ a[i] = 5;
+ }
+ fbar (a);
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i] + d[i];
+ }
+ fbar (a);
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] * c[i];
+ }
+ fbar (a);
+
+ /* Vectorizable. */
+ for (i = 0; i < N/2; i++){
+ a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
+ d[i] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
+ }
+ fbar (a);
+
+ /* Not vetorizable yet (too conservative dependence test). */
+ for (i = 0; i < N/2; i++){
+ a[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
+ a[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
+ }
+ fbar (a);
+
+ /* Not vetorizable yet (access pattern). */
+ for (i = 0; i < N/2; i++){
+ a[i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+ d[i] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
+ }
+ fbar (a);
+
+ /* Not vetorizable yet (too conservative dependence test; access pattern). */
+ for (i = 0; i < N/2; i++){
+ a[2*i] = b[2*i+1] * c[2*i+1] - b[2*i] * c[2*i];
+ a[2*i+1] = b[2*i] * c[2*i+1] + b[2*i+1] * c[2*i];
+ }
+ fbar (a);
+
+ /* Not vetorizable yet (no support for integer mult). */
+ for (i = 0; i < N; i++){
+ ia[i] = ib[i] * ic[i];
+ }
+ ibar (ia);
+
+ /* Vectorizable. */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i];
+ d[i] = b[i] + c[i];
+ ia[i] = ib[i] + ic[i];
+ }
+ ibar (ia);
+ fbar (a);
+ fbar (d);
+
+ /* Not vectorizable yet (two types with different nunits in vector). */
+ for (i = 0; i < N; i++){
+ ia[i] = ib[i] + ic[i];
+ sa[i] = sb[i] + sc[i];
+ }
+ ibar (ia);
+ sbar (sa);
+
+ /* Not vetorizable yet (too conservative dependence test). */
+ for (i = 0; i < N; i++){
+ a[i] = b[i] + c[i];
+ a[i+1] = b[i] + c[i];
+ }
+ fbar (a);
+}
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-54.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-54.c
new file mode 100644
index 00000000000..1f64eb4e22d
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-54.c
@@ -0,0 +1,34 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int main(void)
+{
+ int a = 5;
+ int b = 6;
+ int c = 20;
+
+ while (a <= 100)
+ {
+ int i;
+
+ a = b;
+ for (i = 0; i <= 12; i++)
+ {
+ a++;
+ }
+ b = b + c;
+ }
+}
+
+/* This example has been distilled from Pattern1 that cannot be
+ handled: "Big steps, small steps" from the ICS'01 paper "Monotonic
+ Evolution" by Peng Wu.
+
+ The analyzer has to detect the following evolution functions:
+ i -> {0, +, 1}_2
+ b -> {6, +, 20}_1
+ a -> {{6, +, 20}_1, +, 1}_2
+*/
+
+/* FIXME. */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-55.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-55.c
new file mode 100644
index 00000000000..4c53f8f6688
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-55.c
@@ -0,0 +1,17 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest-details" } */
+
+int main(int argc)
+{
+ int I, J;
+ const int N = 30;
+ const int M = 40;
+ for (J = argc; J < N; J += 3)
+ {
+ for (I = J; I < M; I++)
+ {
+ printf ("%d %d\n", I, J);
+ }
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-56.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-56.c
new file mode 100644
index 00000000000..80d896d2a02
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-56.c
@@ -0,0 +1,22 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -ftree-elim-checks -fdump-tree-elck-details -fdump-tree-optimized" } */
+
+void remove_me (void);
+
+int main (void)
+{
+ int a = -100;
+ int b = 0;
+ int c = 3;
+
+ for (a = 0; a < 100; a++)
+ {
+ b = b + 3;
+ if (b != c)
+ remove_me ();
+ c = c + 3;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "remove_me" 0 "optimized"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-57.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-57.c
new file mode 100644
index 00000000000..ae2de4c80ed
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-57.c
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -ftree-elim-checks -fdump-tree-elck-details -fdump-tree-optimized" } */
+
+void remove_me (void);
+
+int main (void)
+{
+ int a = -100;
+ int b = 0;
+ int c = 3;
+
+ for (a = 0; a < 100; a++)
+ {
+ if (b > c)
+ remove_me ();
+ b = b + 2;
+ c = c + 3;
+ }
+}
+
+
+/* { dg-final { scan-tree-dump-times "remove_me" 0 "optimized"} } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-58.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-58.c
new file mode 100644
index 00000000000..a66ab94481f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-58.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -ftree-elim-checks -fdump-tree-elck-details -fdump-tree-optimized" } */
+
+void remove_me (void);
+
+int main (void)
+{
+ int a, b;
+ int N = 100;
+
+ a = 0;
+ b = 0;
+ while (a < N)
+ {
+ if (b >= 5*N - 4)
+ remove_me ();
+ a++;
+ b+=5;
+ }
+}
+
+/* { dg-final { scan-tree-dump-times "remove_me" 0 "optimized"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-59.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-59.c
new file mode 100644
index 00000000000..e65e52825fe
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-59.c
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest " } */
+
+extern int foo (float A[100][200]);
+
+int bar ()
+{
+ int i, j;
+ float A[100][200];
+
+ for (i=0; i<5; i++)
+ for (j=0; j<5; j++)
+ A[i][j] = A[i+1][j];
+ foo (A);
+ return A[1][2];
+}
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-59.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-59.c.ddall
new file mode 100644
index 00000000000..2b2235a44c3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-59.c.ddall
@@ -0,0 +1,80 @@
+;; APPLE LOCAL file lno
+;; Function bar (bar)
+
+(Data Dep (A = 0, B = 1):
+ (subscript 0:
+ access_fn_A: {0, +, 1}_2
+ access_fn_B: {0, +, 1}_2
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {1, +, 1}_1
+ access_fn_B: {0, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {1, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+(1
+)
+ )
+)
+(Data Dep (A = 1, B = 1):
+ (subscript 0:
+ access_fn_A: {0, +, 1}_2
+ access_fn_B: {0, +, 1}_2
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_2
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {0, +, 1}_1
+ access_fn_B: {0, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+(0
+)
+ )
+)
+(Data Dep (A = 1, B = 2):
+ (subscript 0:
+ access_fn_A: {0, +, 1}_2
+ access_fn_B: 2
+ iterations_that_access_an_element_twice_in_A: 2
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: 0
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+
+ (subscript 1:
+ access_fn_A: {0, +, 1}_1
+ access_fn_B: 1
+ iterations_that_access_an_element_twice_in_A: 1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: 0
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(-2
+)
+(-1
+)
+ )
+)
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-60.c b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-60.c
new file mode 100644
index 00000000000..7dd730ce9bc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-60.c
@@ -0,0 +1,22 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -floop-test -fdump-tree-lptest " } */
+
+extern int foo (float A[100]);
+
+int bar ()
+{
+ int i, j;
+ float A[100];
+
+ for (i=0; i<5; i++)
+ {
+ A[i * 3] = i + 3;
+ A[i + 7] = i;
+ }
+
+ foo (A);
+ return A[1];
+}
+
+/* { dg-final { diff-tree-dumps "ddall" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-60.c.ddall b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-60.c.ddall
new file mode 100644
index 00000000000..88b906fd0f7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/ssa-chrec-60.c.ddall
@@ -0,0 +1,51 @@
+;; APPLE LOCAL file lno
+;; Function bar (bar)
+
+(Data Dep (A = 0, B = 0):
+ (subscript 0:
+ access_fn_A: {0, +, 3}_1
+ access_fn_B: {0, +, 3}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+ )
+)
+(Data Dep (A = 0, B = 1):
+ (subscript 0:
+ access_fn_A: {0, +, 3}_1
+ access_fn_B: {7, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {3, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {2, +, 3}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+([-oo, +oo]
+)
+ )
+)
+(Data Dep (A = 0, B = 2): (no dependence)
+)
+(Data Dep (A = 1, B = 1):
+ (subscript 0:
+ access_fn_A: {7, +, 1}_1
+ access_fn_B: {7, +, 1}_1
+ iterations_that_access_an_element_twice_in_A: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_A: [-oo, +oo]
+ iterations_that_access_an_element_twice_in_B: {0, +, 1}_1
+ last_iteration_that_access_an_element_twice_in_B: [-oo, +oo]
+ )
+ (Distance Vector:
+(0
+)
+ )
+)
+(Data Dep (A = 1, B = 2): (no dependence)
+)
+
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-chrec/tree-ssa-scev.exp b/gcc/testsuite/gcc.dg/tree-ssa-chrec/tree-ssa-scev.exp
new file mode 100644
index 00000000000..46fcf02054f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-chrec/tree-ssa-scev.exp
@@ -0,0 +1,36 @@
+# APPLE LOCAL file lno
+# Copyright (C) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-vect/ifc-01.c b/gcc/testsuite/gcc.dg/tree-ssa-vect/ifc-01.c
new file mode 100644
index 00000000000..6f86290c629
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-vect/ifc-01.c
@@ -0,0 +1,55 @@
+/* APPLE LOCAL file AV */
+/* { dg-do run { target powerpc*-*-* i?86-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse" { target i?86-*-* } } */
+
+#include <stdarg.h>
+#include <signal.h>
+
+extern void abort (void);
+extern void exit (int);
+#define N 16
+#define MAX 42
+
+int main1 ()
+{
+ int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ {
+ j = A[i];
+ A[i] = ( j >= MAX ? MAX : 0);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (A[i] > MAX)
+ abort ();
+ }
+
+ return 0;
+}
+
+void
+sig_ill_handler (int sig)
+{
+ exit(0);
+}
+
+int main (void)
+{
+ /* Exit on systems without altivec. */
+ signal (SIGILL, sig_ill_handler);
+ /* Altivec instruction, 'vor %v0,%v0,%v0'. */
+ asm volatile (".long 0x10000484");
+ signal (SIGILL, SIG_DFL);
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-vect/ifc-02.c b/gcc/testsuite/gcc.dg/tree-ssa-vect/ifc-02.c
new file mode 100644
index 00000000000..5d996ef832b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-vect/ifc-02.c
@@ -0,0 +1,49 @@
+/* APPLE LOCAL file */
+/* { dg-do compile { target powerpc*-*-* i?86-*-* } } */
+/* { dg-options "-c -O2 -ftree-vectorize -fdump-tree-vect-details -maltivec" { target powerpc*-*-* } } */
+/* { dg-options "-c -O2 -ftree-vectorize -fdump-tree-vect-details -msse" { target i?86-*-* } } */
+
+#include <stdarg.h>
+#include <signal.h>
+
+extern int c;
+struct A;
+typedef struct A *A_def;
+static A_def *data;
+
+extern void abort (void);
+extern void exit (int);
+
+#define N 128
+
+int main1 ()
+{
+
+ unsigned int i;
+
+ for (i = 0; i < N; i++)
+ if (c)
+ data[i] = 0;
+
+ return 0;
+}
+
+void
+sig_ill_handler (int sig)
+{
+ exit(0);
+}
+
+int main (void)
+{
+ /* Exit on systems without altivec. */
+ signal (SIGILL, sig_ill_handler);
+ /* Altivec instruction, 'vor %v0,%v0,%v0'. */
+ asm volatile (".long 0x10000484");
+ signal (SIGILL, SIG_DFL);
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "Applying if-conversion" 1 "vect" { xfail *-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-vect/pr16105.c b/gcc/testsuite/gcc.dg/tree-ssa-vect/pr16105.c
new file mode 100644
index 00000000000..3a968ff25ea
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-vect/pr16105.c
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile { target powerpc*-*-* i?86-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* } } */
+
+#define VECTOR_SIZE 512
+typedef float afloat __attribute__ ((__aligned__(16)));
+
+extern void check(const afloat * __restrict__ v);
+
+void square(const afloat * __restrict__ a,
+ afloat * __restrict__ out)
+{
+ unsigned int i;
+ for (i = 0; i < VECTOR_SIZE; i++) {
+ float ai = a[i];
+ float a2 = ai * ai;
+ out[i] = a2;
+ }
+ check(out);
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-31.c b/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-31.c
new file mode 100644
index 00000000000..d1e77acc6e0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-31.c
@@ -0,0 +1,44 @@
+/* APPLE LOCAL file lno */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+typedef char achar __attribute__ ((__aligned__(16)));
+
+#define N 16
+
+int main1 ()
+{
+ struct {
+ achar ca[N];
+ } s;
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != 5)
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-35.c b/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-35.c
new file mode 100644
index 00000000000..14591764e9f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect-35.c
@@ -0,0 +1,43 @@
+/* APPLE LOCAL file lno */
+/* { dg-do run { target powerpc*-*-* } } */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+
+int main1 ()
+{
+ struct {
+ char ca[N];
+ } s;
+ char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
+ int i;
+
+ for (i = 0; i < N; i++)
+ {
+ s.ca[i] = cb[i];
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ {
+ if (s.ca[i] != cb[i])
+ abort ();
+ }
+
+ return 0;
+}
+
+int main (void)
+{
+ check_vect ();
+
+ return main1 ();
+}
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect.exp b/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect.exp
new file mode 100644
index 00000000000..46fcf02054f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-ssa-vect.exp
@@ -0,0 +1,36 @@
+# APPLE LOCAL file lno
+# Copyright (C) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# GCC testsuite that uses the `dg.exp' driver.
+
+# Load support procs.
+load_lib gcc-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_CFLAGS
+if ![info exists DEFAULT_CFLAGS] then {
+ set DEFAULT_CFLAGS " -ansi -pedantic-errors"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Main loop.
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" $DEFAULT_CFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-vect.h b/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-vect.h
new file mode 100644
index 00000000000..f56e83138b3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa-vect/tree-vect.h
@@ -0,0 +1,25 @@
+/* APPLE LOCAL file lno */
+/* Check if system supports SIMD */
+#include <signal.h>
+
+extern void exit (int);
+extern void abort (void);
+
+void
+sig_ill_handler (int sig)
+{
+ exit(0);
+}
+
+void check_vect (void)
+{
+ signal(SIGILL, sig_ill_handler);
+#if defined(__ppc__) || defined(__ppc64__)
+ /* Altivec instruction, 'vor %v0,%v0,%v0'. */
+ asm volatile (".long 0x10000484");
+#elif defined(__i386__) || defined(__x86_64__)
+ /* SSE2 instruction: movsd %xmm0,%xmm0 */
+ asm volatile (".byte 0xf2,0x0f,0x10,0xc0");
+#endif
+ signal (SIGILL, SIG_DFL);
+}
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
index a1ef017dfda..7e645a85864 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030711-1.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* APPLE LOCAL lno */
+/* { dg-options "-O1 -fdump-tree-dom3 -ftree-loop-optimize" } */
extern void abort (void);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
index 2c8a84a494d..e9f57e40f1d 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20030714-2.c
@@ -1,5 +1,6 @@
/* { dg-do compile } */
-/* { dg-options "-O1 -fdump-tree-dom3" } */
+/* APPLE LOCAL lno */
+/* { dg-options "-O1 -fdump-tree-dom3 -ftree-loop-optimize" } */
union tree_node;
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040308-1.c b/gcc/testsuite/gcc.dg/tree-ssa/20040308-1.c
new file mode 100644
index 00000000000..987aad09519
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040308-1.c
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+
+int t( int i)
+{
+ int j;
+ if(i ==0)
+ j = 1;
+ else
+ j = 0;
+
+
+ return j;
+}
+
+/* We should convert one COND_EXPRs into straightline code. */
+/* { dg-final { scan-tree-dump-times "straightline" 1 "phiopt1" {xfail *-*-* } } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040308-2.c b/gcc/testsuite/gcc.dg/tree-ssa/20040308-2.c
new file mode 100644
index 00000000000..23fad9a47e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040308-2.c
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O2 -fdump-tree-phiopt1-details -fdump-tree-tailc-details" } */
+
+
+int f(int i)
+{
+ int result;
+ result = t(i);
+ if (result)
+ return result;
+ return 0;
+}
+
+/* We should convert one COND_EXPRs into straightline code. */
+/* { dg-final { scan-tree-dump-times "straightline" 1 "phiopt1" } } */
+/* Also we should have found that the call to t is tail called. */
+/* { dg-final { scan-tree-dump-times "Found tail call" 1 "tailc" } } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/20040308-3.c b/gcc/testsuite/gcc.dg/tree-ssa/20040308-3.c
new file mode 100644
index 00000000000..962734fdf6a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/20040308-3.c
@@ -0,0 +1,18 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O1 -fdump-tree-phiopt1-details" } */
+
+int t( int i)
+{
+ int j;
+ if(i>=0)
+ j = i;
+ else
+ j = -i;
+ return j;
+}
+
+/* We should convert one COND_EXPRs into straightline code with ABS. */
+/* { dg-final { scan-tree-dump-times "straightline" 1 "phiopt1"} } */
+/* { dg-final { scan-tree-dump-times "ABS_EXPR" 1 "phiopt1"} } */
+
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c
new file mode 100644
index 00000000000..c9fc2003ec7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ivcanon-1.c
@@ -0,0 +1,38 @@
+/* APPLE LOCAL file lno */
+/* { dg-do compile } */
+/* { dg-options "-O2 -ftree-loop-optimize -funroll-loops -fdump-tree-optimized" } */
+
+void foo(void)
+{
+ int n = 16875;
+
+ while (n)
+ {
+ if (n&1)
+ bar (n);
+ n >>= 1;
+ }
+}
+
+static inline int power (long x, unsigned int n)
+{
+ long y = n % 2 ? x : 1;
+
+ while (n >>= 1)
+ {
+ x = x * x;
+ if (n % 2)
+ y = y * x;
+ }
+
+ return y;
+}
+
+void test(long x)
+{
+ bar (power (x, 10));
+ bar (power (x, 27));
+}
+
+/* All loops should be completely unrolled, so there should be no labels. */
+/* { dg-final { scan-tree-dump-times "<L" 0 "optimized"} } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-dv-1.c b/gcc/testsuite/gcc.dg/vect/vect-dv-1.c
new file mode 100644
index 00000000000..516956b8cab
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-dv-1.c
@@ -0,0 +1,21 @@
+/* APPLE LOCAL file AV */
+/* Test compiler crash when dependence analyzer can not represent
+ dependence relation by distance vector. */
+/* { dg-do compile } */
+
+int x[199];
+
+void foo()
+
+{
+ int t,j;
+
+ for (j=99;j>0;j--)
+ x [j+j]=x[j];
+
+ for (j=198;j>=100;j--)
+ if(x[j])
+ {
+ x[j-63]=x[j-3]-x[j];
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-1.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-1.c
new file mode 100644
index 00000000000..be35d3e7bff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-1.c
@@ -0,0 +1,76 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -msse2" { target i?86-*-* x86_64-*-* } } */
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 64
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ int A[N];
+ int B[N];
+ int C[N];
+ int D[N];
+
+ int i, j;
+
+ for (i = 0; i < N; i++)
+ {
+ A[i] = i;
+ B[i] = i;
+ C[i] = i;
+ D[i] = i;
+ }
+
+ /* Vectorizable */
+ for (i = 0; i < 16; i++)
+ {
+ A[i] = A[i+20];
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ if (A[i] != A[i+20])
+ abort ();
+ }
+
+ /* Vectorizable */
+ for (i = 0; i < 16; i++)
+ {
+ B[i] = B[i] + 5;
+ }
+
+ /* check results: */
+ for (i = 0; i < 16; i++)
+ {
+ if (B[i] != C[i] + 5)
+ abort ();
+ }
+
+ /* Not vectorizable */
+ for (i = 0; i < 4; i++)
+ {
+ C[i] = C[i+3];
+ }
+
+ /* check results: */
+ for (i = 0; i < 4; i++)
+ {
+ if (C[i] != D[i+3])
+ abort ();
+ }
+
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c
new file mode 100644
index 00000000000..0f7de3fcb8f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-2.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+ int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
+ int i, j;
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] >= MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c
new file mode 100644
index 00000000000..e9e862ba4f5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-3.c
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+ int B[N] = {0,0,0,42,42,0,0,0,0,0,42,42,42,42,42,0};
+ int i, j;
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] > MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c
new file mode 100644
index 00000000000..75b397c0bd8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-4.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+ int B[N] = {42,42,42,0,0,42,42,42,42,42,0,0,0,0,0,42};
+ int i, j;
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] <= MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c
new file mode 100644
index 00000000000..b2e55291495
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-5.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+ int B[N] = {42,42,0,0,0,42,42,42,42,42,0,0,0,0,0,42};
+ int i, j;
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] < MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c
new file mode 100644
index 00000000000..776c9a6680e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-6.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ int A[N] = {36,39,42,45,43,32,21,42,23,34,45,56,67,42,89,11};
+ int B[N] = {42,42,0,42,42,42,42,0,42,42,42,42,42,0,42,42};
+ int i, j;
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] != MAX ? MAX : 0);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c
new file mode 100644
index 00000000000..1647b6f89c0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-7.c
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,42,78,89,11};
+ int B[N] = {42,42,0,42,42,42,42,42,42,42,42,42,0,42,42,42};
+ int i, j;
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] == MAX ? 0 : MAX);
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-8.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-8.c
new file mode 100644
index 00000000000..7ce84470382
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-8.c
@@ -0,0 +1,37 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O2 -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int main ()
+{
+ unsigned short A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+ unsigned short B[N] = {0,0,0,3,1,0,0,0,0,0,3,14,25,36,47,0};
+ unsigned int i, j;
+ unsigned m;
+
+ for (i = 0; i < 16; i++)
+ {
+ m = A[i];
+ A[i] = (unsigned short) ( m >= MAX ? m-MAX : 0);
+ }
+
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c
new file mode 100644
index 00000000000..ab2eeab6e72
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/vect-ifcvt-9.c
@@ -0,0 +1,40 @@
+/* APPLE LOCAL file AV data dependence */
+/* { dg-do run } */
+/* { dg-options "-O3 -funroll-loops -ftree-vectorize -fdump-tree-vect-stats -maltivec" { target powerpc*-*-* } } */
+
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define N 16
+#define MAX 42
+
+extern void abort(void);
+
+int A[N] = {36,39,42,45,43,32,21,12,23,34,45,56,67,78,89,11};
+int B[N] = {0,0,42,42,42,0,0,0,0,0,42,42,42,42,42,0};
+void foo () __attribute__((always_inline));
+void foo ()
+{
+ int i, j;
+
+ for (i = 0; i < 16; i++)
+ A[i] = ( A[i] >= MAX ? MAX : 0);
+}
+
+int main ()
+{
+
+ int i, j;
+ foo ();
+ /* check results: */
+ for (i = 0; i < N; i++)
+ if (A[i] != B[i])
+ abort ();
+
+ return 0;
+}
+
+
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail i?86-*-* x86_64-*-* } } } */
diff --git a/gcc/testsuite/gcc.dg/vect/vect-none.c b/gcc/testsuite/gcc.dg/vect/vect-none.c
index f5303b93e18..8ff691148ac 100644
--- a/gcc/testsuite/gcc.dg/vect/vect-none.c
+++ b/gcc/testsuite/gcc.dg/vect/vect-none.c
@@ -181,4 +181,8 @@ foo (int n)
}
/* { dg-final { scan-tree-dump-times "vectorized " 3 "vect"} } */
-/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 3 "vect"} } */
+/* APPLE LOCAL begin AV */
+/* Test 6 is vectorized. */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect"} } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */
+/* APPLE LOCAL end AV */
diff --git a/gcc/testsuite/gcc.dg/verbose-asm-2.c b/gcc/testsuite/gcc.dg/verbose-asm-2.c
new file mode 100644
index 00000000000..314ac949541
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/verbose-asm-2.c
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file */
+/* Test whether -fverbose-asm emits option values. */
+/* Contibuted by Devang Patel <dpatel@apple.com>. */
+
+/* { dg-do compile } */
+/* { dg-options "-fverbose-asm" } */
+/* { dg-final { scan-assembler "fpeephole" } } */
+
+int
+main (int argc, char *argv [])
+{
+ return 0;
+}
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
index 19c06839fe6..9f79fbb273a 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -273,6 +273,11 @@ proc g++_target_compile { source dest type options } {
}
lappend options "additional_flags=[libio_include_flags]"
+ # APPLE LOCAL begin testsuite multiply defined
+ if [ istarget *-*-darwin* ] {
+ lappend options "ldflags=-Wl,-multiply_defined,suppress"
+ }
+ # APPLE LOCAL end testsuite multiply defined
lappend options "compiler=$GXX_UNDER_TEST";
set options [concat $gpp_compile_options $options]
diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp
index 2f553387666..e5d3d5d857e 100644
--- a/gcc/testsuite/lib/gcc.exp
+++ b/gcc/testsuite/lib/gcc.exp
@@ -144,6 +144,11 @@ proc gcc_target_compile { source dest type options } {
if [target_info exists gcc,timeout] {
lappend options "timeout=[target_info gcc,timeout]"
}
+ # APPLE LOCAL begin testsuite multiply defined
+ if [ istarget *-*-darwin* ] {
+ lappend options "ldflags=-Wl,-multiply_defined,suppress"
+ }
+ # APPLE LOCAL end testsuite multiply defined
lappend options "compiler=$GCC_UNDER_TEST"
set options [dg-additional-files-options $options $source]
return [target_compile $source $dest $type $options]
diff --git a/gcc/testsuite/lib/obj-c++-dg.exp b/gcc/testsuite/lib/obj-c++-dg.exp
new file mode 100644
index 00000000000..a8c83e1937e
--- /dev/null
+++ b/gcc/testsuite/lib/obj-c++-dg.exp
@@ -0,0 +1,29 @@
+# APPLE LOCAL file Objective-C++
+# Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Define obj-c++ callbacks for dg.exp.
+
+load_lib gcc-dg.exp
+
+proc obj-c++-dg-test { prog do_what extra_tool_flags } {
+ return [gcc-dg-test-1 obj-c++_target_compile $prog $do_what $extra_tool_flags]
+}
+
+
+proc obj-c++-dg-prune { system text } {
+ return [gcc-dg-prune $system $text]
+}
diff --git a/gcc/testsuite/lib/obj-c++.exp b/gcc/testsuite/lib/obj-c++.exp
new file mode 100644
index 00000000000..90eec3ed5b3
--- /dev/null
+++ b/gcc/testsuite/lib/obj-c++.exp
@@ -0,0 +1,366 @@
+# APPLE LOCAL file Objective-C++
+# Copyright (C) 2004 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, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Rob Savoye (rob@cygnus.com)
+# Many modifications by Jeffrey Wheat (cassidy@cygnus.com)
+# With modifications by Mike Stump <mrs@cygnus.com>.
+
+#
+# obj-c++ support library routines
+#
+load_lib prune.exp
+load_lib gcc-defs.exp
+
+#
+# OBJCXX_UNDER_TEST is the compiler under test.
+#
+
+
+set gpp_compile_options ""
+
+#
+# obj-c++_version -- extract and print the version number of the compiler
+#
+
+proc obj-c++_version { } {
+ global OBJCXX_UNDER_TEST
+
+ obj-c++_init
+
+ # ignore any arguments after the command
+ set compiler [lindex $OBJCXX_UNDER_TEST 0]
+
+ # verify that the compiler exists
+ if { [is_remote host] || [which $compiler] != 0 } then {
+ set tmp [remote_exec host "$compiler -v"]
+ set status [lindex $tmp 0];
+ set output [lindex $tmp 1];
+ regexp " version \[^\n\r\]*" $output version
+ if { $status == 0 && [info exists version] } then {
+ if [is_remote host] {
+ clone_output "$compiler $version\n"
+ } else {
+ clone_output "[which $compiler] $version\n"
+ }
+ } else {
+ clone_output "Couldn't determine version of [which $compiler]\n"
+ }
+ } else {
+ # compiler does not exist (this should have already been detected)
+ warning "$compiler does not exist"
+ }
+}
+
+#
+# obj-c++_include_flags -- provide new version of obj-c++_include_flags
+# (originally from libgloss.exp) which knows about the gcc tree structure
+#
+proc obj-c++_include_flags { paths } {
+ global srcdir
+ global HAVE_LIBSTDCXX_V3
+ global TESTING_IN_BUILD_TREE
+
+ set flags ""
+
+ if { [is_remote host] || ! [info exists TESTING_IN_BUILD_TREE] } {
+ return "${flags}"
+ }
+
+ set gccpath ${paths}
+
+ set odir [lookfor_file ${gccpath} libstdc++-v3]
+ if { ${odir} != "" } {
+ append flags [exec sh ${odir}/scripts/testsuite_flags --build-includes]
+ }
+
+ return "$flags"
+}
+
+#
+# obj-c++_link_flags -- provide new version of obj-c++_link_flags
+# (originally from libgloss.exp) which knows about the gcc tree structure
+#
+
+proc obj-c++_link_flags { paths } {
+ global rootme
+ global srcdir
+ global ld_library_path
+ global OBJCXX_UNDER_TEST
+
+ set gccpath ${paths}
+ set libio_dir ""
+ set flags ""
+ set ld_library_path "."
+
+ if { $gccpath != "" } {
+ if [file exists "${gccpath}/lib/libstdc++.a"] {
+ append ld_library_path ":${gccpath}/lib"
+ }
+ if [file exists "${gccpath}/libg++/libg++.a"] {
+ append flags "-L${gccpath}/libg++ "
+ append ld_library_path ":${gccpath}/libg++"
+ }
+ if [file exists "${gccpath}/libstdc++/libstdc++.a"] {
+ append flags "-L${gccpath}/libstdc++ "
+ append ld_library_path ":${gccpath}/libstdc++"
+ }
+ if [file exists "${gccpath}/libstdc++-v3/src/.libs/libstdc++.a"] {
+ append flags " -L${gccpath}/libstdc++-v3/src/.libs "
+ append ld_library_path ":${gccpath}/libstdc++-v3/src/.libs"
+ }
+ if [file exists "${gccpath}/libiberty/libiberty.a"] {
+ append flags "-L${gccpath}/libiberty "
+ }
+ if [file exists "${gccpath}/librx/librx.a"] {
+ append flags "-L${gccpath}/librx "
+ }
+ append ld_library_path ":${rootme}"
+ set compiler [lindex $OBJCXX_UNDER_TEST 0]
+ if { [is_remote host] == 0 && [which $compiler] != 0 } {
+ foreach i "[exec $compiler --print-multi-lib]" {
+ set mldir ""
+ regexp -- "\[a-z0-9=/\.-\]*;" $i mldir
+ set mldir [string trimright $mldir "\;@"]
+ if { "$mldir" == "." } {
+ continue
+ }
+ if { [llength [glob -nocomplain ${rootme}/${mldir}/libgcc_s*.so.*]] == 1 } {
+ append ld_library_path ":${rootme}/${mldir}"
+ }
+ }
+ }
+ } else {
+ global tool_root_dir;
+
+ set libgpp [lookfor_file ${tool_root_dir} libg++];
+ if { $libgpp != "" } {
+ append flags "-L${libgpp} ";
+ append ld_library_path ":${libgpp}"
+ }
+ set libstdcpp [lookfor_file ${tool_root_dir} libstdc++];
+ if { $libstdcpp != "" } {
+ append flags "-L${libstdcpp} ";
+ append ld_library_path ":${libstdcpp}"
+ }
+ set libiberty [lookfor_file ${tool_root_dir} libiberty];
+ if { $libiberty != "" } {
+ append flags "-L${libiberty} ";
+ }
+ set librx [lookfor_file ${tool_root_dir} librx];
+ if { $librx != "" } {
+ append flags "-L${librx} ";
+ }
+ }
+
+ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but
+ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH
+ # (for the 64-bit ABI). The right way to do this would be to modify
+ # unix.exp -- but that's not an option since it's part of DejaGNU
+ # proper, so we do it here.
+ # The same applies to Darwin (DYLD_LIBRARY_PATH), Solaris 32 bit
+ # (LD_LIBRARY_PATH_32), Solaris 64 bit (LD_LIBRARY_PATH_64), and HP-UX
+ # (SHLIB_PATH).
+ # Doing this does cause trouble when testing cross-compilers.
+ if {![is_remote target]} {
+ global env;
+ if [info exists env(LD_LIBRARY_PATH)] {
+ # If we've already added these directories once, keep the
+ # existing path.
+ if {$ld_library_path == $env(LD_LIBRARY_PATH)
+ || [string first $ld_library_path: \
+ $env(LD_LIBRARY_PATH)] == 0} {
+ set ld_library_path $env(LD_LIBRARY_PATH)
+ } elseif { $env(LD_LIBRARY_PATH) != "" } {
+ append ld_library_path ":$env(LD_LIBRARY_PATH)"
+ }
+ }
+ setenv LD_LIBRARY_PATH $ld_library_path
+ setenv SHLIB_PATH $ld_library_path
+ setenv LD_LIBRARYN32_PATH $ld_library_path
+ setenv LD_LIBRARY64_PATH $ld_library_path
+ setenv LD_LIBRARY_PATH_32 $ld_library_path
+ setenv LD_LIBRARY_PATH_64 $ld_library_path
+ setenv DYLD_LIBRARY_PATH $ld_library_path
+ }
+
+ return "$flags"
+}
+
+#
+# obj-c++_init -- called at the start of each subdir of tests
+#
+
+proc obj-c++_init { args } {
+ global subdir
+ global gpp_initialized
+ global base_dir
+ global tmpdir
+ global libdir
+ global gluefile wrap_flags;
+ global objdir srcdir
+ global ALWAYS_OBJCXXFLAGS
+ global TOOL_EXECUTABLE TOOL_OPTIONS
+ global OBJCXX_UNDER_TEST
+ global TESTING_IN_BUILD_TREE
+ global target_triplet
+
+ if ![info exists OBJCXX_UNDER_TEST] then {
+ if [info exists TOOL_EXECUTABLE] {
+ set OBJCXX_UNDER_TEST $TOOL_EXECUTABLE;
+ } else {
+ if { [is_remote host] || ! [info exists TESTING_IN_BUILD_TREE] } {
+ set OBJCXX_UNDER_TEST [transform c++]
+ } else {
+ set OBJCXX_UNDER_TEST [findfile $base_dir/../g++ "$base_dir/../g++ -B$base_dir/../" [findfile $base_dir/g++ "$base_dir/g++ -B$base_dir/" [transform c++]]]
+ }
+ }
+ }
+
+ # Bleah, nasty. Bad taste.
+ if [ishost "*-dos-*" ] {
+ regsub "c\\+\\+" "$OBJCXX_UNDER_TEST" "gcc" OBJCXX_UNDER_TEST
+ }
+
+ if ![is_remote host] {
+ if { [which $OBJCXX_UNDER_TEST] == 0 } then {
+ perror "OBJCXX_UNDER_TEST ($OBJCXX_UNDER_TEST) does not exist"
+ exit 1
+ }
+ }
+ if ![info exists tmpdir] {
+ set tmpdir "/tmp"
+ }
+
+ if [info exists gluefile] {
+ unset gluefile
+ }
+
+ obj-c++_maybe_build_wrapper "${tmpdir}/obj-c++-testglue.o"
+
+ set ALWAYS_OBJCXXFLAGS ""
+
+ if ![is_remote host] {
+ if [info exists TOOL_OPTIONS] {
+ lappend ALWAYS_OBJCXXFLAGS "additional_flags=[obj-c++_include_flags [get_multilibs ${TOOL_OPTIONS}] ]";
+ lappend ALWAYS_OBJCXXFLAGS "ldflags=[obj-c++_link_flags [get_multilibs ${TOOL_OPTIONS}] ]";
+ } else {
+ lappend ALWAYS_OBJCXXFLAGS "additional_flags=[obj-c++_include_flags [get_multilibs] ]";
+ lappend ALWAYS_OBJCXXFLAGS "ldflags=[obj-c++_link_flags [get_multilibs] ]";
+ }
+ }
+
+ if [info exists TOOL_OPTIONS] {
+ lappend ALWAYS_OBJCXXFLAGS "additional_flags=$TOOL_OPTIONS";
+ }
+
+ # Make sure that lines are not wrapped. That can confuse the
+ # error-message parsing machinery.
+ lappend ALWAYS_OBJCXXFLAGS "additional_flags=-fmessage-length=0"
+
+ if { [string match "powerpc-*-darwin*" $target_triplet] } {
+ lappend ALWAYS_OBJCXXFLAGS "ldflags=-multiply_defined suppress"
+ }
+
+ verbose -log "ALWAYS_OBJCXXFLAGS set to $ALWAYS_OBJCXXFLAGS"
+
+ verbose "obj-c++ is initialized" 3
+}
+
+#
+# obj-c++_target_compile -- compile a source file
+#
+
+proc obj-c++_target_compile { source dest type options } {
+ global tmpdir;
+ global gpp_compile_options
+ global gluefile wrap_flags
+ global ALWAYS_OBJCXXFLAGS;
+ global OBJCXX_UNDER_TEST;
+
+ lappend options "libs=-lobjc"
+
+ if { [target_info needs_status_wrapper] != "" && [info exists gluefile] } {
+ lappend options "libs=${gluefile}"
+ lappend options "ldflags=${wrap_flags}"
+ }
+
+ # If we have built libobjc along with the compiler (which usually
+ # _is not_ the case on Mac OS X systems), point the test harness
+ # at it (and associated headers).
+
+ set objcpath "[get_multilibs]"
+
+ set libobjc_dir [lookfor_file ${objcpath} libobjc/.libs/libobjc.a]
+ if { $libobjc_dir == ""} {
+ verbose "see if we have -fgnu-runtime in [target_info name]"
+ if [regexp ".*-fgnu-runtime.*" [target_info name]] {
+ set libobjc_dir [lookfor_file ${objcpath} libobjc/.libs/libobjc-gnu.a]
+ }
+ }
+ if { $libobjc_dir != "" } {
+ set objc_include_dir "${srcdir}/../../libobjc"
+ lappend options "additional_flags=-I${objc_include_dir}"
+ set libobjc_dir [file dirname ${libobjc_dir}]
+ set objc_link_flags "-L${libobjc_dir}"
+ lappend options "additional_flags=${objc_link_flags}"
+ append ld_library_path ":${libobjc_dir}"
+ }
+
+ lappend options "additional_flags=[libio_include_flags]"
+ lappend options "compiler=$OBJCXX_UNDER_TEST";
+
+ set options [concat $gpp_compile_options $options]
+
+ set options [concat "$ALWAYS_OBJCXXFLAGS" $options];
+
+ if { [regexp "(^| )-frepo( |$)" $options] && \
+ [regexp "\.o(|bj)$" $dest] } then {
+ regsub "\.o(|bj)$" $dest ".rpo" rponame
+ exec rm -f $rponame
+ }
+
+ set options [dg-additional-files-options $options $source]
+
+ set result [target_compile $source $dest $type $options]
+
+ return $result
+}
+
+#
+# ${tool}_option_help
+#
+
+proc ${tool}_option_help { } {
+ send_user " --additional_options,OPTIONS\t\tUse OPTIONS to compile the testcase files. OPTIONS should be comma-separated.\n"
+}
+
+#
+# ${tool}_option_proc
+#
+
+proc ${tool}_option_proc { option } {
+ if [regexp "^--additional_options," $option] {
+ global gpp_compile_options
+ regsub "--additional_options," $option "" option
+ foreach x [split $option ","] {
+ lappend gpp_compile_options "additional_flags=$x"
+ }
+ return 1;
+ } else {
+ return 0
+ }
+}
diff --git a/gcc/testsuite/lib/scantree.exp b/gcc/testsuite/lib/scantree.exp
index 76d1a59fb60..085faa92f57 100644
--- a/gcc/testsuite/lib/scantree.exp
+++ b/gcc/testsuite/lib/scantree.exp
@@ -19,6 +19,54 @@
#
# This is largely borrowed from scanasm.exp.
+# APPLE LOCAL begin lno
+# Utility for diffing compiler result against an expected output file.
+# Invoked via dg-final. Call pass if there are no differences between
+# the output of the compiler and the expected output file, otherwise
+# fail. The expected output file has the same name as the output
+# file, and is stored in the same directory as the testcase.
+#
+# Argument 0 is the suffix for the tree dump file
+# Argument 1 handles expected failures and the like
+proc diff-tree-dumps { args } {
+ if { [llength $args] < 1 } {
+ error "diff-tree-dumps: too few arguments"
+ return
+ }
+ if { [llength $args] > 2 } {
+ error "diff-tree-dumps:: too many arguments"
+ return
+ }
+ if { [llength $args] >= 2 } {
+ switch [dg-process-target [lindex $args 1]] {
+ "S" { }
+ "N" { return }
+ "F" { setup_xfail "*-*-*" }
+ "P" { }
+ }
+ }
+
+ # This assumes that we are two frames down from dg-test, and that
+ # it still stores the filename of the testcase in a local variable "name".
+ # A cleaner solution would require a new dejagnu release.
+ upvar 2 prog testcase
+
+ # This must match the rule in gcc-dg.exp.
+ # APPLE LOCAL <rdar://problem/3837835> Selective inlining of functions that use Altivec
+ set new_file "[glob [file tail $testcase].\[ti\]??.[lindex $args 0]]"
+ set reference_file "[glob $testcase.[lindex $args 0]]"
+
+ set test_result [diff $reference_file $new_file]
+
+ if { $test_result == 1 } {
+ pass "$testcase diff-tree-dumps [lindex $args 0]"
+ } else {
+ fail "$testcase diff-tree-dumps [lindex $args 0]"
+ local_exec (diff $reference_file $new_file 0);
+ }
+}
+# APPLE LOCAL end lno
+
# Utility for scanning compiler result, invoked via dg-final.
# Call pass if pattern is present, otherwise fail.
#
@@ -49,7 +97,8 @@ proc scan-tree-dump { args } {
upvar 2 name testcase
# This must match the rule in gcc-dg.exp.
- set output_file "[glob [file tail $testcase].t??.[lindex $args 1]]"
+ # APPLE LOCAL <rdar://problem/3837835> Selective inlining of functions that use Altivec
+ set output_file "[glob [file tail $testcase].\[ti\]??.[lindex $args 1]]"
set fd [open $output_file r]
set text [read $fd]
@@ -91,7 +140,8 @@ proc scan-tree-dump-times { args } {
upvar 2 name testcase
# This must match the rule in gcc-dg.exp.
- set output_file "[glob [file tail $testcase].t??.[lindex $args 2]]"
+ # APPLE LOCAL <rdar://problem/3837835> Selective inlining of functions that use Altivec
+ set output_file "[glob [file tail $testcase].\[ti\]??.[lindex $args 2]]"
set fd [open $output_file r]
set text [read $fd]
@@ -128,7 +178,8 @@ proc scan-tree-dump-not { args } {
}
upvar 2 name testcase
- set output_file "[glob [file tail $testcase].t??.[lindex $args 1]]"
+ # APPLE LOCAL <rdar://problem/3837835> Selective inlining of functions that use Altivec
+ set output_file "[glob [file tail $testcase].\[ti\]??.[lindex $args 1]]"
set fd [open $output_file r]
set text [read $fd]
@@ -179,7 +230,8 @@ proc scan-tree-dump-dem { args } {
}
upvar 2 name testcase
- set output_file "[glob [file tail $testcase].t??.[lindex $args 1]]"
+ # APPLE LOCAL <rdar://problem/3837835> Selective inlining of functions that use Altivec
+ set output_file "[glob [file tail $testcase].\[ti\]??.[lindex $args 1]]"
set fd [open "| $cxxfilt < $output_file" r]
set text [read $fd]
@@ -229,7 +281,8 @@ proc scan-tree-dump-dem-not { args } {
}
upvar 2 name testcase
- set output_file "[glob [file tail $testcase].t??.[lindex $args 1]]"
+ # APPLE LOCAL <rdar://problem/3837835> Selective inlining of functions that use Altivec
+ set output_file "[glob [file tail $testcase].\[ti\]??.[lindex $args 1]]"
set fd [open "| $cxxfilt < $output_file" r]
set text [read $fd]
diff --git a/gcc/testsuite/obj-c++.dg/basic.mm b/gcc/testsuite/obj-c++.dg/basic.mm
new file mode 100644
index 00000000000..baa237bdfba
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/basic.mm
@@ -0,0 +1,22 @@
+// APPLE LOCAL file Objective-C++
+// A basic sanity check for Objective-C++.
+// { dg-do run }
+
+#include <objc/Object.h>
+#include <iostream>
+
+@interface Greeter : Object
+- (void) greet: (const char *)msg;
+@end
+
+@implementation Greeter
+- (void) greet: (const char *)msg { std::cout << msg; }
+@end
+
+int
+main ()
+{
+ std::cout << "Hello from C++\n";
+ Greeter *obj = [Greeter new];
+ [obj greet: "Hello from Objective-C\n"];
+}
diff --git a/gcc/testsuite/obj-c++.dg/comp-types-1.mm b/gcc/testsuite/obj-c++.dg/comp-types-1.mm
new file mode 100644
index 00000000000..2cea5eeb48a
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/comp-types-1.mm
@@ -0,0 +1,17 @@
+/* APPLE LOCAL file Objective-C++ */
+/* { dg-do compile } */
+
+@interface A
++ new;
+@end
+
+@interface B : A
+@end
+
+int main(int argc, char **argv) {
+ B *b = [B new];
+ A *a = b;
+
+ return (b == a);
+}
+
diff --git a/gcc/testsuite/obj-c++.dg/cxx-class-1.mm b/gcc/testsuite/obj-c++.dg/cxx-class-1.mm
new file mode 100644
index 00000000000..0c63e70d9ce
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/cxx-class-1.mm
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test that Objective-C++ is able to chew through a simple C++ class hierarchy.
+ This was broken in earlier ObjC++ incarnations. */
+
+struct foo
+{
+ foo(void *a) {};
+};
+
+struct bar : foo
+{
+ bar() : foo((char*)0) {};
+};
+
+class apple : foo
+{
+public:
+ apple() : foo(0) { };
+};
+
diff --git a/gcc/testsuite/obj-c++.dg/cxx-ivars-1.mm b/gcc/testsuite/obj-c++.dg/cxx-ivars-1.mm
new file mode 100644
index 00000000000..001bf4b8613
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/cxx-ivars-1.mm
@@ -0,0 +1,42 @@
+// APPLE LOCAL file Objective-C++
+// Check if ivars may be accessed via the C++ dot notation.
+// { dg-do run }
+// { dg-options "-fno-objc-call-cxx-cdtors" }
+
+#include <objc/Object.h>
+#include <stdlib.h>
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+struct cxx_struct {
+ int a, b;
+ void set_values (int _a, int _b = 3) {
+ a = _a; b = _b;
+ }
+ ~cxx_struct (void) {
+ a = b = 99;
+ }
+};
+
+@interface Manip : Object {
+ int c;
+ cxx_struct s; // { dg-warning "user-defined destructor" }
+ // { dg-warning "constructors and destructors will not be invoked" "" { target *-*-* } 22 }
+}
+- (void) manipulate_ivars;
+@end
+
+@implementation Manip
+- (void) manipulate_ivars {
+ s.set_values (7);
+ CHECK_IF (s.a == 7 && s.b == 3);
+ s.~cxx_struct();
+ CHECK_IF (s.a == 99 && s.b == 99);
+}
+@end
+
+int main (void)
+{
+ Manip *obj = [Manip new];
+ [obj manipulate_ivars];
+ [obj free];
+}
diff --git a/gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm b/gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm
new file mode 100644
index 00000000000..87b4332f040
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/cxx-ivars-2.mm
@@ -0,0 +1,77 @@
+// APPLE LOCAL file Objective-C++
+// Check if the '- .cxx_construct' and '-.cxx_destruct' methods get called
+// and if they perform their desired function.
+// { dg-do run }
+// { dg-options "-fobjc-call-cxx-cdtors" }
+
+#include <objc/Object.h>
+#include <stdlib.h>
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+static int ctor1_called, ctor2_called, dtor1_called;
+
+struct bar {
+ int a, b;
+ bar(void) {
+ a = 5; b = 6;
+ ctor1_called++;
+ }
+ ~bar(void) {
+ a = b = 99;
+ dtor1_called++;
+ }
+};
+
+struct boo: bar {
+ int c;
+ boo(int _c = 9): c(_c) {
+ ctor2_called++;
+ }
+};
+
+@interface Baz: Object {
+@public
+ bar aa;
+}
+@end
+
+@implementation Baz
+@end
+
+@interface Foo: Baz {
+@public
+ int a;
+ boo bb;
+ bar b;
+ float c;
+ bar d;
+}
+@end
+
+@implementation Foo
+@end
+
+int main (void)
+{
+ CHECK_IF(!ctor1_called && !ctor2_called && !dtor1_called); /* are we sane? */
+
+ Baz *baz = [Baz new];
+ CHECK_IF(ctor1_called && !ctor2_called && !dtor1_called);
+ CHECK_IF(baz->aa.a == 5 && baz->aa.b == 6);
+ ctor1_called = 0; /* reset */
+
+ [baz free];
+ CHECK_IF(!ctor1_called && !ctor2_called && dtor1_called);
+ dtor1_called = 0; /* reset */
+
+ Foo *foo = [Foo new];
+ CHECK_IF(ctor1_called && ctor2_called && !dtor1_called);
+ CHECK_IF(foo->bb.a == 5 && foo->bb.b == 6 && foo->bb.c == 9);
+ CHECK_IF(foo->b.a == 5 && foo->b.b == 6);
+ CHECK_IF(foo->d.a == 5 && foo->d.b == 6);
+ ctor1_called = ctor2_called = 0; /* reset */
+
+ [foo free];
+ CHECK_IF(!ctor1_called && !ctor2_called && dtor1_called);
+
+}
diff --git a/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm b/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm
new file mode 100644
index 00000000000..2ace2ed000f
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/cxx-ivars-3.mm
@@ -0,0 +1,46 @@
+// APPLE LOCAL file Objective-C++
+// Check if ObjC classes with non-POD C++ ivars are specially marked in the metadata.
+// { dg-do run { target *-*-darwin* } }
+// { dg-options "-fobjc-call-cxx-cdtors -fnext-runtime" }
+
+#include <objc/objc-runtime.h>
+#include <stdlib.h>
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+#ifndef CLS_HAS_CXX_STRUCTORS
+#define CLS_HAS_CXX_STRUCTORS 0x2000L
+#endif
+
+struct cxx_struct {
+ int a, b;
+ cxx_struct (void) { a = b = 55; }
+};
+
+@interface Foo {
+ int c;
+ cxx_struct s;
+}
+@end
+
+@interface Bar: Foo {
+ float f;
+}
+@end
+
+@implementation Foo
+@end
+
+@implementation Bar
+@end
+
+int main (void)
+{
+ Class cls;
+
+ cls = objc_getClass("Foo");
+ CHECK_IF(cls->info & CLS_HAS_CXX_STRUCTORS);
+ cls = objc_getClass("Bar");
+ CHECK_IF(!(cls->info & CLS_HAS_CXX_STRUCTORS));
+
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/cxx-scope-1.mm b/gcc/testsuite/obj-c++.dg/cxx-scope-1.mm
new file mode 100644
index 00000000000..ccd97d1f47d
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/cxx-scope-1.mm
@@ -0,0 +1,54 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Handle C++ scoping ('::') operators in ObjC message receivers gracefully. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdlib.h>
+
+@class Derived;
+
+Derived *inst[3];
+
+struct CxxClass {
+ static Derived *get_instance(int);
+};
+
+Derived *CxxClass::get_instance(int offs) {
+ return inst[offs];
+}
+
+@interface Derived: Object {
+ int value;
+}
+-(id)initWithValue:(int)val;
+-(int)derived_meth;
+@end
+
+@implementation Derived
+-(id)initWithValue:(int)val {
+ [super init];
+ value = val;
+ return self;
+}
+- (int)derived_meth {
+ return value;
+}
+@end
+
+int main(void) {
+ int r;
+ inst[1] = [[::Derived alloc] initWithValue:7];
+ inst[2] = [[Derived alloc] initWithValue:77];
+
+ r = [CxxClass::get_instance(2) derived_meth];
+ if (r != 77)
+ abort();
+
+ r = [CxxClass::get_instance(1) derived_meth];
+ if (r != 7)
+ abort();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/obj-c++.dg/cxx-scope-2.mm b/gcc/testsuite/obj-c++.dg/cxx-scope-2.mm
new file mode 100644
index 00000000000..69aca20fb56
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/cxx-scope-2.mm
@@ -0,0 +1,21 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Make sure Objective-C++ can distinguish ObjC classes from C++ classes. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+#include <iostream>
+#include <string>
+
+@interface iostream: Object
+@end
+
+int main(void) {
+ id i = [std::iostream new]; /* { dg-warning "not an Objective\\-C class name or alias" } */
+ i = [iostream new];
+ i = [std::basic_string<char> new]; /* { dg-warning "not an Objective\\-C class name or alias" } */
+
+ return 0;
+}
+
+
diff --git a/gcc/testsuite/obj-c++.dg/defs.mm b/gcc/testsuite/obj-c++.dg/defs.mm
new file mode 100644
index 00000000000..f7f67f10e37
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/defs.mm
@@ -0,0 +1,44 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Check @defs() in Objective-C++ */
+/* Contributed by Devang Patel <dpatel@apple.com> */
+/* { dg-options "-lobjc" } */
+/* { dg-do run } */
+
+
+#include <stdlib.h>
+#include <objc/objc.h>
+#include <objc/Object.h>
+
+extern void abort(void);
+
+@interface A : Object
+{
+ @public
+ int a;
+}
+@end
+
+struct A_defs
+{
+ @defs(A);
+};
+
+@implementation A
+- init
+{
+ a = 42;
+ return self;
+}
+@end
+
+
+int main()
+{
+ A *a = [A init];
+ struct A_defs *a_defs = (struct A_defs *)a;
+
+ if (a->a != a_defs->a)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/dg.exp b/gcc/testsuite/obj-c++.dg/dg.exp
new file mode 100644
index 00000000000..1774e29868b
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/dg.exp
@@ -0,0 +1,38 @@
+# APPLE LOCAL file Objective-C++
+# GCC Objective-C++ testsuite that uses the `dg.exp' driver.
+# Copyright (C) 2004 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Load support procs.
+load_lib obj-c++-dg.exp
+
+# If a testcase doesn't have special options, use these.
+global DEFAULT_OBJCXXFLAGS
+if ![info exists DEFAULT_OBJCXXFLAGS] then {
+ set DEFAULT_OBJCXXFLAGS " -ansi -pedantic-errors -Wno-long-long"
+}
+
+# Initialize `dg'.
+dg-init
+
+# Gather a list of all tests.
+set tests [lsort [find $srcdir/$subdir *.mm]]
+
+# Main loop.
+dg-runtest $tests "" $DEFAULT_OBJCXXFLAGS
+
+# All done.
+dg-finish
diff --git a/gcc/testsuite/obj-c++.dg/empty-private-1.mm b/gcc/testsuite/obj-c++.dg/empty-private-1.mm
new file mode 100644
index 00000000000..9a218539fa6
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/empty-private-1.mm
@@ -0,0 +1,9 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test for no entry after @private token. */
+/* { do-do compile } */
+
+@interface foo
+{
+@private
+}
+@end
diff --git a/gcc/testsuite/obj-c++.dg/encode-1.mm b/gcc/testsuite/obj-c++.dg/encode-1.mm
new file mode 100644
index 00000000000..d23dc6cf399
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/encode-1.mm
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test for graceful encoding of const-qualified fields and parameters. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+struct Cxx {
+ const struct Cxx *next;
+};
+
+@interface ObjC {
+ const struct Cxx *obj;
+}
+- (ObjC *)initWithCxx: (struct Cxx *const)c and: (const struct Cxx *)d;
+@end
+
+@implementation ObjC
+- (ObjC *)initWithCxx: (struct Cxx *const)c and: (const struct Cxx *)d {
+ obj = d;
+ return self;
+}
+@end
+
+/* { dg-final { scan-assembler "@\[0-9\]+@0:\[0-9\]+r\\^{Cxx=\\^r{Cxx}}\[0-9\]+\\^r{Cxx}" } } */
diff --git a/gcc/testsuite/obj-c++.dg/encode-2.mm b/gcc/testsuite/obj-c++.dg/encode-2.mm
new file mode 100644
index 00000000000..3661ea35cfa
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/encode-2.mm
@@ -0,0 +1,16 @@
+/* APPLE LOCAL file Objective-C++ */
+/* { dg-do compile } */
+
+template <class T>
+struct Vec {
+ T x, y;
+ int z;
+};
+
+Vec<double> dd;
+const char *enc = @encode(Vec<float>);
+const char *enc2 = @encode(Vec<double>);
+
+/* { dg-final { scan-assembler "{Vec<float>=ffi}" } } */
+/* { dg-final { scan-assembler "{Vec<double>=ddi}" } } */
+
diff --git a/gcc/testsuite/obj-c++.dg/extern-c-1.mm b/gcc/testsuite/obj-c++.dg/extern-c-1.mm
new file mode 100644
index 00000000000..ffb95f0bb67
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/extern-c-1.mm
@@ -0,0 +1,19 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test extern c support inside @implementation */
+/* Devang Patel <dpatel@apple.com>. */
+#include <objc/objc.h>
+
+@interface Extern
+@end
+
+@implementation Extern
+
+extern "C" void NSRegisterElement(id element);
+
+- init {
+ NSRegisterElement(self);
+ return self;
+}
+
+@end
+
diff --git a/gcc/testsuite/obj-c++.dg/extra-semi.mm b/gcc/testsuite/obj-c++.dg/extra-semi.mm
new file mode 100644
index 00000000000..96d31b806d0
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/extra-semi.mm
@@ -0,0 +1,10 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Allow extra semicolons in between method declarations,
+ for old times' sake. */
+/* { dg-do compile } */
+
+@interface Foo
+ -(Foo *) expiration;
+ -(void) setExpiration:(Foo *) date;;
+ -(int) getVersion;
+@end
diff --git a/gcc/testsuite/obj-c++.dg/isa-field-1.mm b/gcc/testsuite/obj-c++.dg/isa-field-1.mm
new file mode 100644
index 00000000000..7afbafe7508
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/isa-field-1.mm
@@ -0,0 +1,44 @@
+/* APPLE LOCAL file Objective-C */
+/* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects. */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@interface Object (Test)
+- (Class) test1: (id)object;
+@end
+
+@interface Derived: Object
+- (Class) test2: (id)object;
+@end
+
+@implementation Object (Test)
+
+Class test1(id object) {
+ Class cls = object->isa;
+ return cls;
+}
+- (Class) test1: (id)object {
+ Class cls = object->isa;
+ return cls;
+}
+
+@end
+
+@implementation Derived
+
+Class test2(id object) {
+ Class cls = object->isa;
+ return cls;
+}
+- (Class) test2: (id)object {
+ Class cls = object->isa;
+ return cls;
+}
+
+@end
+
+Class test3(id object) {
+ Class cls = object->isa;
+ return cls;
+}
diff --git a/gcc/testsuite/obj-c++.dg/ivar-list-semi.mm b/gcc/testsuite/obj-c++.dg/ivar-list-semi.mm
new file mode 100644
index 00000000000..bac65a4be10
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/ivar-list-semi.mm
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Allow for an optional semicolon following the ivar block. */
+/* Contributed by: Ziemowit Laski <zlaski@apple.com>. */
+
+#include <objc/Object.h>
+
+@interface Tink : Object {
+@private
+ unsigned long mCode[4];
+};
+- (id)initWithProc:(void *)inProc;
+- (void *)getUniqueProc;
+@end
diff --git a/gcc/testsuite/obj-c++.dg/local-decl-1.mm b/gcc/testsuite/obj-c++.dg/local-decl-1.mm
new file mode 100644
index 00000000000..4e0b6e7532a
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/local-decl-1.mm
@@ -0,0 +1,43 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test for ivar access inside of class methods. It should be allowed (with a warning), but only
+ if no other declarations with the same name are seen. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@interface Sprite: Object {
+ int sprite, spree;
+}
++ (void)setFoo:(int)foo;
++ (void)setSprite:(int)sprite;
+- (void)setFoo:(int)foo;
+- (void)setSprite:(int)sprite;
+@end
+
+int spree = 23;
+
+@implementation Sprite
++ (void)setFoo:(int)foo {
+ sprite = foo; /* { dg-warning "instance variable .sprite. accessed in class method" } */
+ spree = foo;
+}
++ (void)setSprite:(int)sprite {
+ int spree;
+ sprite = 15;
+ spree = 17;
+ ((Sprite *)self)->sprite = 16; /* NB: This is how one _should_ access */
+ ((Sprite *)self)->spree = 18; /* ivars from within class methods! */
+}
+- (void)setFoo:(int)foo {
+ sprite = foo;
+ spree = foo;
+}
+- (void)setSprite:(int)sprite {
+ int spree;
+ sprite = 15; /* { dg-warning "local declaration of .sprite. hides instance variable" } */
+ self->sprite = 16;
+ spree = 17; /* { dg-warning "local declaration of .spree. hides instance variable" } */
+ self->spree = 18;
+}
+@end
diff --git a/gcc/testsuite/obj-c++.dg/lookup-1.mm b/gcc/testsuite/obj-c++.dg/lookup-1.mm
new file mode 100644
index 00000000000..075b76fb33c
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/lookup-1.mm
@@ -0,0 +1,9 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Simple test to check Objectivec-C++ qualified type lookup. */
+/* Devang Patel <dpatel@apple.com>. */
+
+@interface A
+{
+ A *ap;
+}
+@end
diff --git a/gcc/testsuite/obj-c++.dg/lookup-2.mm b/gcc/testsuite/obj-c++.dg/lookup-2.mm
new file mode 100644
index 00000000000..62e348a7034
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/lookup-2.mm
@@ -0,0 +1,57 @@
+/* APPLE LOCAL file Objective-C++ */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdlib.h>
+
+class MyWidget {
+ public:
+ int a;
+ MyWidget(void) { a = 17; }
+};
+
+MyWidget gWidget;
+
+@protocol MyProto
+- (MyWidget *)widget;
+@end
+
+@interface Foo: Object
+@end
+
+@interface Bar: Foo <MyProto>
+@end
+
+@interface Container: Object
++ (MyWidget *)elementForView:(Foo *)view;
+@end
+
+@implementation Foo
+@end
+
+@implementation Bar
+- (MyWidget *)widget {
+ return &gWidget;
+}
+@end
+
+@implementation Container
++ (MyWidget *)elementForView:(Foo *)view
+{
+ MyWidget *widget = nil;
+ if ([view conformsTo:@protocol(MyProto)]) {
+ widget = [(Foo <MyProto> *)view widget];
+ }
+ return widget;
+}
+@end
+
+int main(void) {
+ id view = [Bar new];
+ MyWidget *w = [Container elementForView: view];
+
+ if (!w || w->a != 17)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm b/gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm
new file mode 100644
index 00000000000..f2575efc631
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/lvalue-cast-1.mm
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file non lvalue assign */
+/* { dg-do compile } */
+/* { dg-options "-fnon-lvalue-assign" } */
+
+#include <objc/Object.h>
+
+typedef struct _NSPoint {
+ float x;
+ float y;
+} NSPoint;
+typedef NSPoint *NSPointPointer;
+typedef NSPoint *NSPointArray;
+typedef struct _NSSize {
+ float width;
+ float height;
+} NSSize;
+typedef struct _NSRect {
+ NSPoint origin;
+ NSSize size;
+} NSRect;
+
+@interface NSLayoutManager: Object {
+ NSRect *_cachedRectArray;
+}
+- (void)_growCachedRectArrayToSize:(unsigned)newSize;
+@end
+
+@implementation NSLayoutManager
+- (void)_growCachedRectArrayToSize:(unsigned)newSize {
+ ( NSRect *)_cachedRectArray = nil; /* { dg-warning "target of assignment not really an lvalue" } */
+}
+@end
diff --git a/gcc/testsuite/obj-c++.dg/method-1.mm b/gcc/testsuite/obj-c++.dg/method-1.mm
new file mode 100644
index 00000000000..d9b0333a39e
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/method-1.mm
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test whether casting 'id' to a specific class removes method lookup
+ ambiguity. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+#include <objc/objc.h>
+
+@class Int1, Int2;
+
+@interface Int1
++ (Int1 *)classMethod1;
++ (id)classMethod2;
+- (Int1 *)instanceMethod:(Int2 *)arg; /* { dg-bogus "using" } */
+@end
+
+@interface Int2: Int1
++ (Int1 *)classMethod1;
++ (id)classMethod2;
+- (id)int2Method;
+- (int)instanceMethod:(int)arg; /* { dg-bogus "also found" } */
+@end
+
+int main(void) {
+ id i = [(Int2 *)[Int1 classMethod1] int2Method]; /* { dg-bogus "may not respond to" } */
+ int j = [(Int2 *)[Int2 classMethod2] instanceMethod: 45]; /* { dg-bogus "multiple methods" } */
+ /* { dg-bogus "invalid conversion" "" { target *-*-* } 25 } */
+ /* { dg-bogus "invalid conversion" "" { target *-*-* } 25 } */
+ return j;
+}
diff --git a/gcc/testsuite/obj-c++.dg/method-2.mm b/gcc/testsuite/obj-c++.dg/method-2.mm
new file mode 100644
index 00000000000..1a9a0d400f2
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/method-2.mm
@@ -0,0 +1,56 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test if prior method lookup at method @implementation time is not
+ overly aggressive, leading to methods being found in other classes. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@class NSString;
+
+@protocol NSMenuItem
++ (void)setUsesUserKeyEquivalents:(BOOL)flag;
++ (BOOL)usesUserKeyEquivalents;
+@end
+
+@interface NSMenuItem : Object <NSMenuItem> {
+ @private
+ id _menu;
+}
+@end
+
+@interface NSResponder : Object <NSMenuItem>
+{
+ id _nextResponder;
+}
+@end
+
+@interface Object(NSMenuValidation)
+- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem;
+@end
+
+@interface NSResponder (NSStandardKeyBindingMethods)
+- (void)insertText:(id)insertString;
+- (void)doCommandBySelector:(SEL)aSelector;
+@end
+
+@interface NSView : NSResponder
+{
+ id _superview;
+ id _subviews;
+}
+@end
+
+@interface SKTGraphicView : NSView {
+ @private
+ float _gridSpacing;
+}
+@end
+
+@implementation SKTGraphicView
+- (BOOL)validateMenuItem:(NSMenuItem *)item {
+ return (BOOL)1;
+}
+- (void)insertText:(NSString *)str {
+}
+@end
diff --git a/gcc/testsuite/obj-c++.dg/method-3.mm b/gcc/testsuite/obj-c++.dg/method-3.mm
new file mode 100644
index 00000000000..d5df1cf4bf7
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/method-3.mm
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file Objective-C */
+/* Do not warn about "slightly" mismatched method signatures if
+ -Wstrict-selector-match is off. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-strict-selector-match" } */
+
+#include <objc/objc.h>
+
+@interface Base
+- (id) meth1: (Base *)arg1;
+- (id) window;
+@end
+
+@interface Derived: Base
+- (id) meth1: (Derived *)arg1;
+- (Base *) window;
+@end
+
+void foo(void) {
+ id r;
+
+ [r meth1:r];
+ [r window];
+}
diff --git a/gcc/testsuite/obj-c++.dg/method-4.mm b/gcc/testsuite/obj-c++.dg/method-4.mm
new file mode 100644
index 00000000000..1845c430920
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/method-4.mm
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file Objective-C */
+/* Warn about "slightly" mismatched method signatures if
+ -Wstrict-selector-match is on. */
+/* { dg-do compile } */
+/* { dg-options "-Wstrict-selector-match" } */
+
+#include <objc/objc.h>
+
+@interface Base
+- (id) meth1: (Base *)arg1; /* { dg-warning "using .\\-\\(id\\)meth1:\\(Base \\*\\)arg1." } */
+- (id) window; /* { dg-warning "using .\\-\\(id\\)window" } */
+@end
+
+@interface Derived: Base
+- (id) meth1: (Derived *)arg1; /* { dg-warning "also found .\\-\\(id\\)meth1:\\(Derived \\*\\)arg1." } */
+- (Base *) window; /* { dg-warning "also found .\\-\\(Base \\*\\)window." } */
+@end
+
+void foo(void) {
+ id r;
+
+ [r meth1:r]; /* { dg-warning "multiple methods named .\\-meth1:. found" } */
+ [r window]; /* { dg-warning "multiple methods named .\\-window. found" } */
+}
diff --git a/gcc/testsuite/obj-c++.dg/method-5.mm b/gcc/testsuite/obj-c++.dg/method-5.mm
new file mode 100644
index 00000000000..12e79a181f7
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/method-5.mm
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file Objective-C */
+/* Do not warn about "slightly" mismatched method signatures if
+ -Wstrict-selector-match is off. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-strict-selector-match" } */
+
+#include <objc/objc.h>
+
+typedef enum { en1_1, en1_2 } En1;
+typedef enum { en2_1, en2_2 } En2;
+typedef struct { int a, b; } St1;
+typedef struct { unsigned a, b; } St2;
+
+@interface Base
+- (id) meth1: (En1)arg1;
+- (St1) window;
+@end
+
+@interface Derived: Base
+- (id) meth1: (En2)arg1;
+- (St2)window;
+@end
+
+void foo(void) {
+ id r;
+ En1 en;
+
+ [r meth1:en];
+ [r window];
+}
diff --git a/gcc/testsuite/obj-c++.dg/no-extra-load.mm b/gcc/testsuite/obj-c++.dg/no-extra-load.mm
new file mode 100644
index 00000000000..fb9396cca21
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/no-extra-load.mm
@@ -0,0 +1,23 @@
+// APPLE LOCAL file Objective-C++
+// Radar 3926484
+// { dg-do compile }
+
+#include <objc/Object.h>
+#include <iostream>
+
+@interface Greeter : Object
+- (void) greet: (const char *)msg;
+@end
+
+@implementation Greeter
+- (void) greet: (const char *)msg { std::cout << msg; }
+@end
+
+int
+main ()
+{
+ std::cout << "Hello from C++\n";
+ Greeter *obj = [Greeter new];
+ [obj greet: "Hello from Objective-C\n"];
+}
+/* { dg-final { scan-assembler-not "L_objc_msgSend\\\$non_lazy_ptr" } } */
diff --git a/gcc/testsuite/obj-c++.dg/objc-fast-1.mm b/gcc/testsuite/obj-c++.dg/objc-fast-1.mm
new file mode 100644
index 00000000000..6db7c38beec
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/objc-fast-1.mm
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file ObjC direct dispatch */
+/* A compile-only test for insertion of 'bla' comm page jumps. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wassign-intercept" } */
+
+#include <objc/Object.h>
+
+@interface Derived: Object {
+@public
+ Object *other;
+}
+@end
+
+void foo(void) {
+ Derived *o = [Derived new];
+ o->other = 0; /* { dg-warning "instance variable assignment has been intercepted" } */
+}
+
+/* { dg-final { scan-assembler-not "objc_msgSend" } } */
+/* { dg-final { scan-assembler-not "objc_assign_ivar" } } */
+
+/* { dg-final { scan-assembler "bla.*fffeff00" } } */
+/* { dg-final { scan-assembler "bla.*fffefec0" } } */
diff --git a/gcc/testsuite/obj-c++.dg/objc-fast-2.mm b/gcc/testsuite/obj-c++.dg/objc-fast-2.mm
new file mode 100644
index 00000000000..61e97adad3a
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/objc-fast-2.mm
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file ObjC direct dispatch */
+/* A compile-only test for insertion of 'ba' sibcall comm page jumps. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wno-assign-intercept -O2" } */
+
+#include <objc/Object.h>
+
+@interface Derived: Object {
+@public
+ Object *other;
+}
+@end
+
+void foo(void) {
+ Derived *o;
+ o->other = 0; /* sibcall to objc_assign_ivar_Fast() */
+}
+
+void bar(void) {
+ Derived *o = nil;
+ [Derived new]; /* sibcall to objc_msgSend_Fast() */
+}
+
+/* { dg-final { scan-assembler-not "objc_msgSend" } } */
+/* { dg-final { scan-assembler-not "objc_assign_ivar" } } */
+
+/* { dg-final { scan-assembler "ba.*fffeff00" } } */
+/* { dg-final { scan-assembler "ba.*fffefec0" } } */
diff --git a/gcc/testsuite/obj-c++.dg/objc-fast-3.mm b/gcc/testsuite/obj-c++.dg/objc-fast-3.mm
new file mode 100644
index 00000000000..fc57f831eef
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/objc-fast-3.mm
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file ObjC direct dispatch */
+/* A compile-only test for insertion of 'bla' and 'ba' sibcall comm page jumps
+ for methods returning 'void'. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wno-assign-intercept -O2" } */
+
+#include <objc/Object.h>
+
+@interface Derived: Object {
+@public
+ Object *other;
+}
+- (void) do_nothing;
+@end
+
+int a;
+
+void foo(void) {
+ Derived *o;
+ [o do_nothing]; /* objc_msgSend_Fast() */
+ a = 2;
+}
+
+void bar(void) {
+ Derived *o = nil;
+ [o do_nothing]; /* sibcall to objc_msgSend_Fast() */
+}
+
+/* { dg-final { scan-assembler-not "objc_msgSend" } } */
+
+/* { dg-final { scan-assembler "bla.*fffeff00" } } */
+/* { dg-final { scan-assembler "ba.*fffeff00" } } */
diff --git a/gcc/testsuite/obj-c++.dg/objc-fast-4.mm b/gcc/testsuite/obj-c++.dg/objc-fast-4.mm
new file mode 100644
index 00000000000..67e8a998bc4
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/objc-fast-4.mm
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file ObjC direct dispatch */
+/* Check that 4015820 is fixed. That does not appear except
+ with -O0, so the sibcall case cannot occur. */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-O0 -fobjc-direct-dispatch" } */
+#include <objc/Object.h>
+
+void foo(void) {
+ Object *o;
+ [o++ free];
+}
+/* { dg-final { scan-assembler-not "objc_msgSend" } } */
+/* { dg-final { scan-assembler "bla.*fffeff00" } } */
diff --git a/gcc/testsuite/obj-c++.dg/objc-gc-1.mm b/gcc/testsuite/obj-c++.dg/objc-gc-1.mm
new file mode 100644
index 00000000000..fc63e54b2eb
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/objc-gc-1.mm
@@ -0,0 +1,145 @@
+/* APPLE LOCAL file ObjC GC */
+/* A compile-only test for insertion of write barriers. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc -Wassign-intercept" } */
+
+#ifndef __OBJC_GC__
+#error Missing __OBJC_GC__ manifest constant
+#endif
+
+#include <objc/Object.h>
+
+@class Underspecified;
+@class MyClass;
+
+@interface AnotherClass: Object {
+@public
+ __strong void *storage;
+ MyClass *SomeObj;
+}
+- (id)assignObj:(id)obj;
+@end
+
+struct Struct1 {
+ MyClass *someobj;
+ void *obj2;
+ __strong void *obj3;
+};
+
+struct Struct1 *str1a, str1aa;
+__strong struct Struct1 *str1b, str1bb, **str1c, *str1d[3][3];
+
+extern MyClass *externFunc(void);
+
+@interface MyClass: Object {
+@public
+ id ivar1, *ivar1a;
+ void *ivar2;
+ __strong void *ivar3;
+ Underspecified *ivar4[2], **ivar4a;
+ union {
+ struct {
+ Underspecified *data;
+ const unsigned char *dataBytes;
+ } d;
+ struct {
+ __strong void *storage;
+ AnotherClass *another;
+ } s;
+ } contents;
+ struct {
+ struct {
+ void *yy;
+ } z;
+ } y;
+}
+@end
+
+@implementation AnotherClass
+- (id)assignObj:(id)obj {
+ static MyClass *m_myclass;
+ static id *indirect;
+ str1a = 0;
+ str1b = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1c = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1d[1][1] = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1a->someobj = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ str1b->someobj = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ str1aa.someobj = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1bb.someobj = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1a->obj2 = 0;
+ str1b->obj2 = 0;
+ str1a->obj3 = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ str1b->obj3 = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ SomeObj->contents.s.another = 0; /* { dg-warning "instance variable assignment" } */
+ obj = 0;
+ externFunc()->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ externFunc()->contents.s.another->SomeObj = 0; /* { dg-warning "instance variable assignment" } */
+ m_myclass = 0; /* { dg-warning "global\\/static variable assignment" } */
+ *indirect = obj; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ (__strong id)*indirect = obj; /* { dg-warning "strong\\-cast assignment" } */
+ self = 0;
+ self->isa = 0; /* { dg-warning "instance variable assignment" } */
+ return SomeObj = obj; /* { dg-warning "instance variable assignment" } */
+}
+@end
+
+typedef MyClass MyClass1;
+@compatibility_alias MyClass2 MyClass;
+
+MyClass *g_myclass;
+MyClass1 *g_myclass1;
+MyClass2 *g_myclass2;
+MyClass2 **g_myclass2a, ***g_myclass2b;
+MyClass2 *g_myclass2c[6], *g_myclass2d[4][5];
+__strong void *g_myclass2e[3];
+
+id *g_myid, ***g_myid3;
+
+void function(void) {
+ static MyClass *l_myclass;
+ MyClass2 *l_myclass2;
+
+ g_myclass = 0; /* { dg-warning "global\\/static variable assignment" } */
+ l_myclass = 0; /* { dg-warning "global\\/static variable assignment" } */
+ g_myclass->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ *g_myclass->ivar1a = 0;
+ l_myclass2 = 0;
+ l_myclass2->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ (__strong id)*g_myclass->ivar1a = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass->ivar2 = 0;
+ (__strong void *)g_myclass->ivar2 = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass->ivar3 = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->ivar4[1] = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->ivar4a = 0;
+ *l_myclass->ivar4a = 0;
+ (__strong id)*l_myclass->ivar4a = 0; /* { dg-warning "strong\\-cast assignment" } */
+ l_myclass->contents.d.data = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->contents.d.dataBytes = 0;
+ (__strong const unsigned char *)l_myclass->contents.d.dataBytes = 0; /* { dg-warning "strong\\-cast assignment" } */
+ l_myclass->contents.s.storage = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->contents.s.another->SomeObj = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->contents.s.another->storage = 0; /* { dg-warning "instance variable assignment" } */
+ (__strong void *)l_myclass->contents.s.another->storage = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass->y.z.yy = 0;
+ (__strong void *)g_myclass->y.z.yy = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass1->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ g_myclass2->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ (*g_myclass2a)->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ *g_myid = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ ***g_myid3 = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ (__strong id)*g_myid = 0; /* { dg-warning "strong\\-cast assignment" } */
+ (__strong id)***g_myid3 = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass2[3] = g_myclass1[4];
+ g_myclass2a[1] = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ g_myclass2b[1][2] = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ g_myclass2c[1] = 0; /* { dg-warning "global\\/static variable assignment" } */
+ g_myclass2e[1] = 0; /* { dg-warning "global\\/static variable assignment" } */
+ g_myclass2d[1][2] = 0; /* { dg-warning "global\\/static variable assignment" } */
+ g_myclass2a[1]->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ g_myclass2b[1][2]->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ g_myclass2c[1]->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ g_myclass2d[1][2]->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+}
+
diff --git a/gcc/testsuite/obj-c++.dg/objc-gc-2.mm b/gcc/testsuite/obj-c++.dg/objc-gc-2.mm
new file mode 100644
index 00000000000..a85e3ba14ed
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/objc-gc-2.mm
@@ -0,0 +1,60 @@
+/* APPLE LOCAL file ObjC GC */
+/* A compile-only test for insertion of write barriers. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+/* { dg-options "-fnext-runtime -fobjc-gc -Wassign-intercept" } */
+
+#include <objc/objc.h>
+
+struct NSRect {
+ void *a;
+ id b;
+ __strong void *c;
+ __strong id *d;
+};
+
+@protocol WebCoreImageRenderer
+- (void)drawImageInRect:(NSRect)ir fromRect:(NSRect)fr;
+- (void)release;
+- (void)new;
+- (BOOL)isNull;
+- (id <WebCoreImageRenderer>)copyWithZone:(int)z;
+- (id <WebCoreImageRenderer>)retainOrCopyIfNeeded;
+@end
+
+typedef id <WebCoreImageRenderer> WebCoreImageRendererPtr;
+
+class QPixmap {
+public:
+ QPixmap() {}
+ ~QPixmap() {}
+
+ void resize(int w, int h);
+
+public:
+ WebCoreImageRendererPtr imageRenderer;
+ __strong void *somePtr;
+ mutable bool needCopyOnWrite;
+};
+
+void inline_func(void) {
+ QPixmap *pix;
+
+ pix->imageRenderer = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ pix->somePtr = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ (__strong id)pix->somePtr = 0; /* { dg-warning "strong\\-cast assignment" } */
+ (__strong id)pix->imageRenderer = 0; /* { dg-warning "strong\\-cast assignment" } */
+}
+
+void QPixmap::resize(int w, int h)
+{
+ if (needCopyOnWrite) {
+ id <WebCoreImageRenderer> newImageRenderer = [imageRenderer copyWithZone:0];
+ [imageRenderer release];
+ imageRenderer = newImageRenderer; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ somePtr = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ (__strong id)imageRenderer = newImageRenderer; /* { dg-warning "strong\\-cast assignment" } */
+ needCopyOnWrite = false;
+ }
+ [imageRenderer new];
+}
diff --git a/gcc/testsuite/obj-c++.dg/overload-1.mm b/gcc/testsuite/obj-c++.dg/overload-1.mm
new file mode 100644
index 00000000000..e7ee8a80811
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/overload-1.mm
@@ -0,0 +1,11 @@
+// APPLE LOCAL file Objective-C++
+// Make sure we can overload on ObjC classes
+// Radar 3960754
+// { dg-do compile }
+
+@class A, B;
+
+struct X {
+ void call(A*);
+ void call(B*);
+};
diff --git a/gcc/testsuite/obj-c++.dg/pascal-strings-1.mm b/gcc/testsuite/obj-c++.dg/pascal-strings-1.mm
new file mode 100644
index 00000000000..7c7cf8139ed
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/pascal-strings-1.mm
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file pascal strings */
+/* Ensure that there are no warnings or errors issued when a Pascal string is used to
+ initialize an array and the NUL terminator does not fit. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-fpascal-strings" } */
+
+typedef unsigned char Str15[16];
+
+Str15 ggg = "\p012345678901234";
+Str15 hhh = "\p0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */
+
+int foo(void)
+{
+ Str15 sss = "\p012345678901234";
+ Str15 ttt = "\p0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/pascal-strings-2.mm b/gcc/testsuite/obj-c++.dg/pascal-strings-2.mm
new file mode 100644
index 00000000000..ef336990455
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/pascal-strings-2.mm
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file pascal strings */
+/* Ensure that Pascal strings do not get confused with ordinary C strings when
+ -funsigned-char is being used. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-fpascal-strings -funsigned-char" } */
+
+typedef unsigned char Str15[16];
+
+Str15 ggg = "\p012345678901234";
+Str15 hhh = "0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */
+
+int foo(void)
+{
+ Str15 sss = "\p012345678901234";
+ Str15 ttt = "0123456789012345"; /* { dg-error "initializer.string for array of chars is too long" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/pragma-1.mm b/gcc/testsuite/obj-c++.dg/pragma-1.mm
new file mode 100644
index 00000000000..c732053ce0b
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/pragma-1.mm
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file Objective-C++ */
+/* It is OK to use #pragma inside @interface body. This test checks that. */
+/* Devang Patel <dpatel@apple.com>. */
+
+@interface A
+{
+ int p;
+}
++(int) foo;
+#pragma Mark foobar
+-(int) bar;
+@end
diff --git a/gcc/testsuite/obj-c++.dg/pragma-2.mm b/gcc/testsuite/obj-c++.dg/pragma-2.mm
new file mode 100644
index 00000000000..b086863a997
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/pragma-2.mm
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file Objective-C++ */
+/* It is OK to use #pragma inside @implementation body. This test checks that. */
+/* Ziemowit Laski <zlaski@apple.com>. */
+
+@interface A
+{
+ int p;
+}
++(int) foo;
+-(int) bar;
+@end
+
+@implementation A
+#pragma mark -
+#pragma mark init / dealloc
++ (int)foo {
+ return 1;
+}
+#pragma mark -
+#pragma mark Private Functions
+- (int)bar {
+ return 2;
+}
+@end
diff --git a/gcc/testsuite/obj-c++.dg/private-1.mm b/gcc/testsuite/obj-c++.dg/private-1.mm
new file mode 100644
index 00000000000..9662f7f9901
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/private-1.mm
@@ -0,0 +1,59 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test errors for accessing @private and @protected variables. */
+/* Based on work by: Nicola Pero <nicola@brainstorm.co.uk>. */
+/* { dg-do compile } */
+#include <objc/objc.h>
+
+@interface MySuperClass
+{
+@private
+ int _private;
+
+@protected
+ int _protected;
+
+@public
+ int _public;
+}
+- (void) test;
+@end
+
+@implementation MySuperClass
+- (void) test
+{
+ _private = 12; /* Ok */
+ _protected = 12; /* Ok */
+ _public = 12; /* Ok */
+}
+@end
+
+
+@interface MyClass : MySuperClass
+@end
+
+@implementation MyClass
+- (void) test
+{
+ /* Private variables simply don't exist in the subclass. */
+ _private = 12; /* { dg-error "._private. was not declared in this scope" } */
+
+ _protected = 12; /* Ok */
+ _public = 12; /* Ok */
+}
+@end
+
+int main (void)
+{
+ MyClass *m = nil;
+
+ if (m != nil)
+ {
+ int access;
+
+ access = m->_private; /* { dg-error "is @private" } */
+ access = m->_protected; /* { dg-error "is @protected" } */
+ access = m->_public; /* Ok */
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/private-2.mm b/gcc/testsuite/obj-c++.dg/private-2.mm
new file mode 100644
index 00000000000..c8f30ac7b9c
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/private-2.mm
@@ -0,0 +1,55 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test warnings for shadowing instance variables. */
+/* Based on work by: Nicola Pero <nicola@brainstorm.co.uk>. */
+/* { dg-do compile } */
+#include <objc/objc.h>
+
+@interface MySuperClass
+{
+@private
+ int _private;
+
+@protected
+ int _protected;
+
+@public
+ int _public;
+}
+- (void) test;
+@end
+
+@implementation MySuperClass
+- (void) test
+{
+ /* FIXME: I wonder if the warnings shouldn't be better generated
+ when the variable is declared, rather than used! */
+ int _private = 12;
+ int _protected = 12;
+ int _public = 12;
+ int a;
+
+ a = _private; /* { dg-warning "hides instance variable" } */
+ a = _protected; /* { dg-warning "hides instance variable" } */
+ a = _public; /* { dg-warning "hides instance variable" } */
+}
+@end
+
+
+@interface MyClass : MySuperClass
+@end
+
+@implementation MyClass
+- (void) test
+{
+ int _private = 12;
+ int _protected = 12;
+ int _public = 12;
+ int a;
+
+ /* The private variable can be shadowed without warnings, because
+ * it's invisible, and not accessible, to the subclass! */
+ a = _private; /* Ok */
+ a = _protected; /* { dg-warning "hides instance variable" } */
+ a = _public; /* { dg-warning "hides instance variable" } */
+}
+@end
diff --git a/gcc/testsuite/obj-c++.dg/proto-qual-1.mm b/gcc/testsuite/obj-c++.dg/proto-qual-1.mm
new file mode 100644
index 00000000000..68133aa4bc6
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/proto-qual-1.mm
@@ -0,0 +1,52 @@
+// APPLE LOCAL file Objective-C++
+/* Check that protocol qualifiers are compiled and encoded properly. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do run } */
+
+#include <objc/Protocol.h>
+#ifndef __NEXT_RUNTIME__
+#include <objc/objc-api.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+
+/* The encoded parameter sizes will be rounded up to match pointer alignment. */
+#define ROUND(s,a) (a * ((s + a - 1) / a))
+#define aligned_sizeof(T) ROUND(sizeof(T),__alignof(void *))
+
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@protocol Retain
++ (oneway void)retainArgument:(out bycopy id)arg1 with:(in signed char **)arg2;
+- (bycopy) address:(byref inout id)location with:(out short unsigned **)arg2;
+@end
+
+@interface Foo <Retain>
++ (oneway void)retainArgument:(out bycopy id)arg with:(in signed char **)arg2;
+@end
+
+@implementation Foo
++ (oneway void)retainArgument:(out bycopy id)arg1 with:(in signed char **)arg2 { }
+- (bycopy) address:(byref inout id)location with:(out short unsigned **)arg2 { return nil; }
+@end
+
+Protocol *proto = @protocol(Retain);
+struct objc_method_description *meth;
+unsigned totsize, offs0, offs1, offs2, offs3, offs4, offs5, offs6, offs7;
+
+static void scan_initial(const char *pattern) {
+ totsize = offs0 = offs1 = offs2 = offs3 = offs4 = offs5 = offs6 = offs7 = (unsigned)-1;
+ sscanf(meth->types, pattern, &totsize, &offs0, &offs1, &offs2, &offs3,
+ &offs4, &offs5, &offs6, &offs7);
+ CHECK_IF(!offs0 && offs1 == aligned_sizeof(id) && offs2 == offs1 + aligned_sizeof(SEL) && totsize >= offs2);
+}
+
+int main(void) {
+ meth = [proto descriptionForInstanceMethod: @selector(address:with:)];
+ scan_initial("O@%u@%u:%uNR@%uo^^S%u");
+ CHECK_IF(offs3 == offs2 + aligned_sizeof(id) && totsize == offs3 + aligned_sizeof(unsigned));
+ meth = [proto descriptionForClassMethod: @selector(retainArgument:with:)];
+ scan_initial("Vv%u@%u:%uOo@%un^*%u");
+ CHECK_IF(offs3 == offs2 + aligned_sizeof(id) && totsize == offs3 + aligned_sizeof(char **));
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/qual-types-1.mm b/gcc/testsuite/obj-c++.dg/qual-types-1.mm
new file mode 100644
index 00000000000..37da232ccbb
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/qual-types-1.mm
@@ -0,0 +1,72 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test if ObjC++ can distinguish protocol qualifiers from
+ template arguments. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdlib.h>
+
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@protocol Zone
++ allocFromZone:(void *)zone;
+- copyFromZone:(void *)zone;
+@end
+
+@protocol Init <Zone>
++ initialize;
+- init;
+@end
+
+@interface Foo: Object
+{ @public int val; }
+- init;
+@end
+
+template <class T, class U> struct X {
+ T x; U y;
+};
+
+X<int, float> xx;
+
+template <typename T> struct Holder
+{
+ T *obj;
+ static int counter;
+ Holder(void) { obj = [[T alloc] init]; }
+ ~Holder(void) { [obj free]; --counter; }
+ id <Init, Zone> getObjId(void) { return obj; }
+ Object <Zone, Init> *getObj(void) { return obj; }
+};
+
+typedef Holder <Foo <Init, Zone> > FooHolder;
+
+@implementation Foo
+-(id) init {
+ [super init];
+ val = ++FooHolder::counter;
+ return self;
+}
+@end
+
+template <typename T>
+int Holder<T>::counter = 0;
+
+int main (void) {
+ CHECK_IF(FooHolder::counter == 0);
+ {
+ FooHolder holder;
+ CHECK_IF(holder.obj->val == 1);
+ CHECK_IF(FooHolder::counter == 1);
+ FooHolder holder2;
+ CHECK_IF(holder2.obj->val == 2);
+ CHECK_IF(FooHolder::counter == 2);
+ }
+ CHECK_IF(FooHolder::counter == 0);
+ return 0;
+}
+
+
+
+
diff --git a/gcc/testsuite/obj-c++.dg/selector-1.mm b/gcc/testsuite/obj-c++.dg/selector-1.mm
new file mode 100644
index 00000000000..1786d66b398
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/selector-1.mm
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test whether including C++ keywords such as 'and', 'or',
+ 'not', etc., is allowed inside ObjC selectors (as it must be). */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+
+@interface Int1
++ (int)and_eq:(int)arg1 and:(int)arg2;
+- (int)or_eq:(int)arg1 or:(int)arg3;
+- (int)not:(int)arg1 xor:(int)arg2;
+- (void)bitand:(char)c1 bitor:(char)c2;
+- (void)compl:(float)f1 xor_eq:(double)d1;
+- (void)not_eq;
+@end
+
+@implementation Int1
++ (int)and_eq:(int)arg1 and:(int)arg2 { return arg1 + arg2; }
+- (int)or_eq:(int)arg1 or:(int)arg3 { return arg1 + arg3; }
+- (int)not:(int)arg1 xor:(int)arg2 { return arg1 + arg2; }
+- (void)bitand:(char)c1 bitor:(char)c2 { }
+- (void)compl:(float)f1 xor_eq:(double)d1 { }
+- (void)not_eq { }
+@end
+
+/* { dg-final { scan-assembler "\\+\\\[Int1 and_eq:and:\\]|c_Int1__and_eq_and" } } */
+/* { dg-final { scan-assembler "\\-\\\[Int1 or_eq:or:\\]|i_Int1__or_eq_or" } } */
+/* { dg-final { scan-assembler "\\-\\\[Int1 not:xor:\\]|i_Int1__not_xor" } } */
+/* { dg-final { scan-assembler "\\-\\\[Int1 bitand:bitor:\\]|i_Int1__bitand_bitor" } } */
+/* { dg-final { scan-assembler "\\-\\\[Int1 compl:xor_eq:\\]|i_Int1__compl_xor_eq" } } */
+/* { dg-final { scan-assembler "\\-\\\[Int1 not_eq\\]|i_Int1__not_eq" } } */
+
diff --git a/gcc/testsuite/obj-c++.dg/super-class-1.mm b/gcc/testsuite/obj-c++.dg/super-class-1.mm
new file mode 100644
index 00000000000..f594fb9056a
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/super-class-1.mm
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test calling super from within a category method. */
+/* { dg-do compile } */
+#include <objc/objc.h>
+
+@interface NSObject
+@end
+@interface NSMenuItem: NSObject
+@end
+
+@interface NSObject (Test)
++ (int) test_func;
+@end
+
+@implementation NSObject (Test)
++ (int) test_func
+{}
+@end
+
+@interface NSMenuItem (Test)
++ (int) test_func;
+@end
+
+@implementation NSMenuItem (Test)
++ (int) test_func
+{
+ return [super test_func]; /* { dg-bogus "invalid use of undefined type" } */
+} /* { dg-bogus "forward declaration of" "" { target *-*-* } 27 } */
+@end
+
diff --git a/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm b/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
new file mode 100644
index 00000000000..b87af921860
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/super-dealloc-1.mm
@@ -0,0 +1,47 @@
+/* APPLE LOCAL file ObjC super dealloc */
+/* Check for warnings about missing [super dealloc] calls. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+
+@interface Foo {
+ void *isa;
+}
+- (void) dealloc;
+- (void) some_other;
+@end
+
+@interface Bar: Foo {
+ void *casa;
+}
+- (void) dealloc;
+@end
+
+@interface Baz: Bar {
+ void *usa;
+}
+- (void) dealloc;
+@end
+
+@implementation Foo
+- (void) dealloc {
+ isa = 0; /* Should not warn here. */
+}
+- (void) some_other {
+ isa = (void *)-1;
+}
+@end
+
+@implementation Bar
+- (void) dealloc {
+ casa = 0;
+ [super some_other];
+} /* { dg-warning "method possibly missing a .super dealloc. call" } */
+@end
+
+@implementation Baz
+- (void) dealloc {
+ usa = 0;
+ [super dealloc]; /* Should not warn here. */
+}
+@end
diff --git a/gcc/testsuite/obj-c++.dg/super-dealloc-2.mm b/gcc/testsuite/obj-c++.dg/super-dealloc-2.mm
new file mode 100644
index 00000000000..52361277fe2
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/super-dealloc-2.mm
@@ -0,0 +1,47 @@
+/* APPLE LOCAL file ObjC super dealloc */
+/* Check for warnings about missing [super dealloc] calls. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+
+@interface Foo {
+ void *isa;
+}
+- (void) dealloc;
+- (void) some_other;
+@end
+
+@interface Bar: Foo {
+ void *casa;
+}
+- (void) dealloc0;
+@end
+
+@interface Baz: Bar {
+ void *usa;
+}
+- (void) dealloc;
+@end
+
+@implementation Foo
+- (void) dealloc {
+ isa = 0; /* Should not warn here. */
+}
+- (void) some_other {
+ isa = (void *)-1;
+}
+@end
+
+@implementation Bar
+- (void) dealloc0 {
+ casa = 0;
+ [super some_other]; /* Should not warn here. */
+}
+@end
+
+@implementation Baz
+- (void) dealloc {
+ usa = 0;
+ [super dealloc0];
+} /* { dg-warning "method possibly missing a .super dealloc. call" } */
+@end
diff --git a/gcc/testsuite/obj-c++.dg/template-1.mm b/gcc/testsuite/obj-c++.dg/template-1.mm
new file mode 100644
index 00000000000..e8ccfa7dd46
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/template-1.mm
@@ -0,0 +1,49 @@
+// APPLE LOCAL file Objective-C++
+/* Test for using ObjC classes as C++ template parameters. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdlib.h>
+
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@interface Base: Object
+- (int) meth;
+@end
+
+@interface Derived: Base
+- (int) meth;
+@end
+
+static int count = 0;
+
+template <class T> struct Templ
+{
+ T *m;
+ int i;
+ Templ(): i(55), m([[T alloc] init]) { count++; }
+ ~Templ() { [m free]; count--; }
+};
+
+@implementation Base
+- (int) meth { return 333; }
+@end
+
+@implementation Derived
+- (int) meth { return 666; }
+@end
+
+int main (void) {
+ CHECK_IF(count == 0);
+ {
+ Templ<Derived> derived;
+ CHECK_IF(derived.i == 55 && count == 1);
+ Templ<Base> base;
+ CHECK_IF(base.i == 55 && count == 2);
+ CHECK_IF([base.m meth] == 333);
+ CHECK_IF([derived.m meth] == 666);
+ }
+ CHECK_IF(count == 0);
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/template-2.mm b/gcc/testsuite/obj-c++.dg/template-2.mm
new file mode 100644
index 00000000000..8baece39088
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/template-2.mm
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test if ObjC classes (and pointers thereto) can participate
+ in C++ overloading. Correct handling of cv-qualifiers is
+ key here. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+@interface foo {
+ int a, b;
+}
+@end
+
+struct bar {
+ int c, d;
+};
+
+template <class _Tp>
+struct allocator {
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+
+ pointer address(reference __x) const { return &__x; }
+ const_pointer address(const_reference __x) const { return &__x; }
+};
+
+allocator<bar *> b;
+allocator<foo *> d;
diff --git a/gcc/testsuite/obj-c++.dg/template-3.mm b/gcc/testsuite/obj-c++.dg/template-3.mm
new file mode 100644
index 00000000000..24ffb32bdfa
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/template-3.mm
@@ -0,0 +1,80 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test for passing arguments to ObjC methods in the context of template
+ expansion. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdlib.h>
+
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@interface ObjCClass : Object
+{
+@public
+ int info;
+}
+-(id) init;
+-(id) initWithInformation: (int) whatInfo;
+-(id) initWithInformation: (int) whatInfo andInfo: (int) info2;
+@end
+
+void foo(int info) {
+ ObjCClass *mObj1 = [[ObjCClass alloc] init];
+ ObjCClass *mObj2 = [[ObjCClass alloc] initWithInformation: info];
+ ObjCClass *mObj3 = [[ObjCClass alloc] initWithInformation: info andInfo: 39];
+
+ CHECK_IF(mObj1->info == 666);
+ CHECK_IF(mObj2->info == info);
+ CHECK_IF(mObj3->info == info + 39);
+}
+
+template <class WrappedObjCClass>
+class ObjCObjectWrapper
+{
+ public:
+ ObjCObjectWrapper(int info);
+ WrappedObjCClass *mObj1, *mObj2, *mObj3;
+};
+
+template <class WrappedObjCClass>
+ObjCObjectWrapper<WrappedObjCClass>::ObjCObjectWrapper(int info)
+{
+ mObj1 = [[WrappedObjCClass alloc] init];
+ mObj2 = [[WrappedObjCClass alloc] initWithInformation: info];
+ mObj3 = [[WrappedObjCClass alloc] initWithInformation: info andInfo: 67];
+}
+
+@implementation ObjCClass
+-(id) init {
+ return [self initWithInformation:666];
+}
+-(id) initWithInformation: (int) whatInfo {
+ [super init];
+ info = whatInfo;
+ return self;
+}
+-(id) initWithInformation: (int) whatInfo andInfo: (int) info2 {
+ [super init];
+ info = whatInfo + info2;
+ return self;
+}
+@end
+
+ObjCObjectWrapper<ObjCClass> staticInstance(42);
+
+int main(void) {
+ ObjCObjectWrapper<ObjCClass> stackInstance(47);
+
+ foo(89);
+
+ CHECK_IF(staticInstance.mObj1->info == 666);
+ CHECK_IF(staticInstance.mObj2->info == 42);
+ CHECK_IF(staticInstance.mObj3->info == 42 + 67);
+
+ CHECK_IF(stackInstance.mObj1->info == 666);
+ CHECK_IF(stackInstance.mObj2->info == 47);
+ CHECK_IF(stackInstance.mObj3->info == 47 + 67);
+
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/template-4.mm b/gcc/testsuite/obj-c++.dg/template-4.mm
new file mode 100644
index 00000000000..f575edd29a2
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/template-4.mm
@@ -0,0 +1,82 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+#ifdef __NEXT_RUNTIME__
+/* The following ain't pretty, but does allow us to have just one copy
+ of next_mapping.h. */
+#include "../objc/execute/next_mapping.h"
+#else
+#include <objc/NXConstStr.h>
+#endif
+
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+template <class ARR, class TYPE> class TestT
+{
+public:
+ TYPE k;
+ int abc( ARR *array ) {
+ return [array count] * k;
+ }
+ TestT(TYPE _k): k(_k) { }
+};
+
+template <class TYPE>
+const char *getDesc(void) {
+ return [TYPE name];
+}
+
+@class Array;
+
+template <class TYPE>
+int abc( TYPE *xyz, Array *array ) {
+ return [xyz count] + [array count];
+}
+
+@interface Array: Object {
+ id *arr;
+ int count;
+}
++ (id)arrayWithObjects:(id)first, ... ;
+- (int)count;
+@end
+
+@implementation Array
++ (id)arrayWithObjects:(id)first, ... {
+ Array *a = [Array new];
+ a->count = 0;
+ a->arr = (id *) calloc(8, sizeof(id));
+
+ va_list args;
+ va_start (args, first);
+
+ a->arr[a->count++] = first;
+
+ for (id el; el = va_arg(args, id); a->count++)
+ a->arr[a->count] = el;
+
+ return a;
+}
+- (int)count {
+ return count;
+}
+@end
+
+int main(void)
+{
+ CHECK_IF(!strcmp ([@"Object" cString], getDesc<Object>()));
+ CHECK_IF(!strcmp ([@"Array" cString], getDesc<Array>()));
+
+ Array* a1 = [Array arrayWithObjects:@"One", @"Two", @"Three", nil];
+ Array* a2 = [Array arrayWithObjects:@"Four", @"Five", nil];
+
+ TestT<Array, int> t(7);
+ CHECK_IF(t.abc(a1) + t.abc(a2) == 35);
+ CHECK_IF(abc(a1, a2) * t.k == 35);
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/template-5.mm b/gcc/testsuite/obj-c++.dg/template-5.mm
new file mode 100644
index 00000000000..cc84b3586dc
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/template-5.mm
@@ -0,0 +1,17 @@
+// APPLE LOCAL file Objective-C++
+// Test that extern template does not get emitted.
+// Author: Matt Austern <austern@apple.com>
+// { dg-do compile }
+// { dg-options "" }
+// { dg-final { scan-assembler-not ".globl __ZN3FooIiE5identEi" } }
+
+template <typename X>
+struct Foo {
+ X ident(X x) { return x; }
+};
+
+extern template struct Foo<int>;
+
+int abcde(Foo<int>& foo, int n) {
+ return foo.ident(n);
+}
diff --git a/gcc/testsuite/obj-c++.dg/template-6.mm b/gcc/testsuite/obj-c++.dg/template-6.mm
new file mode 100644
index 00000000000..a48d85143f4
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/template-6.mm
@@ -0,0 +1,16 @@
+// APPLE LOCAL file Objective-C++
+// Test that extern template does not get emitted.
+// Author: Matt Austern <austern@apple.com>
+// { dg-do compile }
+// { dg-options "" }
+// { dg-final { scan-assembler-not ".globl __ZN3FooIiE5identEi" } }
+
+template <typename X>
+ struct Foo { X ident(X x); };
+
+template <typename X>
+ X Foo<X>::ident(X x) { return x; }
+
+extern template struct Foo<int>;
+
+int abcde(Foo<int>& foo, int n) { return foo.ident(n); }
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-1.mm b/gcc/testsuite/obj-c++.dg/try-catch-1.mm
new file mode 100644
index 00000000000..5be5ea2b41a
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/try-catch-1.mm
@@ -0,0 +1,42 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test if the compiler accepts @throw / @try..@catch..@finally syntax. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-options "-fobjc-exceptions" } */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+#include <stdio.h>
+#include <setjmp.h>
+
+@interface Frob: Object
+@end
+
+@implementation Frob: Object
+@end
+
+static int exc_control = 0;
+
+int proc() {
+ if(exc_control) {
+ printf ("Throwing (%d)... ", exc_control);
+ @throw [Frob new];
+ }
+ return 1;
+}
+
+int foo()
+{
+ @try {
+ return proc();
+ }
+ @catch (Frob* ex) {
+ if(exc_control > 1) {
+ printf("Rethrowing (%d)... ", exc_control);
+ @throw;
+ }
+ return 0;
+ }
+ @finally {
+ printf("In @finally block (%d)... ", exc_control);
+ }
+}
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-2.mm b/gcc/testsuite/obj-c++.dg/try-catch-2.mm
new file mode 100644
index 00000000000..1679bba1868
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/try-catch-2.mm
@@ -0,0 +1,80 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test out '@catch(id foo) {...}', which should catch
+ all uncaught exceptions. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-options "-fobjc-exceptions" } */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdio.h>
+
+/* The following is not required in actual user code; we include it
+ here to check that the compiler generates an internal definition of
+ _setjmp that is consistent with what <setjmp.h> provides. */
+#include <setjmp.h>
+
+extern "C" void abort(void);
+#define CHECK_IF(expr) if(!(expr)) abort()
+
+@interface Frob: Object
+@end
+
+@implementation Frob: Object
+@end
+
+static Frob* _connection = nil;
+
+//--------------------------------------------------------------------
+
+
+void test (Object* sendPort)
+{
+ int cleanupPorts = 1;
+ Frob* receivePort = nil;
+
+ @try {
+ printf ("receivePort = %p\n", receivePort);
+ printf ("sendPort = %p\n", sendPort);
+ printf ("cleanupPorts = %d\n", cleanupPorts);
+ printf ("---\n");
+
+ receivePort = (Frob *) -1;
+ _connection = (Frob *) -1;
+ printf ("receivePort = %p\n", receivePort);
+ printf ("sendPort = %p\n", sendPort);
+ printf ("cleanupPorts = %d\n", cleanupPorts);
+ printf ("---\n");
+
+ receivePort = nil;
+ sendPort = nil;
+ cleanupPorts = 0;
+
+ printf ("receivePort = %p\n", receivePort);
+ printf ("sendPort = %p\n", sendPort);
+ printf ("cleanupPorts = %d\n", cleanupPorts);
+ printf ("---\n");
+
+ @throw [Object new];
+ }
+ @catch(Frob *obj) {
+ printf ("Exception caught by incorrect handler!\n");
+ CHECK_IF(0);
+ }
+ @catch(id exc) {
+ printf ("Exception caught by correct handler.\n");
+ printf ("receivePort = %p (expected 0x0)\n", receivePort);
+ printf ("sendPort = %p (expected 0x0)\n", sendPort);
+ printf ("cleanupPorts = %d (expected 0)\n", cleanupPorts);
+ printf ("---");
+ CHECK_IF(!receivePort);
+ CHECK_IF(!sendPort);
+ CHECK_IF(!cleanupPorts);
+ }
+}
+
+int main (void) {
+
+ test((Object *)-1);
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-3.mm b/gcc/testsuite/obj-c++.dg/try-catch-3.mm
new file mode 100644
index 00000000000..1bc88facc66
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/try-catch-3.mm
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test if caught exception objects are accessible inside the
+ @catch block. (Yes, I managed to break this.) */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-fobjc-exceptions" } */
+
+#include <objc/Object.h>
+
+const char *foo(void)
+{
+ @try {
+ return "foo";
+ }
+ @catch (Object* theException) {
+ return [theException name];
+ }
+}
+
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-4.mm b/gcc/testsuite/obj-c++.dg/try-catch-4.mm
new file mode 100644
index 00000000000..7613c16fc70
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/try-catch-4.mm
@@ -0,0 +1,27 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Check that the compiler does not incorrectly complain about
+ exceptions being caught by previous @catch blocks. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-Wall -fobjc-exceptions" } */
+
+@interface Exception
+@end
+
+@interface FooException : Exception
+@end
+
+extern void foo();
+
+void test()
+{
+ @try {
+ foo();
+ }
+ @catch (FooException* fe) {
+ }
+ @catch (Exception* e) {
+ }
+}
+
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-5.mm b/gcc/testsuite/obj-c++.dg/try-catch-5.mm
new file mode 100644
index 00000000000..51d114bf069
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/try-catch-5.mm
@@ -0,0 +1,28 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Check that the compiler does correctly complain about
+ exceptions being caught by previous @catch blocks. */
+/* Force the use of NeXT runtime to see that we don't ICE after
+ generating the warning message. */
+
+/* { dg-do compile } */
+/* { dg-options "-Wall -fnext-runtime -fobjc-exceptions" } */
+
+@interface Exception
+@end
+
+@interface FooException : Exception
+@end
+
+extern void foo();
+
+void test()
+{
+ @try {
+ foo();
+ }
+ @catch (Exception* e) { /* { dg-warning "earlier handler" } */
+ }
+ @catch (FooException* fe) { /* { dg-warning "will be caught" } */
+ }
+}
+
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-6.mm b/gcc/testsuite/obj-c++.dg/try-catch-6.mm
new file mode 100644
index 00000000000..9d0e57117d9
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/try-catch-6.mm
@@ -0,0 +1,14 @@
+/* APPLE LOCAL file Objective-C++ */
+/* A very simple @try-@catch example. */
+/* { dg-do compile } */
+/* { dg-options "-fobjc-exceptions" } */
+
+int foo(void) {
+ @try {
+ return 2;
+ }
+ @catch (id foo) {
+ return 1;
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-7.mm b/gcc/testsuite/obj-c++.dg/try-catch-7.mm
new file mode 100644
index 00000000000..a9d7d147b42
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/try-catch-7.mm
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file Objective-C++ */
+/* { dg-do compile } */
+/* { dg-options "-fobjc-exceptions" } */
+
+#include <objc/Object.h>
+
+int main (int argc, const char * argv[]) {
+
+ Object * pool = [Object new];
+ int a;
+
+ if ( 1 ) {
+
+ @try {
+ a = 1;
+ }
+
+ @catch (Object *e) {
+ a = 2;
+ }
+
+ @finally {
+ a = 3;
+ }
+ }
+
+ [pool free];
+ return 0;
+}
diff --git a/gcc/testsuite/obj-c++.dg/try-catch-8.mm b/gcc/testsuite/obj-c++.dg/try-catch-8.mm
new file mode 100644
index 00000000000..4ff02b8f68d
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/try-catch-8.mm
@@ -0,0 +1,28 @@
+/* APPLE LOCAL file */
+/* Test for graceful compilation of @synchronized statements. */
+/* { dg-do compile } */
+/* { dg-options "-fobjc-exceptions" } */
+
+#include <objc/Object.h>
+
+@interface Derived: Object
+- (id) meth;
+@end
+
+@implementation Derived
+- (id) meth {
+ return self;
+}
+
+static Derived* rewriteDict(void) {
+ static Derived *sDict = 0;
+ if (sDict == 0) {
+ @synchronized ([Derived class]) {
+ if (sDict == 0)
+ sDict = [Derived new];
+ }
+ }
+ return sDict;
+}
+@end
+
diff --git a/gcc/testsuite/obj-c++.dg/va-meth-1.mm b/gcc/testsuite/obj-c++.dg/va-meth-1.mm
new file mode 100644
index 00000000000..2cb7f5f4f4f
--- /dev/null
+++ b/gcc/testsuite/obj-c++.dg/va-meth-1.mm
@@ -0,0 +1,74 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Based on objc/execute/va_method.m, by Nicola Pero */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdarg.h>
+#include <stdlib.h>
+
+/* Test methods with "C-style" trailing arguments, with or without ellipsis. */
+
+@interface MathClass: Object
+/* sum positive numbers; -1 ends the list */
++ (int) sum: (int) firstNumber, int secondNumber, ...;
++ (int) prod: (int) firstNumber, int secondNumber, int thirdNumber;
++ (int) minimum: (int) firstNumber, ...;
+@end
+
+extern "C" int some_func(id self, SEL _cmd, int firstN, int secondN, int thirdN, ...) {
+ return firstN + secondN + thirdN;
+}
+
+@implementation MathClass
++ (int) sum: (int) firstNumber, int secondNumber, ...
+{
+ va_list ap;
+ int sum = 0, number = 0;
+
+ va_start (ap, secondNumber);
+ number = firstNumber + secondNumber;
+
+ while (number >= 0)
+ {
+ sum += number;
+ number = va_arg (ap, int);
+ }
+
+ va_end (ap);
+
+ return sum;
+}
++ (int) prod: (int) firstNumber, int secondNumber, int thirdNumber {
+ return firstNumber * secondNumber * thirdNumber;
+}
++ (int) minimum: (int) firstNumber, ...
+{
+ va_list ap;
+ int minimum = 999, number = 0;
+
+ va_start (ap, firstNumber);
+ number = firstNumber;
+
+ while (number >= 0)
+ {
+ minimum = (minimum < number ? minimum: number);
+ number = va_arg (ap, int);
+ }
+
+ va_end (ap);
+
+ return minimum;
+}
+@end
+
+int main (void)
+{
+ if ([MathClass sum: 1, 2, 3, 4, 5, -1] != 15)
+ abort ();
+ if ([MathClass prod: 4, 5, 6] != 120)
+ abort ();
+ if ([MathClass minimum: 17, 9, 133, 84, 35, -1] != 9)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/comp-types-8.m b/gcc/testsuite/objc.dg/comp-types-8.m
new file mode 100644
index 00000000000..7b940a7ba97
--- /dev/null
+++ b/gcc/testsuite/objc.dg/comp-types-8.m
@@ -0,0 +1,25 @@
+/* APPLE LOCAL file Objective-C */
+/* { dg-do compile } */
+/* Another gimplifier ICE... */
+
+#include <objc/Object.h>
+
+@interface MyView: Object {
+ int _frame;
+}
+- (void)_finalize;
+@end
+
+@interface MyViewTemplate: MyView {
+ void *_className;
+}
+- (id)createRealObject;
+@end
+
+@implementation MyViewTemplate
+- (id)createRealObject {
+ id realObj;
+ *(MyView *)realObj = *(MyView *)self;
+ return realObj;
+}
+@end
diff --git a/gcc/testsuite/objc.dg/const-cfstring-1.m b/gcc/testsuite/objc.dg/const-cfstring-1.m
new file mode 100644
index 00000000000..8645022b6ef
--- /dev/null
+++ b/gcc/testsuite/objc.dg/const-cfstring-1.m
@@ -0,0 +1,57 @@
+/* APPLE LOCAL file constant cfstrings */
+/* Test the -fconstant-cfstrings option for constructing
+ compile-time immutable CFStrings, and their interoperation
+ with both Cocoa and CoreFoundation. This will only work
+ on MacOS X 10.1.2 and later. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do run { target *-*-darwin* } } */
+/* { dg-options "-fconstant-cfstrings -framework Cocoa" } */
+
+#import <Foundation/NSString.h>
+#import <CoreFoundation/CFString.h>
+#include <stdlib.h>
+
+void printOut(NSString *str) {
+ NSLog(@"The value of str is: %@", str);
+}
+
+CFStringRef s0a = CFSTR("Compile-time string literal");
+CFStringRef s0b = CFSTR("Compile-time string literal");
+
+void checkNSRange(NSRange r) {
+ if (r.location != 6 || r.length != 5) {
+ printOut(@"Range check failed");
+ abort();
+ }
+}
+
+void checkCFRange(CFRange r) {
+ if (r.location != 6 || r.length != 5) {
+ printOut(@"Range check failed");
+ abort();
+ }
+}
+
+int main(void) {
+ const NSString *s1 = @"Compile-time string literal";
+ CFStringRef s2 = CFSTR("Compile-time string literal");
+
+ checkNSRange([@"Hello World" rangeOfString:@"World"]);
+ checkNSRange([(id)CFSTR("Hello World") rangeOfString:@"World"]);
+ checkNSRange([@"Hello World" rangeOfString:(id)CFSTR("World")]);
+ checkNSRange([(id)CFSTR("Hello World") rangeOfString:(id)CFSTR("World")]);
+
+ checkCFRange(CFStringFind((CFStringRef)@"Hello World", (CFStringRef)@"World", 0));
+ checkCFRange(CFStringFind(CFSTR("Hello World"), (CFStringRef)@"World", 0));
+ checkCFRange(CFStringFind((CFStringRef)@"Hello World", CFSTR("World"), 0));
+ checkCFRange(CFStringFind(CFSTR("Hello World"), CFSTR("World"), 0));
+
+ /* Check for string uniquing. */
+ if (s0a != s0b || s0a != s2 || s1 != (id)s2) {
+ NSLog(@"String uniquing failed");
+ abort ();
+ }
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/const-cfstring-2.m b/gcc/testsuite/objc.dg/const-cfstring-2.m
new file mode 100644
index 00000000000..57b8d95a7d4
--- /dev/null
+++ b/gcc/testsuite/objc.dg/const-cfstring-2.m
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file constant CFStrings */
+/* Test the -Wnonportable-cfstrings option, which should give
+ warnings if non-ASCII characters are embedded in constant
+ CFStrings. This will only work on MacOS X 10.2 and later. */
+/* Developed by Ziemowit Laski <zlaski@apple.com>. */
+
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fconstant-cfstrings -Wnonportable-cfstrings" } */
+
+#import <Foundation/NSString.h>
+#import <CoreFoundation/CFString.h>
+
+#ifndef __CONSTANT_CFSTRINGS__
+#error The -fconstant-cfstrings option is not functioning properly
+#endif
+
+void foo(void) {
+ NSString *s1 = @"Compile-time string literal";
+ CFStringRef s2 = CFSTR("Compile-time string literal");
+ NSString *s3 = @"Non-ASCII literal - \222"; /* { dg-warning "non-ASCII character in CFString literal" } */
+ CFStringRef s4 = CFSTR("\222 - Non-ASCII literal"); /* { dg-warning "non-ASCII character in CFString literal" } */
+ CFStringRef s5 = CFSTR("Non-ASCII (\222) literal"); /* { dg-warning "non-ASCII character in CFString literal" } */
+ NSString *s6 = @"\0Embedded NUL"; /* { dg-warning "embedded NUL in CFString literal" } */
+ CFStringRef s7 = CFSTR("Embedded \0NUL"); /* { dg-warning "embedded NUL in CFString literal" } */
+ CFStringRef s8 = CFSTR("Embedded NUL\0"); /* { dg-warning "embedded NUL in CFString literal" } */
+}
diff --git a/gcc/testsuite/objc.dg/const-cfstring-3.m b/gcc/testsuite/objc.dg/const-cfstring-3.m
new file mode 100644
index 00000000000..82f361cec6f
--- /dev/null
+++ b/gcc/testsuite/objc.dg/const-cfstring-3.m
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file constant strings */
+/* Test for assigning compile-time constant-string objects to static variables. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-options "-fconstant-cfstrings -framework Foundation" } */
+/* { dg-do run { target *-*-darwin* } } */
+
+#include <stdlib.h>
+
+typedef const struct __CFString * CFStringRef;
+static CFStringRef appKey = (CFStringRef) @"com.apple.soundpref";
+
+static int CFPreferencesSynchronize (CFStringRef ref) {
+ return ref == appKey;
+}
+
+static void PrefsSynchronize()
+{
+ if(!CFPreferencesSynchronize(appKey))
+ abort();
+}
+
+int main(void) {
+ PrefsSynchronize();
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/const-cfstring-4.m b/gcc/testsuite/objc.dg/const-cfstring-4.m
new file mode 100644
index 00000000000..9078bfa2313
--- /dev/null
+++ b/gcc/testsuite/objc.dg/const-cfstring-4.m
@@ -0,0 +1,12 @@
+/* APPLE LOCAL file constant strings */
+/* Test if constant CFStrings get placed in the correct section. */
+/* Contributed by Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-options "-fconstant-cfstrings" } */
+/* { dg-do compile { target *-*-darwin* } } */
+
+typedef const struct __CFString * CFStringRef;
+static CFStringRef appKey = (CFStringRef) @"com.apple.soundpref";
+
+/* { dg-final { scan-assembler ".section __DATA, __cfstring" } } */
+/* { dg-final { scan-assembler ".long\t___CFConstantStringClassReference\n\t.long\t1992\n\t.long\t.*\n\t.long\t19\n\t.data" } } */
diff --git a/gcc/testsuite/objc.dg/dg.exp b/gcc/testsuite/objc.dg/dg.exp
index ebf952967c7..7b3eba41d98 100644
--- a/gcc/testsuite/objc.dg/dg.exp
+++ b/gcc/testsuite/objc.dg/dg.exp
@@ -28,7 +28,8 @@ if ![info exists DEFAULT_CFLAGS] then {
dg-init
# Main loop.
-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[m\]]] \
+# APPLE LOCAL -ObjC
+dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[mc\]]] \
"" $DEFAULT_CFLAGS
# All done.
diff --git a/gcc/testsuite/objc.dg/encode-1.m b/gcc/testsuite/objc.dg/encode-1.m
index 868c3254753..126e5d010f4 100644
--- a/gcc/testsuite/objc.dg/encode-1.m
+++ b/gcc/testsuite/objc.dg/encode-1.m
@@ -1,9 +1,9 @@
+/* APPLE LOCAL file bool encoding */
/* Test if the Objective-C @encode machinery distinguishes between
- 'BOOL *' (which should be encoded as a pointer to BOOL) and 'char *' (which
- should be encoded as '*'). This is somewhat tricky wrt the NeXT runtime,
- where we have 'typedef char BOOL'. */
+ 'BOOL *' (which should be encoded as '^c') and 'char *' (which
+ should be encoded as '*'). */
/* Contributed by Ziemowit Laski <zlaski@apple.com>. */
-/* { dg-options "-fnext-runtime -lobjc" } */
+/* { dg-options "-lobjc" } */
/* { dg-do run } */
#include <string.h>
@@ -12,10 +12,9 @@
int main(void) {
const char *BOOL_ptr = @encode(BOOL *);
- const char *BOOL_ = @encode(BOOL);
const char *char_ptr = @encode(char *);
-
- if(*BOOL_ptr != '^' || strcmp(BOOL_ptr + 1, BOOL_))
+
+ if(strcmp(BOOL_ptr, "^c"))
abort();
if(strcmp(char_ptr, "*"))
diff --git a/gcc/testsuite/objc.dg/encode-6.m b/gcc/testsuite/objc.dg/encode-6.m
new file mode 100644
index 00000000000..d23dc6cf399
--- /dev/null
+++ b/gcc/testsuite/objc.dg/encode-6.m
@@ -0,0 +1,23 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Test for graceful encoding of const-qualified fields and parameters. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile } */
+
+struct Cxx {
+ const struct Cxx *next;
+};
+
+@interface ObjC {
+ const struct Cxx *obj;
+}
+- (ObjC *)initWithCxx: (struct Cxx *const)c and: (const struct Cxx *)d;
+@end
+
+@implementation ObjC
+- (ObjC *)initWithCxx: (struct Cxx *const)c and: (const struct Cxx *)d {
+ obj = d;
+ return self;
+}
+@end
+
+/* { dg-final { scan-assembler "@\[0-9\]+@0:\[0-9\]+r\\^{Cxx=\\^r{Cxx}}\[0-9\]+\\^r{Cxx}" } } */
diff --git a/gcc/testsuite/objc.dg/extra-semi.m b/gcc/testsuite/objc.dg/extra-semi.m
new file mode 100644
index 00000000000..96d31b806d0
--- /dev/null
+++ b/gcc/testsuite/objc.dg/extra-semi.m
@@ -0,0 +1,10 @@
+/* APPLE LOCAL file Objective-C++ */
+/* Allow extra semicolons in between method declarations,
+ for old times' sake. */
+/* { dg-do compile } */
+
+@interface Foo
+ -(Foo *) expiration;
+ -(void) setExpiration:(Foo *) date;;
+ -(int) getVersion;
+@end
diff --git a/gcc/testsuite/objc.dg/isa-field-1.m b/gcc/testsuite/objc.dg/isa-field-1.m
new file mode 100644
index 00000000000..7afbafe7508
--- /dev/null
+++ b/gcc/testsuite/objc.dg/isa-field-1.m
@@ -0,0 +1,44 @@
+/* APPLE LOCAL file Objective-C */
+/* Ensure there are no bizarre difficulties with accessing the 'isa' field of objects. */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@interface Object (Test)
+- (Class) test1: (id)object;
+@end
+
+@interface Derived: Object
+- (Class) test2: (id)object;
+@end
+
+@implementation Object (Test)
+
+Class test1(id object) {
+ Class cls = object->isa;
+ return cls;
+}
+- (Class) test1: (id)object {
+ Class cls = object->isa;
+ return cls;
+}
+
+@end
+
+@implementation Derived
+
+Class test2(id object) {
+ Class cls = object->isa;
+ return cls;
+}
+- (Class) test2: (id)object {
+ Class cls = object->isa;
+ return cls;
+}
+
+@end
+
+Class test3(id object) {
+ Class cls = object->isa;
+ return cls;
+}
diff --git a/gcc/testsuite/objc.dg/lookup-1.m b/gcc/testsuite/objc.dg/lookup-1.m
new file mode 100644
index 00000000000..de20c1d84f3
--- /dev/null
+++ b/gcc/testsuite/objc.dg/lookup-1.m
@@ -0,0 +1,55 @@
+/* APPLE LOCAL file Objective-C++ */
+/* { dg-do run } */
+
+#include <objc/Object.h>
+#include <stdlib.h>
+
+typedef struct MyWidget {
+ int a;
+} MyWidget;
+
+MyWidget gWidget = { 17 };
+
+@protocol MyProto
+- (MyWidget *)widget;
+@end
+
+@interface Foo: Object
+@end
+
+@interface Bar: Foo <MyProto>
+@end
+
+@interface Container: Object
++ (MyWidget *)elementForView:(Foo *)view;
+@end
+
+@implementation Foo
+@end
+
+@implementation Bar
+- (MyWidget *)widget {
+ return &gWidget;
+}
+@end
+
+@implementation Container
++ (MyWidget *)elementForView:(Foo *)view
+{
+ MyWidget *widget = nil;
+ if ([view conformsTo:@protocol(MyProto)]) {
+ widget = [(Foo <MyProto> *)view widget];
+ }
+ return widget;
+}
+@end
+
+int main(void) {
+ id view = [Bar new];
+ MyWidget *w = [Container elementForView: view];
+
+ if (!w || w->a != 17)
+ abort ();
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/lvalue-cast-1.m b/gcc/testsuite/objc.dg/lvalue-cast-1.m
new file mode 100644
index 00000000000..f2575efc631
--- /dev/null
+++ b/gcc/testsuite/objc.dg/lvalue-cast-1.m
@@ -0,0 +1,32 @@
+/* APPLE LOCAL file non lvalue assign */
+/* { dg-do compile } */
+/* { dg-options "-fnon-lvalue-assign" } */
+
+#include <objc/Object.h>
+
+typedef struct _NSPoint {
+ float x;
+ float y;
+} NSPoint;
+typedef NSPoint *NSPointPointer;
+typedef NSPoint *NSPointArray;
+typedef struct _NSSize {
+ float width;
+ float height;
+} NSSize;
+typedef struct _NSRect {
+ NSPoint origin;
+ NSSize size;
+} NSRect;
+
+@interface NSLayoutManager: Object {
+ NSRect *_cachedRectArray;
+}
+- (void)_growCachedRectArrayToSize:(unsigned)newSize;
+@end
+
+@implementation NSLayoutManager
+- (void)_growCachedRectArrayToSize:(unsigned)newSize {
+ ( NSRect *)_cachedRectArray = nil; /* { dg-warning "target of assignment not really an lvalue" } */
+}
+@end
diff --git a/gcc/testsuite/objc.dg/method-15.m b/gcc/testsuite/objc.dg/method-15.m
new file mode 100644
index 00000000000..e7ebf7f314f
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-15.m
@@ -0,0 +1,56 @@
+/* APPLE LOCAL file */
+/* Test if prior method lookup at method @implementation time is not
+ overly aggressive, leading to methods being found in other classes. */
+/* Author: Ziemowit Laski <zlaski@apple.com>. */
+/* { dg-do compile } */
+
+#include <objc/Object.h>
+
+@class NSString;
+
+@protocol NSMenuItem
++ (void)setUsesUserKeyEquivalents:(BOOL)flag;
++ (BOOL)usesUserKeyEquivalents;
+@end
+
+@interface NSMenuItem : Object <NSMenuItem> {
+ @private
+ id _menu;
+}
+@end
+
+@interface NSResponder : Object <NSMenuItem>
+{
+ id _nextResponder;
+}
+@end
+
+@interface Object(NSMenuValidation)
+- (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem;
+@end
+
+@interface NSResponder (NSStandardKeyBindingMethods)
+- (void)insertText:(id)insertString;
+- (void)doCommandBySelector:(SEL)aSelector;
+@end
+
+@interface NSView : NSResponder
+{
+ id _superview;
+ id _subviews;
+}
+@end
+
+@interface SKTGraphicView : NSView {
+ @private
+ float _gridSpacing;
+}
+@end
+
+@implementation SKTGraphicView
+- (BOOL)validateMenuItem:(NSMenuItem *)item {
+ return (BOOL)1;
+}
+- (void)insertText:(NSString *)str {
+}
+@end
diff --git a/gcc/testsuite/objc.dg/method-16.m b/gcc/testsuite/objc.dg/method-16.m
new file mode 100644
index 00000000000..cbe4710ed2c
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-16.m
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file Objective-C */
+/* Do not warn about "slightly" mismatched method signatures if
+ -Wstrict-selector-match is off. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-strict-selector-match" } */
+
+#include <objc/objc.h>
+
+@interface Base
+- (id) meth1: (Base *)arg1;
+- (id) window;
+@end
+
+@interface Derived: Base
+- (id) meth1: (Derived *)arg1;
+- (Base *)window;
+@end
+
+void foo(void) {
+ id r;
+
+ [r meth1:r];
+ [r window];
+}
diff --git a/gcc/testsuite/objc.dg/method-17.m b/gcc/testsuite/objc.dg/method-17.m
new file mode 100644
index 00000000000..a4e68539063
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-17.m
@@ -0,0 +1,26 @@
+/* APPLE LOCAL file Objective-C */
+/* Test for spurious "may or may not return a value" warnings. */
+/* { dg-do compile } */
+/* { dg-options "-Wextra" } */
+
+#include <objc/Object.h>
+
+@interface Foo: Object
+- (id) meth1;
+- (void) meth2;
+@end
+
+extern int bar;
+
+@implementation Foo
+- (id) meth1 {
+ if (bar)
+ return [Object new];
+ return;
+} /* { dg-warning "this function may return with or without a value" } */
+- (void) meth2 {
+ if (!bar)
+ return;
+ bar = 0;
+} /* { dg-bogus "this function may return with or without a value" } */
+@end
diff --git a/gcc/testsuite/objc.dg/method-18.m b/gcc/testsuite/objc.dg/method-18.m
new file mode 100644
index 00000000000..12e79a181f7
--- /dev/null
+++ b/gcc/testsuite/objc.dg/method-18.m
@@ -0,0 +1,30 @@
+/* APPLE LOCAL file Objective-C */
+/* Do not warn about "slightly" mismatched method signatures if
+ -Wstrict-selector-match is off. */
+/* { dg-do compile } */
+/* { dg-options "-Wno-strict-selector-match" } */
+
+#include <objc/objc.h>
+
+typedef enum { en1_1, en1_2 } En1;
+typedef enum { en2_1, en2_2 } En2;
+typedef struct { int a, b; } St1;
+typedef struct { unsigned a, b; } St2;
+
+@interface Base
+- (id) meth1: (En1)arg1;
+- (St1) window;
+@end
+
+@interface Derived: Base
+- (id) meth1: (En2)arg1;
+- (St2)window;
+@end
+
+void foo(void) {
+ id r;
+ En1 en;
+
+ [r meth1:en];
+ [r window];
+}
diff --git a/gcc/testsuite/objc.dg/method-6.m b/gcc/testsuite/objc.dg/method-6.m
index a4c1323fac8..d2996dface7 100644
--- a/gcc/testsuite/objc.dg/method-6.m
+++ b/gcc/testsuite/objc.dg/method-6.m
@@ -1,5 +1,5 @@
-/* Check that sending messages to variables of type 'Class' does not involve instance methods,
- unless they reside in root classes. */
+/* APPLE LOCAL file */
+/* Check that sending messages to variables of type 'Class' does not involve instance methods, unless they reside in root classes. */
/* Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
@@ -29,3 +29,7 @@ void foo(void) {
[Class port]; /* { dg-error ".Class. is not an Objective\\-C class name or alias" } */
}
+
+/* APPLE LOCAL Objective-C */
+/* { dg-options "-Wstrict-selector-match" } */
+
diff --git a/gcc/testsuite/objc.dg/method-7.m b/gcc/testsuite/objc.dg/method-7.m
index f84759c2169..76930518a50 100644
--- a/gcc/testsuite/objc.dg/method-7.m
+++ b/gcc/testsuite/objc.dg/method-7.m
@@ -1,5 +1,5 @@
-/* Check if finding multiple signatures for a method is handled gracefully. */
-/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* APPLE LOCAL file */
+/* Check if finding multiple signatures for a method is handled gracefully. Author: Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
#include <objc/Object.h>
@@ -25,3 +25,6 @@ id foo(void) {
return obj;
}
+
+/* APPLE LOCAL Objective-C */
+/* { dg-options "-Wstrict-selector-match" } */
diff --git a/gcc/testsuite/objc.dg/method-9.m b/gcc/testsuite/objc.dg/method-9.m
index 3921663ec8f..9987748dba0 100644
--- a/gcc/testsuite/objc.dg/method-9.m
+++ b/gcc/testsuite/objc.dg/method-9.m
@@ -1,5 +1,5 @@
-/* Check if finding multiple signatures for a method is handled gracefully
- when method lookup succeeds (see also method-7.m). */
+/* APPLE LOCAL file */
+/* Check if finding multiple signatures for a method is handled gracefully when method lookup succeeds (see also method-7.m). */
/* Contributed by Ziemowit Laski <zlaski@apple.com> */
/* { dg-do compile } */
@@ -41,3 +41,7 @@
return result;
}
@end
+
+/* APPLE LOCAL Objective-C */
+/* { dg-options "-Wstrict-selector-match" } */
+
diff --git a/gcc/testsuite/objc.dg/next-runtime-1.m b/gcc/testsuite/objc.dg/next-runtime-1.m
new file mode 100644
index 00000000000..1fbf70a27d7
--- /dev/null
+++ b/gcc/testsuite/objc.dg/next-runtime-1.m
@@ -0,0 +1,18 @@
+/* APPLE LOCAL file ObjC GC */
+/* Test that the correct version number (6) is set in the module descriptor
+ when compiling for the NeXT runtime. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fnext-runtime" } */
+
+#include <objc/Object.h>
+
+@interface FooBar: Object
+- (void)boo;
+@end
+
+@implementation FooBar
+- (void)boo { }
+@end
+
+/* { dg-final { scan-assembler "L_OBJC_MODULES:\n\[ \t\]*\.long\t6\n" } } */
diff --git a/gcc/testsuite/objc.dg/no-extra-load.m b/gcc/testsuite/objc.dg/no-extra-load.m
new file mode 100644
index 00000000000..4e6a9f3b6e3
--- /dev/null
+++ b/gcc/testsuite/objc.dg/no-extra-load.m
@@ -0,0 +1,5 @@
+/* APPLE LOCAL file 3926484 */
+/* { dg-do compile } */
+#import <Foundation/Foundation.h>
+main() { [NSObject new]; }
+/* { dg-final { scan-assembler-not "L_objc_msgSend\\\$non_lazy_ptr" } } */
diff --git a/gcc/testsuite/objc.dg/objc-fast-1.m b/gcc/testsuite/objc.dg/objc-fast-1.m
new file mode 100644
index 00000000000..6db7c38beec
--- /dev/null
+++ b/gcc/testsuite/objc.dg/objc-fast-1.m
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file ObjC direct dispatch */
+/* A compile-only test for insertion of 'bla' comm page jumps. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wassign-intercept" } */
+
+#include <objc/Object.h>
+
+@interface Derived: Object {
+@public
+ Object *other;
+}
+@end
+
+void foo(void) {
+ Derived *o = [Derived new];
+ o->other = 0; /* { dg-warning "instance variable assignment has been intercepted" } */
+}
+
+/* { dg-final { scan-assembler-not "objc_msgSend" } } */
+/* { dg-final { scan-assembler-not "objc_assign_ivar" } } */
+
+/* { dg-final { scan-assembler "bla.*fffeff00" } } */
+/* { dg-final { scan-assembler "bla.*fffefec0" } } */
diff --git a/gcc/testsuite/objc.dg/objc-fast-2.m b/gcc/testsuite/objc.dg/objc-fast-2.m
new file mode 100644
index 00000000000..61e97adad3a
--- /dev/null
+++ b/gcc/testsuite/objc.dg/objc-fast-2.m
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file ObjC direct dispatch */
+/* A compile-only test for insertion of 'ba' sibcall comm page jumps. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wno-assign-intercept -O2" } */
+
+#include <objc/Object.h>
+
+@interface Derived: Object {
+@public
+ Object *other;
+}
+@end
+
+void foo(void) {
+ Derived *o;
+ o->other = 0; /* sibcall to objc_assign_ivar_Fast() */
+}
+
+void bar(void) {
+ Derived *o = nil;
+ [Derived new]; /* sibcall to objc_msgSend_Fast() */
+}
+
+/* { dg-final { scan-assembler-not "objc_msgSend" } } */
+/* { dg-final { scan-assembler-not "objc_assign_ivar" } } */
+
+/* { dg-final { scan-assembler "ba.*fffeff00" } } */
+/* { dg-final { scan-assembler "ba.*fffefec0" } } */
diff --git a/gcc/testsuite/objc.dg/objc-fast-3.m b/gcc/testsuite/objc.dg/objc-fast-3.m
new file mode 100644
index 00000000000..fc57f831eef
--- /dev/null
+++ b/gcc/testsuite/objc.dg/objc-fast-3.m
@@ -0,0 +1,33 @@
+/* APPLE LOCAL file ObjC direct dispatch */
+/* A compile-only test for insertion of 'bla' and 'ba' sibcall comm page jumps
+ for methods returning 'void'. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc -fobjc-direct-dispatch -Wno-assign-intercept -O2" } */
+
+#include <objc/Object.h>
+
+@interface Derived: Object {
+@public
+ Object *other;
+}
+- (void) do_nothing;
+@end
+
+int a;
+
+void foo(void) {
+ Derived *o;
+ [o do_nothing]; /* objc_msgSend_Fast() */
+ a = 2;
+}
+
+void bar(void) {
+ Derived *o = nil;
+ [o do_nothing]; /* sibcall to objc_msgSend_Fast() */
+}
+
+/* { dg-final { scan-assembler-not "objc_msgSend" } } */
+
+/* { dg-final { scan-assembler "bla.*fffeff00" } } */
+/* { dg-final { scan-assembler "ba.*fffeff00" } } */
diff --git a/gcc/testsuite/objc.dg/objc-fast-4.m b/gcc/testsuite/objc.dg/objc-fast-4.m
new file mode 100644
index 00000000000..67e8a998bc4
--- /dev/null
+++ b/gcc/testsuite/objc.dg/objc-fast-4.m
@@ -0,0 +1,13 @@
+/* APPLE LOCAL file ObjC direct dispatch */
+/* Check that 4015820 is fixed. That does not appear except
+ with -O0, so the sibcall case cannot occur. */
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-O0 -fobjc-direct-dispatch" } */
+#include <objc/Object.h>
+
+void foo(void) {
+ Object *o;
+ [o++ free];
+}
+/* { dg-final { scan-assembler-not "objc_msgSend" } } */
+/* { dg-final { scan-assembler "bla.*fffeff00" } } */
diff --git a/gcc/testsuite/objc.dg/objc-gc-1.m b/gcc/testsuite/objc.dg/objc-gc-1.m
new file mode 100644
index 00000000000..ed9a8b1ac13
--- /dev/null
+++ b/gcc/testsuite/objc.dg/objc-gc-1.m
@@ -0,0 +1,146 @@
+/* APPLE LOCAL file ObjC GC */
+/* A compile-only test for insertion of write barriers. */
+/* Developed by Ziemowit Laski <zlaski@apple.com> */
+/* { dg-do compile { target *-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc -Wassign-intercept" } */
+
+#ifndef __OBJC_GC__
+#error Missing __OBJC_GC__ manifest constant
+#endif
+
+#include <objc/Object.h>
+
+@class Underspecified;
+@class MyClass;
+
+@interface AnotherClass: Object {
+@public
+ __strong void *storage;
+ MyClass *SomeObj;
+}
+- (id)assignObj:(id)obj;
+@end
+
+struct Struct1 {
+ MyClass *someobj;
+ void *obj2;
+ __strong void *obj3;
+};
+
+struct Struct1 *str1a, str1aa;
+__strong struct Struct1 *str1b, str1bb, **str1c, *str1d[3][3];
+
+extern MyClass *externFunc(void);
+
+@interface MyClass: Object {
+@public
+ id ivar1, *ivar1a;
+ void *ivar2;
+ __strong void *ivar3;
+ Underspecified *ivar4[2], **ivar4a;
+ union {
+ struct {
+ Underspecified *data;
+ const unsigned char *dataBytes;
+ } d;
+ struct {
+ __strong void *storage;
+ AnotherClass *another;
+ } s;
+ } contents;
+ struct {
+ struct {
+ void *yy;
+ } z;
+ } y;
+}
+@end
+
+@implementation AnotherClass
+- (id)assignObj:(id)obj {
+ static MyClass *m_myclass;
+ static id *indirect;
+ str1a = 0;
+ str1b = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1c = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1d[1][1] = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1a->someobj = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ str1b->someobj = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ str1aa.someobj = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1bb.someobj = 0; /* { dg-warning "global\\/static variable assignment" } */
+ str1a->obj2 = 0;
+ str1b->obj2 = 0;
+ str1a->obj3 = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ str1b->obj3 = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ SomeObj->contents.s.another = 0; /* { dg-warning "instance variable assignment" } */
+ obj = 0;
+ externFunc()->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ externFunc()->contents.s.another->SomeObj = 0; /* { dg-warning "instance variable assignment" } */
+ m_myclass = 0; /* { dg-warning "global\\/static variable assignment" } */
+ *indirect = obj; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ (__strong id)*indirect = obj; /* { dg-warning "strong\\-cast assignment" } */
+ (__strong id)(MyClass *)*indirect = obj; /* { dg-warning "strong\\-cast assignment" } */
+ self = 0;
+ self->isa = 0; /* { dg-warning "instance variable assignment" } */
+ return SomeObj = obj; /* { dg-warning "instance variable assignment" } */
+}
+@end
+
+typedef MyClass MyClass1;
+@compatibility_alias MyClass2 MyClass;
+
+MyClass *g_myclass;
+MyClass1 *g_myclass1;
+MyClass2 *g_myclass2;
+MyClass2 **g_myclass2a, ***g_myclass2b;
+MyClass2 *g_myclass2c[6], *g_myclass2d[4][5];
+__strong void *g_myclass2e[3];
+
+id *g_myid, ***g_myid3;
+
+void function(void) {
+ static MyClass *l_myclass;
+ MyClass2 *l_myclass2;
+
+ g_myclass = 0; /* { dg-warning "global\\/static variable assignment" } */
+ l_myclass = 0; /* { dg-warning "global\\/static variable assignment" } */
+ g_myclass->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ *g_myclass->ivar1a = 0;
+ l_myclass2 = 0;
+ l_myclass2->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ (__strong id)*g_myclass->ivar1a = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass->ivar2 = 0;
+ (__strong void *)g_myclass->ivar2 = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass->ivar3 = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->ivar4[1] = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->ivar4a = 0;
+ *l_myclass->ivar4a = 0;
+ (__strong id)*l_myclass->ivar4a = 0; /* { dg-warning "strong\\-cast assignment" } */
+ l_myclass->contents.d.data = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->contents.d.dataBytes = 0;
+ (__strong const unsigned char *)l_myclass->contents.d.dataBytes = 0; /* { dg-warning "strong\\-cast assignment" } */
+ l_myclass->contents.s.storage = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->contents.s.another->SomeObj = 0; /* { dg-warning "instance variable assignment" } */
+ l_myclass->contents.s.another->storage = 0; /* { dg-warning "instance variable assignment" } */
+ (__strong void *)l_myclass->contents.s.another->storage = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass->y.z.yy = 0;
+ (__strong void *)g_myclass->y.z.yy = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass1->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ g_myclass2->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ (*g_myclass2a)->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ *g_myid = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ ***g_myid3 = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ (__strong id)*g_myid = 0; /* { dg-warning "strong\\-cast assignment" } */
+ (__strong id)***g_myid3 = 0; /* { dg-warning "strong\\-cast assignment" } */
+ g_myclass2[3] = g_myclass1[4];
+ g_myclass2a[1] = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ g_myclass2b[1][2] = 0; /* { dg-warning "strong\\-cast may possibly be needed" } */
+ g_myclass2c[1] = 0; /* { dg-warning "global\\/static variable assignment" } */
+ g_myclass2e[1] = 0; /* { dg-warning "global\\/static variable assignment" } */
+ g_myclass2d[1][2] = 0; /* { dg-warning "global\\/static variable assignment" } */
+ g_myclass2a[1]->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ g_myclass2b[1][2]->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ g_myclass2c[1]->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+ g_myclass2d[1][2]->ivar1 = 0; /* { dg-warning "instance variable assignment" } */
+}
+
diff --git a/gcc/testsuite/objc.dg/objc-gc-2.m b/gcc/testsuite/objc.dg/objc-gc-2.m
new file mode 100644
index 00000000000..17c4bd56c08
--- /dev/null
+++ b/gcc/testsuite/objc.dg/objc-gc-2.m
@@ -0,0 +1,172 @@
+/* APPLE LOCAL file ObjC GC */
+/* A run-time test for insertion of write barriers. */
+/* { dg-do run { target *-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc" } */
+
+#include <objc/objc.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+typedef const struct __CFDictionary * CFDictionaryRef;
+
+// callouts to these are generated with cc -fobjc-gc
+
+int GlobalAssigns;
+int IvarAssigns;
+int StrongCastAssigns;
+
+
+id objc_assign_global(id value, id *dest) {
+ ++GlobalAssigns;
+ return (*dest = value);
+}
+
+id objc_assign_ivar(id value, id dest, unsigned int offset) {
+ id *slot = (id*) ((char *)dest + offset);
+
+ ++IvarAssigns;
+ return (*slot = value);
+}
+
+id objc_assign_strongCast(id value, id *dest) {
+ id base;
+
+ ++StrongCastAssigns ;
+ return (*dest = value);
+}
+
+// The test case elements;
+@class NSObject;
+@class NSString;
+
+typedef struct {
+ id element;
+ id elementArray[10];
+ __strong CFDictionaryRef cfElement;
+ __strong CFDictionaryRef cfElementArray[10];
+} struct_with_ids_t;
+
+@interface Foo {
+@public
+// assignments to any/all of these fields should generate objc_assign_ivar
+ __strong CFDictionaryRef dict;
+ __strong CFDictionaryRef dictArray[3];
+ id ivar;
+ id array[10];
+ NSObject *nsobject;
+ NSString *stringArray[10];
+ struct_with_ids_t inner;
+}
+
+@end
+
+// assignments to these should generate objc_assign_global
+id GlobalId;
+id GlobalArray[20];
+NSObject *GlobalObject;
+NSObject *GlobalObjectArray[20];
+__strong CFDictionaryRef Gdict;
+__strong CFDictionaryRef Gdictarray[10];
+struct_with_ids_t GlobalStruct;
+struct_with_ids_t GlobalStructArray[10];
+
+
+// The test cases
+void *rhs = 0;
+
+#define ASSIGNTEST(expr, global) expr = rhs; if (!global) { printf(# expr " is busted\n"); ++counter; } global = 0;
+
+int testGlobals() {
+ // Everything in this function generates assign_global intercepts
+ int counter = 0;
+
+ static id staticGlobalId;
+ static id staticGlobalArray[20];
+ static NSObject *staticGlobalObject;
+ static NSObject *staticGlobalObjectArray[20];
+ static __strong CFDictionaryRef staticGdict;
+ static __strong CFDictionaryRef staticGdictarray[10];
+ static struct_with_ids_t staticGlobalStruct;
+ static struct_with_ids_t staticGlobalStructArray[10];
+
+ ASSIGNTEST(GlobalId, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(GlobalArray[0], GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(GlobalObject, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(GlobalObjectArray[0], GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(Gdict, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(Gdictarray[1], GlobalAssigns) // objc_assign_global
+
+ ASSIGNTEST(GlobalStruct.element, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(GlobalStruct.elementArray[0], GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(GlobalStruct.cfElement, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(GlobalStruct.cfElementArray[0], GlobalAssigns) // objc_assign_global
+
+ ASSIGNTEST(staticGlobalId, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(staticGlobalArray[0], GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(staticGlobalObject, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(staticGlobalObjectArray[0], GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(staticGdict, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(staticGdictarray[1], GlobalAssigns) // objc_assign_global
+
+ ASSIGNTEST(staticGlobalStruct.element, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(staticGlobalStruct.elementArray[0], GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(staticGlobalStruct.cfElement, GlobalAssigns) // objc_assign_global
+ ASSIGNTEST(staticGlobalStruct.cfElementArray[0], GlobalAssigns) // objc_assign_global
+
+ return counter;
+}
+
+
+int testIvars() {
+ Foo *foo = (Foo *)malloc(sizeof(Foo)); // don't call in ObjC
+ int counter = 0;
+
+ ASSIGNTEST(foo->ivar, IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->dict, IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->dictArray[0], IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->array[0], IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->nsobject, IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->stringArray[0], IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->inner.element, IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->inner.elementArray[0], IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->inner.cfElement, IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->inner.cfElementArray[0], IvarAssigns) // objc_assign_ivar
+ return counter;
+}
+
+int testStrongCasts() {
+ id x = nil;
+ int counter = 0;
+ typedef struct { @defs(Foo) } Foo_defs;
+ Foo_defs *foo = (Foo_defs *)malloc(sizeof(Foo));
+
+ // strong casts should always be issued, even if the compiler could know better
+
+ ASSIGNTEST((__strong id)foo->ivar, StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->dict, StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->dictArray[0], StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->array[0], StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->nsobject, StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->stringArray[0], StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->inner.element, StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->inner.elementArray[0], StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->inner.cfElement, StrongCastAssigns) // objc_assign_strongCast
+ ASSIGNTEST((__strong id)foo->inner.cfElementArray[0], StrongCastAssigns) // objc_assign_strongCast
+
+
+ // assignments to declared __strong on plain structure elements shouldn't work
+
+ return counter;
+}
+
+@implementation Foo
+@end
+
+int main(int argc, char *argv[]) {
+ int errors = 0;
+ errors += testGlobals();
+ errors += testIvars();
+ errors += testStrongCasts();
+ return(errors != 0);
+}
+
diff --git a/gcc/testsuite/objc.dg/objc-gc-3.m b/gcc/testsuite/objc.dg/objc-gc-3.m
new file mode 100644
index 00000000000..217c00b8c2d
--- /dev/null
+++ b/gcc/testsuite/objc.dg/objc-gc-3.m
@@ -0,0 +1,53 @@
+/* APPLE LOCAL file ObjC GC */
+/* A run-time test for insertion of write barriers. */
+/* { dg-do run { target *-*-darwin* } } */
+/* { dg-options "-fnext-runtime -fobjc-gc" } */
+
+#include <objc/objc.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+// callouts to these are generated with cc -fobjc-gc
+
+int IvarAssigns;
+
+id objc_assign_ivar(id value, id dest, unsigned int offset) {
+ id *slot = (id*) ((char *)dest + offset);
+
+ ++IvarAssigns;
+ return (*slot = value);
+}
+
+// The test case elements;
+@class NSObject;
+
+@interface Foo {
+@public
+// assignments to any/all of these fields should generate objc_assign_ivar
+ Foo *obj[20];
+ short idx[5];
+}
+@end
+
+int testIvars() {
+ Foo *foo = (Foo *)calloc(1,sizeof(Foo)); // don't call in ObjC
+ int counter = 0, errors = 0;
+ #define ASSIGNTEST(expr, global) expr = foo; if (!global) { printf(# expr " is busted\n"); ++errors; } global = 0;
+
+ ASSIGNTEST(foo->obj[5], IvarAssigns) // objc_assign_ivar
+ ASSIGNTEST(foo->obj[++counter], IvarAssigns) // objc_assign_ivar
+ foo->idx[++counter] = 15;
+ ASSIGNTEST(foo->obj[foo->idx[2]], IvarAssigns) // objc_assign_ivar
+
+ if (foo->obj[5] != foo || foo->obj[1] != foo || foo->obj[15] != foo)
+ abort();
+
+ return errors;
+}
+
+@implementation Foo
+@end
+
+int main(int argc, char *argv[]) {
+ return testIvars();
+}
diff --git a/gcc/testsuite/objc.dg/objc.c b/gcc/testsuite/objc.dg/objc.c
new file mode 100644
index 00000000000..748111c26eb
--- /dev/null
+++ b/gcc/testsuite/objc.dg/objc.c
@@ -0,0 +1,6 @@
+/* APPLE LOCAL file -ObjC */
+
+/* { dg-do compile } */
+/* { dg-options "-ObjC" } */
+
+@class foo;
diff --git a/gcc/testsuite/objc.dg/pascal-strings-1.m b/gcc/testsuite/objc.dg/pascal-strings-1.m
new file mode 100644
index 00000000000..477b94bbff2
--- /dev/null
+++ b/gcc/testsuite/objc.dg/pascal-strings-1.m
@@ -0,0 +1,20 @@
+/* APPLE LOCAL file pascal strings */
+/* Ensure that there are no warnings or errors issued when a Pascal string is used to
+ initialize an array and the NUL terminator does not fit. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+/* { dg-options "-fpascal-strings" } */
+
+typedef unsigned char Str15[16];
+
+Str15 ggg = "\p012345678901234";
+Str15 hhh = "\p0123456789012345"; /* { dg-warning "initializer.string for array of chars is too long" } */
+
+int foo(void)
+{
+ Str15 sss = "\p012345678901234";
+ Str15 ttt = "\p0123456789012345"; /* { dg-warning "initializer.string for array of chars is too long" } */
+
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/pragma-1.m b/gcc/testsuite/objc.dg/pragma-1.m
new file mode 100644
index 00000000000..b086863a997
--- /dev/null
+++ b/gcc/testsuite/objc.dg/pragma-1.m
@@ -0,0 +1,24 @@
+/* APPLE LOCAL file Objective-C++ */
+/* It is OK to use #pragma inside @implementation body. This test checks that. */
+/* Ziemowit Laski <zlaski@apple.com>. */
+
+@interface A
+{
+ int p;
+}
++(int) foo;
+-(int) bar;
+@end
+
+@implementation A
+#pragma mark -
+#pragma mark init / dealloc
++ (int)foo {
+ return 1;
+}
+#pragma mark -
+#pragma mark Private Functions
+- (int)bar {
+ return 2;
+}
+@end
diff --git a/gcc/testsuite/objc.dg/selector-2.m b/gcc/testsuite/objc.dg/selector-2.m
index 5584f1511b6..e73868a92d6 100644
--- a/gcc/testsuite/objc.dg/selector-2.m
+++ b/gcc/testsuite/objc.dg/selector-2.m
@@ -1,5 +1,6 @@
/* Test that we don't ICE when issuing a -Wselector warning. */
-/* { dg-options "-Wselector -fgnu-runtime" } */
+/* APPLE LOCAL Objective-C */
+/* { dg-options "-Wselector" } */
/* { dg-do compile } */
#include <objc/Object.h>
@@ -10,7 +11,8 @@
-(void) foo
{
SEL a;
- a = @selector(b1ar);
+ /* APPLE LOCAL Objective-C */
+ a = @selector(b1ar); /* { dg-warning "creating selector for nonexistent method .b1ar." } */
}
-@end /* { dg-warning "creating selector for nonexistent method .b1ar." } */
-
+/* APPLE LOCAL Objective-C */
+@end
diff --git a/gcc/testsuite/objc.dg/super-dealloc-1.m b/gcc/testsuite/objc.dg/super-dealloc-1.m
new file mode 100644
index 00000000000..b87af921860
--- /dev/null
+++ b/gcc/testsuite/objc.dg/super-dealloc-1.m
@@ -0,0 +1,47 @@
+/* APPLE LOCAL file ObjC super dealloc */
+/* Check for warnings about missing [super dealloc] calls. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+
+@interface Foo {
+ void *isa;
+}
+- (void) dealloc;
+- (void) some_other;
+@end
+
+@interface Bar: Foo {
+ void *casa;
+}
+- (void) dealloc;
+@end
+
+@interface Baz: Bar {
+ void *usa;
+}
+- (void) dealloc;
+@end
+
+@implementation Foo
+- (void) dealloc {
+ isa = 0; /* Should not warn here. */
+}
+- (void) some_other {
+ isa = (void *)-1;
+}
+@end
+
+@implementation Bar
+- (void) dealloc {
+ casa = 0;
+ [super some_other];
+} /* { dg-warning "method possibly missing a .super dealloc. call" } */
+@end
+
+@implementation Baz
+- (void) dealloc {
+ usa = 0;
+ [super dealloc]; /* Should not warn here. */
+}
+@end
diff --git a/gcc/testsuite/objc.dg/super-dealloc-2.m b/gcc/testsuite/objc.dg/super-dealloc-2.m
new file mode 100644
index 00000000000..52361277fe2
--- /dev/null
+++ b/gcc/testsuite/objc.dg/super-dealloc-2.m
@@ -0,0 +1,47 @@
+/* APPLE LOCAL file ObjC super dealloc */
+/* Check for warnings about missing [super dealloc] calls. */
+/* Author: Ziemowit Laski <zlaski@apple.com> */
+
+/* { dg-do compile } */
+
+@interface Foo {
+ void *isa;
+}
+- (void) dealloc;
+- (void) some_other;
+@end
+
+@interface Bar: Foo {
+ void *casa;
+}
+- (void) dealloc0;
+@end
+
+@interface Baz: Bar {
+ void *usa;
+}
+- (void) dealloc;
+@end
+
+@implementation Foo
+- (void) dealloc {
+ isa = 0; /* Should not warn here. */
+}
+- (void) some_other {
+ isa = (void *)-1;
+}
+@end
+
+@implementation Bar
+- (void) dealloc0 {
+ casa = 0;
+ [super some_other]; /* Should not warn here. */
+}
+@end
+
+@implementation Baz
+- (void) dealloc {
+ usa = 0;
+ [super dealloc0];
+} /* { dg-warning "method possibly missing a .super dealloc. call" } */
+@end
diff --git a/gcc/testsuite/objc.dg/try-catch-6.m b/gcc/testsuite/objc.dg/try-catch-6.m
new file mode 100644
index 00000000000..a9d7d147b42
--- /dev/null
+++ b/gcc/testsuite/objc.dg/try-catch-6.m
@@ -0,0 +1,29 @@
+/* APPLE LOCAL file Objective-C++ */
+/* { dg-do compile } */
+/* { dg-options "-fobjc-exceptions" } */
+
+#include <objc/Object.h>
+
+int main (int argc, const char * argv[]) {
+
+ Object * pool = [Object new];
+ int a;
+
+ if ( 1 ) {
+
+ @try {
+ a = 1;
+ }
+
+ @catch (Object *e) {
+ a = 2;
+ }
+
+ @finally {
+ a = 3;
+ }
+ }
+
+ [pool free];
+ return 0;
+}
diff --git a/gcc/testsuite/objc.dg/try-catch-7.m b/gcc/testsuite/objc.dg/try-catch-7.m
new file mode 100644
index 00000000000..4ff02b8f68d
--- /dev/null
+++ b/gcc/testsuite/objc.dg/try-catch-7.m
@@ -0,0 +1,28 @@
+/* APPLE LOCAL file */
+/* Test for graceful compilation of @synchronized statements. */
+/* { dg-do compile } */
+/* { dg-options "-fobjc-exceptions" } */
+
+#include <objc/Object.h>
+
+@interface Derived: Object
+- (id) meth;
+@end
+
+@implementation Derived
+- (id) meth {
+ return self;
+}
+
+static Derived* rewriteDict(void) {
+ static Derived *sDict = 0;
+ if (sDict == 0) {
+ @synchronized ([Derived class]) {
+ if (sDict == 0)
+ sDict = [Derived new];
+ }
+ }
+ return sDict;
+}
+@end
+
diff --git a/gcc/testsuite/objc/execute/next_mapping.h b/gcc/testsuite/objc/execute/next_mapping.h
index 0a361896e12..4ce900cb807 100644
--- a/gcc/testsuite/objc/execute/next_mapping.h
+++ b/gcc/testsuite/objc/execute/next_mapping.h
@@ -8,6 +8,10 @@
#include <objc/objc-class.h>
#include <objc/Object.h>
#include <ctype.h>
+/* APPLE LOCAL begin Objective-C++ */
+#include <stdlib.h>
+#include <string.h>
+/* APPLE LOCAL end Objective-C++ */
#define objc_get_class(C) objc_getClass(C)
#define objc_get_meta_class(C) objc_getMetaClass(C)
@@ -44,23 +48,33 @@
/* The following is necessary to "cover" the bf*.m test cases on NeXT. */
+/* APPLE LOCAL begin Objective-C++ */
#undef MAX
+#undef MIN
+#undef ROUND
+
+#ifdef __cplusplus
+#define MAX(X, Y) ((X > Y) ? X : Y)
+#define MIN(X, Y) ((X < Y) ? X : Y)
+#define ROUND(V, A) (A * ((V + A - 1) / A))
+#else
#define MAX(X, Y) \
({ typeof (X) __x = (X), __y = (Y); \
(__x > __y ? __x : __y); })
-
-#undef MIN
#define MIN(X, Y) \
({ typeof (X) __x = (X), __y = (Y); \
(__x < __y ? __x : __y); })
-
-#undef ROUND
#define ROUND(V, A) \
({ typeof (V) __v = (V); typeof (A) __a = (A); \
__a * ((__v+__a - 1)/__a); })
+#endif
+/* APPLE LOCAL end Objective-C++ */
#define BITS_PER_UNIT __CHAR_BIT__
-#define STRUCTURE_SIZE_BOUNDARY (BITS_PER_UNIT * sizeof (struct{char a;}))
+/* APPLE LOCAL begin Objective-C++ */
+typedef struct{ char a; } __small_struct;
+#define STRUCTURE_SIZE_BOUNDARY (BITS_PER_UNIT * sizeof (__small_struct))
+/* APPLE LOCAL end Objective-C++ */
/* Not sure why the following are missing from NeXT objc headers... */
@@ -104,7 +118,8 @@ struct objc_struct_layout
unsigned int record_align;
};
-typedef union {
+/* APPLE LOCAL Objective-C++ */
+typedef union arglist {
char *arg_ptr;
char arg_regs[sizeof (char*)];
} *arglist_t; /* argument frame */
@@ -117,6 +132,8 @@ void objc_layout_structure (const char *type,
BOOL objc_layout_structure_next_member (struct objc_struct_layout *layout);
void objc_layout_finish_structure (struct objc_struct_layout *layout,
unsigned int *size, unsigned int *align);
+/* APPLE LOCAL Objective-C++ */
+int objc_aligned_size (const char *type);
/*
return the size of an object specified by type
@@ -193,9 +210,8 @@ objc_sizeof_type (const char *type)
return sizeof (double);
break;
- case _C_VOID:
- return sizeof (void);
- break;
+ /* APPLE LOCAL Objective-C++ */
+ /* Do not compute 'sizeof (void)'. */
case _C_PTR:
case _C_ATOM:
diff --git a/gcc/timevar.c b/gcc/timevar.c
index ffcd9e00876..6be20b2a3d9 100644
--- a/gcc/timevar.c
+++ b/gcc/timevar.c
@@ -27,6 +27,17 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
#endif
+
+/* APPLE LOCAL begin Mach time */
+#ifdef HAVE_MACH_MACH_TIME_H
+#include <mach/mach_time.h>
+#define HAVE_MACH_TIME 1
+static double timeBaseRatio;
+static struct mach_timebase_info tbase;
+#else
+#define HAVE_MACH_TIME 0
+#endif
+/* APPLE LOCAL end Mach time */
#include "coretypes.h"
#include "tm.h"
#include "intl.h"
@@ -69,6 +80,34 @@ struct tms
/* Prefer times to getrusage to clock (each gives successively less
information). */
+/* APPLE LOCAL begin Mach time */
+/* On Darwin, prefer getrusage, plus Mach absolute time for the wall
+ clock time. Use PPC intrinsics if possible. */
+#if defined(__APPLE__) && defined(__POWERPC__) && HAVE_MACH_TIME
+#if __POWERPC__
+# include "../more-hdrs/ppc_intrinsics.h"
+# define HAVE_WALL_TIME
+# define USE_PPC_INTRINSICS
+static inline double
+ppc_intrinsic_time (void)
+{
+ unsigned long hi, lo;
+ do
+ {
+ hi = __mftbu();
+ lo = __mftb();
+ } while (hi != (unsigned long) __mftbu());
+ return (hi * 0x100000000ull + lo) * timeBaseRatio;
+}
+#endif /* __POWERPC__ */
+#elif HAVE_MACH_TIME
+# define USE_GETRUSAGE
+# define USE_MACH_TIME
+# define HAVE_USER_TIME
+# define HAVE_SYS_TIME
+# define HAVE_WALL_TIME
+# else
+/* APPLE LOCAL end Mach time */
#ifdef HAVE_TIMES
# if defined HAVE_DECL_TIMES && !HAVE_DECL_TIMES
extern clock_t times (struct tms *);
@@ -95,6 +134,8 @@ struct tms
#endif
#endif
#endif
+/* APPLE LOCAL Mach time */
+#endif /* HAVE_MACH_TIME */
/* libc is very likely to have snuck a call to sysconf() into one of
the underlying constants, and that can be very slow, so we have to
@@ -203,6 +244,14 @@ get_time (struct timevar_time_def *now)
#ifdef USE_CLOCK
now->user = clock () * clocks_to_msec;
#endif
+ /* APPLE LOCAL begin Mach time */
+#ifdef USE_MACH_TIME
+ now->wall = mach_absolute_time() * timeBaseRatio;
+#endif
+#ifdef USE_PPC_INTRINSICS
+ now->wall = ppc_intrinsic_time();
+#endif
+ /* APPLE LOCAL end Mach time */
}
}
@@ -240,6 +289,12 @@ timevar_init (void)
#ifdef USE_CLOCK
clocks_to_msec = CLOCKS_TO_MSEC;
#endif
+ /* APPLE LOCAL begin Mach time */
+#if defined(USE_MACH_TIME) || defined(USE_PPC_INTRINSICS)
+ mach_timebase_info(&tbase);
+ timeBaseRatio = ((double) tbase.numer / (double) tbase.denom) * 1e-9;
+#endif
+ /* APPLE LOCAL end Mach time */
}
/* Push TIMEVAR onto the timing stack. No further elapsed time is
@@ -450,14 +505,19 @@ timevar_print (FILE *fp)
/* Print total time. */
fputs (_(" TOTAL :"), fp);
#ifdef HAVE_USER_TIME
- fprintf (fp, "%7.2f ", total->user);
+ /* APPLE LOCAL time formatting */
+ fprintf (fp, "%7.2f", total->user);
#endif
#ifdef HAVE_SYS_TIME
- fprintf (fp, "%7.2f ", total->sys);
+ /* APPLE LOCAL time formatting */
+ fprintf (fp, " %7.2f", total->sys);
#endif
#ifdef HAVE_WALL_TIME
- fprintf (fp, "%7.2f\n", total->wall);
+ /* APPLE LOCAL time formatting */
+ fprintf (fp, " %7.2f", total->wall);
#endif
+ /* APPLE LOCAL time formatting */
+ putc ('\n', fp);
#ifdef ENABLE_CHECKING
fprintf (fp, "Extra diagnostic checks enabled; compiler may run slowly.\n");
diff --git a/gcc/timevar.def b/gcc/timevar.def
index e116f4bbfb2..7e38d9cacf1 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -87,7 +87,14 @@ DEFTIMEVAR (TV_TREE_DSE , "tree DSE")
DEFTIMEVAR (TV_TREE_MERGE_PHI , "PHI merge")
DEFTIMEVAR (TV_TREE_LOOP , "tree loop optimization")
DEFTIMEVAR (TV_TREE_LOOP_BOUNDS , "tree record loop bounds")
+/* APPLE LOCAL begin lno */
+DEFTIMEVAR (TV_MARK_MILOOPS , "mark maybe infinite loops")
+DEFTIMEVAR (TV_TREE_PREFETCH , "tree prefetching")
+DEFTIMEVAR (TV_DEP_GRAPH , "data dependences graph")
+/* APPLE LOCAL end lno */
DEFTIMEVAR (TV_LIM , "loop invariant motion")
+/* APPLE LOCAL lno */
+DEFTIMEVAR (TV_UNSWITCH , "loop unswitching")
DEFTIMEVAR (TV_TREE_LOOP_IVCANON , "tree canonical iv creation")
DEFTIMEVAR (TV_TREE_LOOP_UNSWITCH , "tree loop unswitching")
DEFTIMEVAR (TV_COMPLETE_UNROLL , "complete unrolling")
@@ -147,6 +154,8 @@ DEFTIMEVAR (TV_SHORTEN_BRANCH , "shorten branches")
DEFTIMEVAR (TV_REG_STACK , "reg stack")
DEFTIMEVAR (TV_FINAL , "final")
DEFTIMEVAR (TV_SYMOUT , "symout")
+/* APPLE LOCAL overload resolution */
+DEFTIMEVAR (TV_OV_RESOLUTION , "overload resolution")
DEFTIMEVAR (TV_VAR_TRACKING , "variable tracking")
/* Everything else in rest_of_compilation not included above. */
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 99704a43090..ffda2d41c2e 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -108,6 +108,8 @@ static void init_asm_output (const char *);
static void finalize (void);
static void crash_signal (int) ATTRIBUTE_NORETURN;
+/* APPLE LOCAL interrupt signal handler (radar 2941633) --ilr */
+static void interrupt_signal (int) ATTRIBUTE_NORETURN;
static void setup_core_dumping (void);
static void compile_file (void);
@@ -252,6 +254,19 @@ int flag_signed_char;
int flag_short_enums;
+/* APPLE LOCAL begin -fast */
+/* Nonzero if we should perform SPEC oriented optimizations. */
+int flag_fast = 0;
+int flag_fastf = 0;
+int flag_fastcp = 0;
+/* APPLE LOCAL end -fast */
+
+/* APPLE LOCAL begin -ffppc 2001-08-01 --sts */
+/* Nonzero if the floating point precision control pass should
+ be performed. (x86 only really, but we pretend it's generic) */
+int flag_fppc = 0;
+/* APPLE LOCAL end -ffppc 2001-08-01 --sts */
+
/* Nonzero if structures and unions should be returned in memory.
This should only be defined if compatibility with another compiler or
@@ -265,12 +280,29 @@ int flag_short_enums;
int flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
+/* APPLE LOCAL begin fwritable strings */
+/* Nonzero for -fwritable-strings:
+ store string constants in data segment and don't uniquize them. */
+
+int flag_writable_strings = 0;
+/* APPLE LOCAL end fwritable strings */
+
+/* APPLE LOCAL Altivec */
+int flag_disable_opts_for_faltivec = 0;
+
/* 0 means straightforward implementation of complex divide acceptable.
1 means wide ranges of inputs must work for complex divide.
2 means C99-like requirements for complex multiply and divide. */
int flag_complex_method = 0;
+/* APPLE LOCAL begin -fobey-inline */
+/* Nonzero for -fobey-inline: 'inline' keyword must be obeyed, regardless
+ of codesize. */
+
+int flag_obey_inline;
+/* APPLE LOCAL end -fobey-inline */
+
/* Nonzero means that we don't want inlining by virtue of -fno-inline,
not just because the tree inliner turned us off. */
@@ -325,6 +357,10 @@ rtx stack_limit_rtx;
one, unconditionally renumber instruction UIDs. */
int flag_renumber_insns = 1;
+/* APPLE LOCAL begin predictive compilation */
+int predictive_compilation = -1;
+/* APPLE LOCAL end predictive compilation */
+
/* Nonzero if we should track variables. When
flag_var_tracking == AUTODETECT_FLAG_VAR_TRACKING it will be set according
to optimize, debug_info_level and debug_hooks in process_options (). */
@@ -575,6 +611,30 @@ floor_log2 (unsigned HOST_WIDE_INT x)
return t;
}
+/* APPLE LOCAL begin interrupt signal handler (radar 2941633) --ilr */
+/* If the compilation is interrupted do some cleanup. Any files created
+ by the compilation are deleted. The compilation is terminated from
+ here. */
+static void
+interrupt_signal (int signo ATTRIBUTE_UNUSED)
+{
+ /* Close the dump files. */
+ if (flag_gen_aux_info)
+ {
+ fclose (aux_info_file);
+ unlink (aux_info_file_name);
+ }
+ if (asm_out_file)
+ {
+ fclose (asm_out_file);
+ if (asm_file_name && *asm_file_name)
+ unlink (asm_file_name);
+ }
+
+ exit (FATAL_EXIT_CODE);
+}
+/* APPLE LOCAL end interrupt signal handler */
+
/* Return the logarithm of X, base 2, considering X unsigned,
if X is a power of 2. Otherwise, returns -1. */
@@ -935,6 +995,46 @@ warn_deprecated_use (tree node)
}
}
+/* APPLE LOCAL begin "unavailable" attribute (radar 2809697) --ilr */
+/* Warn about a use of an identifier which was marked deprecated. */
+void
+warn_unavailable_use (tree node)
+{
+ if (node == 0)
+ return;
+
+ if (DECL_P (node))
+ warning ("%qs is unavailable (declared at %s:%d)",
+ IDENTIFIER_POINTER (DECL_NAME (node)),
+ DECL_SOURCE_FILE (node), DECL_SOURCE_LINE (node));
+ else if (TYPE_P (node))
+ {
+ const char *what = NULL;
+ tree decl = TYPE_STUB_DECL (node);
+
+ if (TREE_CODE (TYPE_NAME (node)) == IDENTIFIER_NODE)
+ what = IDENTIFIER_POINTER (TYPE_NAME (node));
+ else if (TREE_CODE (TYPE_NAME (node)) == TYPE_DECL
+ && DECL_NAME (TYPE_NAME (node)))
+ what = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (node)));
+
+ if (what)
+ {
+ if (decl)
+ warning ("%qs is unavailable (declared at %s:%d)", what,
+ DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ else
+ warning ("%qs is unavailable", what);
+ }
+ else if (decl)
+ warning ("type is unavailable (declared at %s:%d)",
+ DECL_SOURCE_FILE (decl), DECL_SOURCE_LINE (decl));
+ else
+ warning ("type is unavailable");
+ }
+}
+/* APPLE LOCAL end "unavailable" attribute (radar 2809697) --ilr */
+
/* Save the current INPUT_LOCATION on the top entry in the
INPUT_FILE_STACK. Push a new entry for FILE and LINE, and set the
INPUT_LOCATION accordingly. */
@@ -1326,6 +1426,18 @@ print_switch_values (FILE *file, int pos, int max,
continue;
if ((*p)[1] == 'd')
continue;
+ /* APPLE LOCAL begin -fast or -fastf or -fastcp */
+ if ((flag_fast || flag_fastf || flag_fastcp)
+ && (*p)[0] == '-' && (*p)[1] == 'O')
+ {
+ int optimize_val;
+ if ((*p)[2] == 's' && (*p)[3] == '\0')
+ continue;
+ optimize_val = read_integral_parameter (*p+2, 0, -1);
+ if (optimize_val != 3)
+ continue;
+ }
+ /* APPLE LOCAL end -fast or -fastf or -fastcp */
pos = print_single_switch (file, pos, max, indent, sep, term, *p, "");
}
@@ -1628,6 +1740,15 @@ general_init (const char *argv0)
#if defined SIGIOT && (!defined SIGABRT || SIGABRT != SIGIOT)
signal (SIGIOT, crash_signal);
#endif
+ /* APPLE LOCAL begin interrupt signal handler (radar 2941633) --ilr */
+ /* Handle compilation interrupts. */
+ if (signal (SIGINT, SIG_IGN) != SIG_IGN)
+ signal (SIGINT, interrupt_signal);
+ if (signal (SIGKILL, SIG_IGN) != SIG_IGN)
+ signal (SIGINT, interrupt_signal);
+ if (signal (SIGTERM, SIG_IGN) != SIG_IGN)
+ signal (SIGTERM, interrupt_signal);
+ /* APPLE LOCAL end interrupt signal handler */
#ifdef SIGFPE
signal (SIGFPE, crash_signal);
#endif
@@ -1635,6 +1756,22 @@ general_init (const char *argv0)
/* Other host-specific signal setup. */
(*host_hooks.extra_signals)();
+ /* APPLE LOCAL begin setrlimit */
+#ifdef RLIMIT_STACK
+ /* Get rid of any avoidable limit on stack size. */
+ {
+ struct rlimit rlim;
+
+ /* Set the stack limit huge. (Compiles normally work within
+ a megabyte of stack, but the normal limit on OSX is 512K for
+ some reason.) */
+ getrlimit (RLIMIT_STACK, &rlim);
+ rlim.rlim_cur = rlim.rlim_max;
+ setrlimit (RLIMIT_STACK, &rlim);
+ }
+#endif /* RLIMIT_STACK defined */
+ /* APPLE LOCAL end setrlimit */
+
/* Initialize the garbage-collector, string pools and tree type hash
table. */
init_ggc ();
@@ -2012,6 +2149,8 @@ lang_dependent_init (const char *name)
provide a dummy function context for them. */
init_dummy_function_start ();
init_expr_once ();
+ /* APPLE LOCAL lno */
+ init_set_costs ();
expand_dummy_function_end ();
/* If dbx symbol table desired, initialize writing it and output the
diff --git a/gcc/toplev.h b/gcc/toplev.h
index a1a388ba73f..03eb4eadd00 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -85,6 +85,8 @@ extern void announce_function (tree);
extern void error_for_asm (rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
extern void warning_for_asm (rtx, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
extern void warn_deprecated_use (tree);
+/* APPLE LOCAL "unavailable" attribute (radar 2809697) */
+extern void warn_unavailable_use (tree);
#ifdef BUFSIZ
extern void output_quoted_string (FILE *, const char *);
@@ -135,6 +137,8 @@ extern int flag_unswitch_loops;
extern int flag_cprop_registers;
extern int time_report;
extern int flag_tree_based_profiling;
+/* APPLE LOCAL lno */
+extern int flag_loop_optimize2;
/* Things to do with target switches. */
extern void display_target_options (void);
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index cade864f191..045de81e779 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -4466,7 +4466,8 @@ tree_redirect_edge_and_branch (edge e, basic_block dest)
return ret;
if (e->dest == dest)
- return NULL;
+ /* APPLE LOCAL lno */
+ return e;
label = tree_block_label (dest);
@@ -4609,9 +4610,17 @@ tree_split_block (basic_block bb, void *stmt)
bsi_tgt = bsi_start (new_bb);
while (!bsi_end_p (bsi))
{
+ /* APPLE LOCAL lno */
+ bool was_modified;
act = bsi_stmt (bsi);
+ /* APPLE LOCAL lno */
+ was_modified = stmt_modified_p (act);
bsi_remove (&bsi);
bsi_insert_after (&bsi_tgt, act, BSI_NEW_STMT);
+ /* APPLE LOCAL begin lno */
+ if (!was_modified)
+ unmodify_stmt (act);
+ /* APPLE LOCAL end lno */
}
return new_bb;
@@ -5272,12 +5281,21 @@ print_loop_ir (FILE *file)
/* Debugging loops structure at tree level. */
+/* APPLE LOCAL begin lno */
void
-debug_loop_ir (void)
+tree_debug_loops (void)
{
print_loop_ir (stderr);
}
+/* Debugging loops structure at tree level. */
+
+void
+tree_debug_loop (struct loop *loop)
+{
+ print_loop (stderr, loop, 0);
+}
+/* APPLE LOCAL end lno */
/* Return true if BB ends with a call, possibly followed by some
instructions that must stay with the call. Return false,
@@ -5287,6 +5305,10 @@ static bool
tree_block_ends_with_call_p (basic_block bb)
{
block_stmt_iterator bsi = bsi_last (bb);
+ /* APPLE LOCAL begin tree-profiling-branch --dbj */
+ if (bsi_end_p (bsi))
+ return false;
+ /* APPLE LOCAL end tree-profiling-branch --dbj */
return get_call_expr_in (bsi_stmt (bsi)) != NULL;
}
@@ -5297,8 +5319,15 @@ tree_block_ends_with_call_p (basic_block bb)
static bool
tree_block_ends_with_condjump_p (basic_block bb)
{
- tree stmt = tsi_stmt (bsi_last (bb).tsi);
- return (TREE_CODE (stmt) == COND_EXPR);
+ /* APPLE LOCAL begin tree-profiling-branch --dbj */
+ block_stmt_iterator bsi = bsi_last (bb);
+ if (!bsi_end_p (bsi))
+ {
+ tree stmt = bsi_stmt (bsi);
+ return (TREE_CODE (stmt) == COND_EXPR);
+ }
+ else return false;
+ /* APPLE LOCAL end tree-profiling-branch --dbj */
}
diff --git a/gcc/tree-chrec.c b/gcc/tree-chrec.c
index 54960449217..46b54e7862f 100644
--- a/gcc/tree-chrec.c
+++ b/gcc/tree-chrec.c
@@ -1,5 +1,6 @@
/* Chains of recurrences.
- Copyright (C) 2003, 2004 Free Software Foundation, Inc.
+ APPLE LOCAL mainline 2005-03-04
+ Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
Contributed by Sebastian Pop <s.pop@laposte.net>
This file is part of GCC.
@@ -383,64 +384,114 @@ chrec_fold_multiply (tree type,
/* Operations. */
-/* The factorial. */
-
+/* APPLE LOCAL begin mainline 2005-03-04 */
+/* Evaluate the binomial coefficient. Return NULL_TREE if the intermediate
+ calculation overflows, otherwise return C(n,k) with type TYPE. */
+
static tree
-tree_fold_factorial (tree f)
+tree_fold_binomial (tree type, tree n, unsigned int k)
{
- if (tree_int_cst_sgn (f) <= 0)
- return integer_one_node;
+ unsigned HOST_WIDE_INT lidx, lnum, ldenom, lres, ldum;
+ HOST_WIDE_INT hidx, hnum, hdenom, hres, hdum;
+ unsigned int i;
+ tree res;
+
+ /* Handle the most frequent cases. */
+ if (k == 0)
+ return build_int_cst (type, 1);
+ if (k == 1)
+ return fold_convert (type, n);
+
+ /* Check that k <= n. */
+ if (TREE_INT_CST_HIGH (n) == 0
+ && TREE_INT_CST_LOW (n) < k)
+ return NULL_TREE;
+
+ /* Numerator = n. */
+ lnum = TREE_INT_CST_LOW (n);
+ hnum = TREE_INT_CST_HIGH (n);
+
+ /* Denominator = 2. */
+ ldenom = 2;
+ hdenom = 0;
+
+ /* Index = Numerator-1. */
+ if (lnum == 0)
+ {
+ hidx = hnum - 1;
+ lidx = ~ (unsigned HOST_WIDE_INT) 0;
+ }
else
- return fold
- (build (MULT_EXPR, integer_type_node, f,
- tree_fold_factorial (fold (build (MINUS_EXPR, integer_type_node,
- f, integer_one_node)))));
-}
+ {
+ hidx = hnum;
+ lidx = lnum - 1;
+ }
-/* The binomial coefficient. */
+ /* Numerator = Numerator*Index = n*(n-1). */
+ if (mul_double (lnum, hnum, lidx, hidx, &lnum, &hnum))
+ return NULL_TREE;
-static tree
-tree_fold_binomial (tree n,
- tree k)
-{
- return fold
- (build (EXACT_DIV_EXPR, integer_type_node, tree_fold_factorial (n),
- fold (build (MULT_EXPR, integer_type_node,
- tree_fold_factorial (k),
- tree_fold_factorial
- (fold (build (MINUS_EXPR, integer_type_node,
- n, k)))))));
+ for (i = 3; i <= k; i++)
+ {
+ /* Index--. */
+ if (lidx == 0)
+ {
+ hidx--;
+ lidx = ~ (unsigned HOST_WIDE_INT) 0;
+ }
+ else
+ lidx--;
+
+ /* Numerator *= Index. */
+ if (mul_double (lnum, hnum, lidx, hidx, &lnum, &hnum))
+ return NULL_TREE;
+
+ /* Denominator *= i. */
+ mul_double (ldenom, hdenom, i, 0, &ldenom, &hdenom);
+ }
+
+ /* Result = Numerator / Denominator. */
+ div_and_round_double (EXACT_DIV_EXPR, 1, lnum, hnum, ldenom, hdenom,
+ &lres, &hres, &ldum, &hdum);
+
+ res = build_int_cst_wide (type, lres, hres);
+ return int_fits_type_p (res, type) ? res : NULL_TREE;
}
/* Helper function. Use the Newton's interpolating formula for
evaluating the value of the evolution function. */
static tree
-chrec_evaluate (unsigned var,
- tree chrec,
- tree n,
- tree k)
+chrec_evaluate (unsigned var, tree chrec, tree n, unsigned int k)
{
- tree type = chrec_type (chrec);
- tree binomial_n_k = tree_fold_binomial (n, k);
-
- if (TREE_CODE (chrec) == POLYNOMIAL_CHREC)
+ tree arg0, arg1, binomial_n_k;
+ tree type = TREE_TYPE (chrec);
+
+ while (TREE_CODE (chrec) == POLYNOMIAL_CHREC
+ && CHREC_VARIABLE (chrec) > var)
+ chrec = CHREC_LEFT (chrec);
+
+ if (TREE_CODE (chrec) == POLYNOMIAL_CHREC
+ && CHREC_VARIABLE (chrec) == var)
{
- if (CHREC_VARIABLE (chrec) > var)
- return chrec_evaluate (var, CHREC_LEFT (chrec), n, k);
-
- if (CHREC_VARIABLE (chrec) == var)
- return chrec_fold_plus
- (type,
- fold (build (MULT_EXPR, type, binomial_n_k, CHREC_LEFT (chrec))),
- chrec_evaluate (var, CHREC_RIGHT (chrec), n,
- fold (build (PLUS_EXPR, type, k, integer_one_node))));
-
- return fold (build (MULT_EXPR, type, binomial_n_k, chrec));
+ arg0 = chrec_evaluate (var, CHREC_RIGHT (chrec), n, k + 1);
+ if (arg0 == chrec_dont_know)
+ return chrec_dont_know;
+ binomial_n_k = tree_fold_binomial (type, n, k);
+ if (!binomial_n_k)
+ return chrec_dont_know;
+ arg1 = fold (build2 (MULT_EXPR, type,
+ CHREC_LEFT (chrec), binomial_n_k));
+ return chrec_fold_plus (type, arg0, arg1);
}
- else
- return fold (build (MULT_EXPR, type, binomial_n_k, chrec));
+
+ binomial_n_k = tree_fold_binomial (type, n, k);
+ if (!binomial_n_k)
+ return chrec_dont_know;
+
+ return fold (build2 (MULT_EXPR, type, chrec, binomial_n_k));
}
+/* APPLE LOCAL end mainline */
/* Evaluates "CHREC (X)" when the varying variable is VAR.
Example: Given the following parameters,
@@ -493,7 +544,8 @@ chrec_apply (unsigned var,
else if (TREE_CODE (x) == INTEGER_CST
&& tree_int_cst_sgn (x) == 1)
/* testsuite/.../ssa-chrec-38.c. */
- res = chrec_evaluate (var, chrec, x, integer_zero_node);
+ /* APPLE LOCAL mainline 2005-03-04 */
+ res = chrec_evaluate (var, chrec, x, 0);
else
res = chrec_dont_know;
diff --git a/gcc/tree-data-ref.c b/gcc/tree-data-ref.c
index 55b34fbb73f..d88667150a9 100644
--- a/gcc/tree-data-ref.c
+++ b/gcc/tree-data-ref.c
@@ -652,7 +652,11 @@ all_chrecs_equal_p (tree chrec)
/* Determine for each subscript in the data dependence relation DDR
the distance. */
-static void
+/* APPLE LOCAL begin AV data dependence. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004.
+ Make this function externally visible. */
+void
+/* APPLE LOCAL end AV data dependence. -dpatel */
compute_subscript_distance (struct data_dependence_relation *ddr)
{
if (DDR_ARE_DEPENDENT (ddr) == NULL_TREE)
@@ -1775,7 +1779,11 @@ subscript_dependence_tester (struct data_dependence_relation *ddr)
starting at FIRST_LOOP_DEPTH.
Return TRUE otherwise. */
-static bool
+/* APPLE LOCAL begin AV data dependence. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004.
+ Make this function externally visible. */
+bool
+/* APPLE LOCAL end AV data dependence. -dpatel */
build_classic_dist_vector (struct data_dependence_relation *ddr,
int nb_loops, int first_loop_depth)
{
diff --git a/gcc/tree-data-ref.h b/gcc/tree-data-ref.h
index ea3bb7ddd30..629901cb99d 100644
--- a/gcc/tree-data-ref.h
+++ b/gcc/tree-data-ref.h
@@ -155,6 +155,13 @@ extern tree find_data_references_in_loop (struct loop *, varray_type *);
extern struct data_dependence_relation *initialize_data_dependence_relation
(struct data_reference *, struct data_reference *);
extern void compute_affine_dependence (struct data_dependence_relation *);
+/* APPLE LOCAL begin AV data dependence. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004.
+ Make these two functions externally visible. */
+extern void compute_subscript_distance (struct data_dependence_relation *);
+extern bool build_classic_dist_vector (struct data_dependence_relation *, int,
+ int);
+/* APPLE LOCAL end AV data dependence. -dpatel */
extern void analyze_all_data_dependences (struct loops *);
extern void compute_data_dependences_for_loop (unsigned, struct loop *,
varray_type *, varray_type *);
diff --git a/gcc/tree-flow.h b/gcc/tree-flow.h
index 80ad68680a8..d74bc89cb82 100644
--- a/gcc/tree-flow.h
+++ b/gcc/tree-flow.h
@@ -474,6 +474,10 @@ extern void debug_tree_cfg (int);
extern void dump_cfg_stats (FILE *);
extern void debug_cfg_stats (void);
extern void debug_loop_ir (void);
+/* APPLE LOCAL begin lno */
+extern void tree_debug_loop (struct loop *);
+extern void tree_debug_loops (void);
+/* APPLE LOCAL end lno */
extern void print_loop_ir (FILE *);
extern void cleanup_dead_labels (void);
extern void group_case_labels (void);
@@ -657,6 +661,9 @@ bool empty_block_p (basic_block);
/* In tree-ssa-loop*.c */
+/* APPLE LOCAL begin loops-to-memset */
+void tree_ssa_memset (struct loops *);
+/* APPLE LOCAL end loops-to-memset */
void tree_ssa_lim (struct loops *);
void tree_ssa_unswitch_loops (struct loops *);
void canonicalize_induction_variables (struct loops *);
@@ -704,6 +711,13 @@ enum move_pos
};
extern enum move_pos movement_possibility (tree);
+/* APPLE LOCAL begin lno */
+/* In tree-ssa-loop*.c */
+struct loops *tree_loop_optimizer_init (FILE *);
+void tree_ssa_prefetch_arrays (struct loops *);
+void mark_maybe_infinite_loops (struct loops *);
+/* APPLE LOCAL end lno */
+
/* In tree-flow-inline.h */
static inline bool is_call_clobbered (tree);
static inline void mark_call_clobbered (tree);
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index fbcbe1ca5d7..7ef77cc30cb 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -821,7 +821,8 @@ process_phi_nodes (struct loop *loop)
/* Replace phi nodes with cond. modify expr. */
for (i = 1; i < orig_loop_num_nodes; i++)
{
- tree phi, cond;
+ /* APPLE LOCAL dunno why this is necessary */
+ tree phi, cond = NULL_TREE;
block_stmt_iterator bsi;
basic_block true_bb = NULL;
bb = ifc_bbs[i];
diff --git a/gcc/tree-nested.c b/gcc/tree-nested.c
index b1ab217340b..67f7617db7a 100644
--- a/gcc/tree-nested.c
+++ b/gcc/tree-nested.c
@@ -411,7 +411,8 @@ get_trampoline_type (void)
/* If we won't be able to guarantee alignment simply via TYPE_ALIGN,
then allocate extra space so that we can do dynamic alignment. */
- if (align > STACK_BOUNDARY)
+ /* APPLE LOCAL STACK_BOUNDARY must be a signed expression on Darwin/x86 */
+ if (align > (unsigned int) STACK_BOUNDARY)
{
size += ((align/BITS_PER_UNIT) - 1) & -(STACK_BOUNDARY/BITS_PER_UNIT);
align = STACK_BOUNDARY;
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index 8006a2cdac6..35c6e9202ad 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -414,9 +414,18 @@ init_tree_optimization_passes (void)
NEXT_PASS (pass_record_bounds);
NEXT_PASS (pass_linear_transform);
NEXT_PASS (pass_iv_canon);
+ /* APPLE LOCAL begin loops-to-memset */
+ NEXT_PASS (pass_memset);
+ /* APPLE LOCAL end loops-to-memset */
+ /* APPLE LOCAL begin lno */
+ NEXT_PASS (pass_loop_test);
+ NEXT_PASS (pass_mark_maybe_inf_loops);
+ /* APPLE LOCAL end lno */
NEXT_PASS (pass_if_conversion);
NEXT_PASS (pass_vectorize);
NEXT_PASS (pass_complete_unroll);
+ /* APPLE LOCAL lno */
+ NEXT_PASS (pass_loop_prefetch);
NEXT_PASS (pass_iv_optimize);
NEXT_PASS (pass_loop_done);
*p = NULL;
@@ -439,6 +448,14 @@ execute_todo (int properties, unsigned int flags)
rewrite_into_ssa (false);
bitmap_clear (vars_to_rename);
}
+ /* APPLE LOCAL begin lno */
+ if (flags & TODO_write_loop_closed)
+ {
+ rewrite_into_ssa (false);
+ rewrite_into_loop_closed_ssa ();
+ bitmap_clear (vars_to_rename);
+ }
+ /* APPLE LOCAL end lno */
if (flags & TODO_fix_def_def_chains)
{
rewrite_def_def_chains ();
diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h
index 6bedfcb94d1..4912d90ec51 100644
--- a/gcc/tree-pass.h
+++ b/gcc/tree-pass.h
@@ -109,6 +109,10 @@ struct dump_file_info
#define TODO_verify_stmts (1 << 5)
#define TODO_fix_def_def_chains (1 << 6) /* rewrite def-def chains */
#define TODO_cleanup_cfg (1 << 7) /* cleanup the cfg. */
+/* APPLE LOCAL begin lno */
+/* well not exactly, this was 2 in lno, renumbered to mimize diffs */
+#define TODO_write_loop_closed (1 << 8) /* rewrite into loop-closed-ssa */
+/* APPLE LOCAL end lno */
#define TODO_verify_all \
(TODO_verify_ssa | TODO_verify_flow | TODO_verify_stmts)
@@ -127,14 +131,24 @@ extern struct tree_opt_pass pass_tail_recursion;
extern struct tree_opt_pass pass_tail_calls;
extern struct tree_opt_pass pass_loop;
extern struct tree_opt_pass pass_loop_init;
+/* APPLE LOCAL lno */
+extern struct tree_opt_pass pass_loop_test;
extern struct tree_opt_pass pass_lim;
+/* APPLE LOCAL begin loops-to-memset */
+extern struct tree_opt_pass pass_memset;
+/* APPLE LOCAL end loops-to-memset */
extern struct tree_opt_pass pass_unswitch;
+/* APPLE LOCAL begin lno */
+extern struct tree_opt_pass pass_mark_maybe_inf_loops;
+/* APPLE LOCAL end lno */
extern struct tree_opt_pass pass_iv_canon;
extern struct tree_opt_pass pass_record_bounds;
extern struct tree_opt_pass pass_if_conversion;
extern struct tree_opt_pass pass_vectorize;
extern struct tree_opt_pass pass_complete_unroll;
extern struct tree_opt_pass pass_iv_optimize;
+/* APPLE LOCAL lno */
+extern struct tree_opt_pass pass_loop_prefetch;
extern struct tree_opt_pass pass_loop_done;
extern struct tree_opt_pass pass_ch;
extern struct tree_opt_pass pass_ccp;
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index ad8bc53718f..be665a2aefd 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -35,6 +35,8 @@ Boston, MA 02111-1307, USA. */
#include "function.h"
#include "diagnostic.h"
#include "timevar.h"
+/* APPLE LOCAL lno */
+#include "cfgloop.h"
#include "tree-dump.h"
#include "tree-flow.h"
#include "domwalk.h"
@@ -367,8 +369,15 @@ static void
tree_ssa_dominator_optimize (void)
{
struct dom_walk_data walk_data;
+ /* APPLE LOCAL lno */
+ struct loops *loops;
unsigned int i;
+ /* APPLE LOCAL begin lno */
+ /* Compute the natural loops. */
+ loops = loop_optimizer_init (NULL);
+ /* APPLE LOCAL end lno */
+
memset (&opt_stats, 0, sizeof (opt_stats));
for (i = 0; i < num_referenced_vars; i++)
@@ -481,6 +490,10 @@ tree_ssa_dominator_optimize (void)
}
while (optimize > 1 && cfg_altered);
+ /* APPLE LOCAL begin lno */
+ loop_optimizer_finalize (loops, NULL);
+ /* APPLE LOCAL end lno */
+
/* Debugging dumps. */
if (dump_file && (dump_flags & TDF_STATS))
dump_dominator_optimization_stats (dump_file);
@@ -1662,8 +1675,11 @@ simplify_rhs_and_lookup_avail_expr (struct dom_walk_data *walk_data,
tree rhs_def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
/* See if the RHS_DEF_STMT has the same form as our statement. */
+ /* APPLE LOCAL begin lno */
if (TREE_CODE (rhs_def_stmt) == MODIFY_EXPR
- && TREE_CODE (TREE_OPERAND (rhs_def_stmt, 1)) == rhs_code)
+ && TREE_CODE (TREE_OPERAND (rhs_def_stmt, 1)) == rhs_code
+ && loop_containing_stmt (rhs_def_stmt) == loop_containing_stmt (stmt))
+ /* APPLE LOCAL end lno */
{
tree rhs_def_operand;
@@ -1689,7 +1705,11 @@ simplify_rhs_and_lookup_avail_expr (struct dom_walk_data *walk_data,
tree rhs_def_stmt = SSA_NAME_DEF_STMT (TREE_OPERAND (rhs, 0));
/* See if the RHS_DEF_STMT has the same form as our statement. */
- if (TREE_CODE (rhs_def_stmt) == MODIFY_EXPR)
+ /* APPLE LOCAL begin lno */
+ if (TREE_CODE (rhs_def_stmt) == MODIFY_EXPR
+ && TREE_CODE (TREE_OPERAND (rhs_def_stmt, 1)) == rhs_code
+ && loop_containing_stmt (rhs_def_stmt) == loop_containing_stmt (stmt))
+ /* APPLE LOCAL end lno */
{
tree rhs_def_rhs = TREE_OPERAND (rhs_def_stmt, 1);
enum tree_code rhs_def_code = TREE_CODE (rhs_def_rhs);
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index b13894e42fc..83c521aa8a8 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -472,6 +472,233 @@ substitute_single_use_vars (varray_type *cond_worklist,
}
}
+/* APPLE LOCAL begin cast removal. */
+
+/* Return TRUE iff STMT is a MODIFY_EXPR of the form
+ x = (cast) y;
+*/
+static bool cast_conversion_assignment_p (tree stmt)
+{
+ tree lhs, rhs;
+
+ gcc_assert (stmt);
+
+ if (TREE_CODE (stmt) != MODIFY_EXPR)
+ return false;
+
+ lhs = TREE_OPERAND (stmt, 0);
+ rhs = TREE_OPERAND (stmt, 1);
+ if ((TREE_CODE (rhs) == NOP_EXPR
+ || TREE_CODE (rhs) == CONVERT_EXPR)
+ && TREE_CODE (TREE_OPERAND (rhs, 0)) == SSA_NAME
+ && TREE_CODE (lhs) == SSA_NAME)
+ return true;
+
+ return false;
+}
+
+/* STMT is a comparision and it uses DEF_STMT.
+ DEF_STMT is a modify expression that applys cast.
+ Return TRUE iff, it is OK to replace use of DEF_STMT by LHS's
+ inner type. If NEW_STMT is not NULL then */
+static bool
+replacable_use_in_cond_expr (tree stmt, tree def_stmt, tree *new_stmt)
+{
+ tree op0, op1, candidate_op, other_op, temp, def_rhs, def_rhs_inner_type;
+
+ gcc_assert (stmt);
+ gcc_assert (def_stmt);
+ gcc_assert (COMPARISON_CLASS_P (stmt));
+ gcc_assert (TREE_CODE (def_stmt) == MODIFY_EXPR);
+
+ candidate_op = NULL_TREE;
+ other_op = NULL_TREE;
+
+ op0 = TREE_OPERAND (stmt, 0);
+ op1 = TREE_OPERAND (stmt, 1);
+
+ if (TREE_CODE (op0) == SSA_NAME
+ && SSA_NAME_DEF_STMT (op0) == def_stmt
+ && is_gimple_min_invariant (op1))
+ {
+ candidate_op = op0;
+ other_op = op1;
+ }
+ else if (TREE_CODE (op1) == SSA_NAME
+ && SSA_NAME_DEF_STMT (op1) == def_stmt
+ && is_gimple_min_invariant (op0))
+ {
+ candidate_op = op1;
+ other_op = op0;
+ }
+ else
+ return false;
+
+ if (!cast_conversion_assignment_p (def_stmt))
+ return false;
+
+ /* What we want to prove is that if we convert CANDIDATE_OP to
+ the type of the object inside the NOP_EXPR that the
+ result is still equivalent to SRC. */
+ def_rhs = TREE_OPERAND (def_stmt, 1);
+ def_rhs_inner_type = TREE_TYPE (TREE_OPERAND (def_rhs, 0));
+ temp = build1 (TREE_CODE (def_rhs), def_rhs_inner_type, other_op);
+ temp = fold (temp);
+ if (is_gimple_val (temp) && tree_int_cst_equal (temp, other_op))
+ {
+ if (new_stmt)
+ *new_stmt = build (TREE_CODE (stmt), TREE_TYPE (stmt),
+ TREE_OPERAND (def_rhs, 0), temp);
+
+ return true;
+ }
+ return false;
+}
+
+/* Return TRUE iff all uses of STMT are candidate for replacement. */
+static bool
+all_uses_are_replacable (tree stmt, bool replace)
+{
+ dataflow_t df;
+ int j, num_uses;
+ bool replacable = true;
+
+ /* Now compute the immediate uses of TEST_VAR. */
+ df = get_immediate_uses (stmt);
+ num_uses = num_immediate_uses (df);
+
+ for (j = 0; j < num_uses && replacable; j++)
+ {
+ tree use = immediate_use (df, j);
+
+ if (replace && dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, " Removing casts");
+ print_generic_expr (dump_file, use, dump_flags);
+ fprintf (dump_file, "\n");
+ }
+
+ if (TREE_CODE (use) == MODIFY_EXPR)
+ {
+ replacable = cast_conversion_assignment_p (use);
+ if (replace)
+ {
+ /* Before
+
+ STMT: a = (cast) b;
+ USE: c = (undo_cast) a;
+
+ After
+
+ USE: c = b;
+ */
+ tree def_rhs = TREE_OPERAND (stmt, 1);
+ tree def_rhs_inner = TREE_OPERAND (def_rhs, 0);
+ tree use_lhs = TREE_OPERAND (use, 0);
+
+ tree def_rhs_inner_type = TREE_TYPE (def_rhs_inner);
+ tree use_lhs_type = TREE_TYPE (use_lhs);
+
+ if ((TYPE_PRECISION (def_rhs_inner_type)
+ == TYPE_PRECISION (use_lhs_type))
+ && (TYPE_MAIN_VARIANT (def_rhs_inner_type)
+ == TYPE_MAIN_VARIANT (use_lhs_type)))
+ {
+ TREE_OPERAND (use, 1) = TREE_OPERAND (def_rhs, 0);
+ modify_stmt (use);
+ }
+ }
+ }
+ else if (TREE_CODE (use) == COND_EXPR
+ && COMPARISON_CLASS_P (COND_EXPR_COND (use)))
+ {
+ if (replace)
+ {
+ tree new_cond = NULL_TREE;
+ replacable = replacable_use_in_cond_expr (COND_EXPR_COND (use),
+ stmt, &new_cond);
+ if (new_cond)
+ {
+ COND_EXPR_COND (use) = new_cond;
+ modify_stmt (use);
+ }
+ else
+ abort ();
+ }
+ else
+ replacable = replacable_use_in_cond_expr (COND_EXPR_COND (use),
+ stmt, NULL);
+ }
+ else
+ replacable = false;
+ }
+
+ return replacable;
+}
+
+static void
+eliminate_unnecessary_casts (void)
+{
+ basic_block bb;
+ block_stmt_iterator bsi;
+ varray_type worklist;
+
+ /* Memory allocation. */
+ vars = BITMAP_XMALLOC ();
+ VARRAY_TREE_INIT (worklist, 10, "worklist");
+ FOR_EACH_BB (bb)
+ {
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ {
+ tree stmt = bsi_stmt (bsi);
+
+ /* If stmt is of the form
+ x = (cast) y;
+ then make x candidate. */
+
+ if (cast_conversion_assignment_p (stmt))
+ {
+ tree lhs = TREE_OPERAND (stmt, 0);
+ tree rhs = TREE_OPERAND (stmt, 1);
+ tree rhs_inner = TREE_OPERAND (rhs, 0);
+ tree rhs_type = TREE_TYPE (rhs);
+ tree rhs_inner_type = TREE_TYPE (rhs_inner);
+
+ if ((TYPE_PRECISION (rhs_inner_type) <= TYPE_PRECISION (rhs_type))
+ && (TYPE_UNSIGNED (rhs_inner_type) == TYPE_UNSIGNED (rhs_type)))
+ {
+ bitmap_set_bit (vars, SSA_NAME_VERSION (lhs));
+ VARRAY_PUSH_TREE (worklist, stmt);
+ }
+ }
+ }
+ }
+
+ /* Now compute immidiate uses for candidates. */
+ compute_immediate_uses (TDFA_USE_OPS, need_imm_uses_for);
+ while (VARRAY_ACTIVE_SIZE (worklist) > 0)
+ {
+ tree stmt = VARRAY_TOP_TREE (worklist);
+ VARRAY_POP (worklist);
+
+ if (all_uses_are_replacable (stmt, false /* Do not replace */))
+ {
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file,"File name = %s\n", __FILE__);
+ fprintf (dump_file,"Input name = %s\n", main_input_filename);
+ }
+ all_uses_are_replacable (stmt, true /* Replace */);
+ }
+
+ }
+ /* Cleanup */
+ free_df ();
+ BITMAP_XFREE (vars);
+}
+
+/* APPLE LOCAL end cast removal. */
+
/* Main entry point for the forward propagation optimizer. */
static void
@@ -480,6 +707,10 @@ tree_ssa_forward_propagate_single_use_vars (void)
basic_block bb;
varray_type vars_worklist, cond_worklist;
+ /* APPLE LOCAL begin cast removal. */
+ eliminate_unnecessary_casts ();
+ /* APPLE LOCAL end cast removal. */
+
vars = BITMAP_XMALLOC ();
VARRAY_TREE_INIT (vars_worklist, 10, "VARS worklist");
VARRAY_TREE_INIT (cond_worklist, 10, "COND worklist");
diff --git a/gcc/tree-ssa-loop-ch.c b/gcc/tree-ssa-loop-ch.c
index e307528b2a8..5de11fcaf4c 100644
--- a/gcc/tree-ssa-loop-ch.c
+++ b/gcc/tree-ssa-loop-ch.c
@@ -131,7 +131,8 @@ copy_loop_headers (void)
basic_block *bbs;
unsigned n_bbs;
- loops = loop_optimizer_init (dump_file);
+ /* APPLE LOCAL lno */
+ loops = tree_loop_optimizer_init (dump_file);
if (!loops)
return;
rewrite_into_loop_closed_ssa ();
diff --git a/gcc/tree-ssa-loop-memset.c b/gcc/tree-ssa-loop-memset.c
new file mode 100644
index 00000000000..b3dbd154e20
--- /dev/null
+++ b/gcc/tree-ssa-loop-memset.c
@@ -0,0 +1,733 @@
+/* APPLE LOCAL begin loops-to-memset (ENTIRE FILE!) */
+/* Loops to memset.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+ Contributed by Andrew Pinski <apinski@apple.com>.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published by the
+ Free Software Foundation; either version 2, or (at your option) any
+ later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING. If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "ggc.h"
+#include "tree.h"
+#include "rtl.h"
+#include "tm_p.h"
+#include "hard-reg-set.h"
+#include "basic-block.h"
+#include "output.h"
+#include "diagnostic.h"
+#include "tree-flow.h"
+#include "tree-dump.h"
+#include "timevar.h"
+#include "cfgloop.h"
+#include "domwalk.h"
+#include "params.h"
+#include "tree-pass.h"
+#include "flags.h"
+#include "tree-data-ref.h"
+#include "tree-scalar-evolution.h"
+#include "tree-chrec.h"
+#include "tree-vectorizer.h"
+
+static bool memset_debug_stats (struct loop *loop);
+static bool memset_debug_details (struct loop *loop);
+
+/* Function memset_analyze_data_refs.
+
+ Find all the data references in the loop.
+
+ Handle INDIRECT_REFs and one dimensional ARRAY_REFs
+ which base is really an array (not a pointer).
+
+ This is different from vect_analyze_data_refs in tree-vectorizer.c as
+ we handle unaligned data stores and we only handle data stores. */
+
+static bool
+memset_analyze_data_refs (loop_vec_info loop_vinfo)
+{
+ struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
+ basic_block *bbs = LOOP_VINFO_BBS (loop_vinfo);
+ int nbbs = loop->num_nodes;
+ block_stmt_iterator si;
+ int j;
+ struct data_reference *dr;
+
+ if (memset_debug_details (NULL))
+ fprintf (dump_file, "\n<<memset_analyze_data_refs>>\n");
+
+ for (j = 0; j < nbbs; j++)
+ {
+ basic_block bb = bbs[j];
+ for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ {
+ tree stmt = bsi_stmt (si);
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ v_may_def_optype v_may_defs = STMT_V_MAY_DEF_OPS (stmt);
+ v_must_def_optype v_must_defs = STMT_V_MUST_DEF_OPS (stmt);
+ vuse_optype vuses = STMT_VUSE_OPS (stmt);
+ varray_type *datarefs = NULL;
+ int nvuses, nv_may_defs, nv_must_defs;
+ tree memref = NULL;
+ tree array_base;
+ tree symbl;
+
+ /* Assumption: there exists a data-ref in stmt, if and only if
+ it has vuses/vdefs. */
+
+ if (!vuses && !v_may_defs && !v_must_defs)
+ continue;
+
+ nvuses = NUM_VUSES (vuses);
+ nv_may_defs = NUM_V_MAY_DEFS (v_may_defs);
+ nv_must_defs = NUM_V_MUST_DEFS (v_must_defs);
+
+ if (nvuses && (nv_may_defs || nv_must_defs))
+ {
+ if (memset_debug_details (NULL))
+ {
+ fprintf (dump_file, "unexpected vdefs and vuses in stmt: ");
+ print_generic_expr (dump_file, stmt, TDF_SLIM);
+ }
+ return false;
+ }
+
+ if (TREE_CODE (stmt) != MODIFY_EXPR)
+ {
+ if (memset_debug_details (NULL))
+ {
+ fprintf (dump_file, "unexpected vops in stmt: ");
+ print_generic_expr (dump_file, stmt, TDF_SLIM);
+ }
+ return false;
+ }
+
+ if (vuses)
+ {
+ if (memset_debug_details (NULL))
+ {
+ fprintf (dump_file, "Memory access in the loop: ");
+ print_generic_expr (dump_file, stmt, TDF_SLIM);
+ }
+ return false;
+ }
+ else /* vdefs */
+ {
+ memref = TREE_OPERAND (stmt, 0);
+ datarefs = &(LOOP_VINFO_DATAREF_WRITES (loop_vinfo));
+ }
+
+ if (TREE_CODE (memref) == INDIRECT_REF)
+ {
+ /* MERGE FIXME */
+ abort ();
+ /* dr = vect_analyze_pointer_ref_access (memref, stmt, false); */
+ if (! dr)
+ return false;
+ symbl = DR_BASE_NAME (dr);
+ }
+ else if (TREE_CODE (memref) == ARRAY_REF)
+ {
+ tree base;
+ array_base = TREE_OPERAND (memref, 0);
+
+ if (TREE_CODE (array_base) == ARRAY_REF)
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ {
+ fprintf (dump_file,
+ "not vectorized: multi-dimensional array.");
+ print_generic_expr (dump_file, stmt, TDF_SLIM);
+ }
+ return false;
+ }
+
+ dr = analyze_array (stmt, memref, false);
+
+ /* Find the relevant symbol for aliasing purposes. */
+ base = DR_BASE_NAME (dr);
+ switch (TREE_CODE (base))
+ {
+ case VAR_DECL:
+ symbl = base;
+ break;
+ default:
+ if (memset_debug_stats (loop)
+ || memset_debug_details (loop))
+ {
+ fprintf (dump_file,
+ "not transformed: unhandled struct/class field access ");
+ print_generic_expr (dump_file, stmt, TDF_SLIM);
+ }
+ return false;
+ } /* switch */
+ }
+ else
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ {
+ fprintf (dump_file, "not transformed: unhandled data ref: ");
+ print_generic_expr (dump_file, stmt, TDF_SLIM);
+ }
+ return false;
+ }
+
+ /* Find and record the memtag assigned to this data-ref. */
+ if (TREE_CODE (symbl) == VAR_DECL
+ || (TREE_CODE (symbl) == COMPONENT_REF
+ && TREE_CODE (TREE_OPERAND (symbl, 0)) == VAR_DECL))
+ STMT_VINFO_MEMTAG (stmt_info) = symbl;
+ else if (TREE_CODE (symbl) == SSA_NAME)
+ {
+ tree tag;
+ symbl = SSA_NAME_VAR (symbl);
+ tag = get_var_ann (symbl)->type_mem_tag;
+ if (!tag)
+ {
+ tree ptr = TREE_OPERAND (memref, 0);
+ if (TREE_CODE (ptr) == SSA_NAME)
+ tag = get_var_ann (SSA_NAME_VAR (ptr))->type_mem_tag;
+ }
+ if (!tag)
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ fprintf (dump_file, "not vectorized: no memtag for ref.");
+ return false;
+ }
+ STMT_VINFO_MEMTAG (stmt_info) = tag;
+ }
+ else
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ {
+ fprintf (dump_file, "not vectorized: unsupported data-ref: ");
+ print_generic_expr (dump_file, memref, TDF_SLIM);
+ }
+ return false;
+ }
+
+ VARRAY_PUSH_GENERIC_PTR (*datarefs, dr);
+ STMT_VINFO_DATA_REF (stmt_info) = dr;
+ }
+ }
+
+ return true;
+}
+
+/* Function memset_analyze_loop_with_symbolic_num_of_iters.
+
+ In case the number of iterations that LOOP iterates in unknown at compile
+ time, an epilog loop will be generated, and the loop induction variables
+ (IVs) will be "advanced" to the value they are supposed to take just before
+ the epilog loop. Here we check that the access function of the loop IVs
+ and the expression that represents the loop bound are simple enough.
+ These restrictions will be relxed in the future. */
+
+static bool
+memset_analyze_loop_with_symbolic_num_of_iters (tree niters,
+ struct loop *loop)
+{
+ basic_block bb = loop->header;
+ tree phi;
+
+ if (memset_debug_details (NULL))
+ fprintf (dump_file,
+ "\n<<memset_analyze_loop_with_symbolic_num_of_iters>>\n");
+
+ if (chrec_contains_undetermined (niters))
+ {
+ if (memset_debug_details (NULL))
+ fprintf (dump_file, "Infinite number of iterations.");
+ return false;
+ }
+
+ if (!niters)
+ {
+ if (memset_debug_details (NULL))
+ fprintf (dump_file, "niters is NULL pointer.");
+ return false;
+ }
+
+ if (memset_debug_details (NULL))
+ {
+ fprintf (dump_file, "Symbolic number of iterations is ");
+ print_generic_expr (dump_file, niters, TDF_DETAILS);
+ }
+
+ /* Analyze phi functions of the loop header. */
+
+ for (phi = phi_nodes (bb); phi; phi = PHI_CHAIN (phi))
+ {
+ tree access_fn = NULL;
+ tree evolution_part;
+
+ if (memset_debug_details (NULL))
+ {
+ fprintf (dump_file, "Analyze phi: ");
+ print_generic_expr (dump_file, phi, TDF_SLIM);
+ }
+
+ /* Skip virtual phi's. The data dependences that are associated with
+ virtual defs/uses (i.e., memory accesses) are analyzed elsewhere. */
+
+ if (!is_gimple_reg (SSA_NAME_VAR (PHI_RESULT (phi))))
+ {
+ if (memset_debug_details (NULL))
+ fprintf (dump_file, "virtual phi. skip.");
+ continue;
+ }
+
+ /* Analyze the evolution function. */
+
+ access_fn = instantiate_parameters
+ (loop, analyze_scalar_evolution (loop, PHI_RESULT (phi)));
+
+ if (!access_fn)
+ {
+ if (memset_debug_details (NULL))
+ fprintf (dump_file, "No Access function.");
+ return false;
+ }
+
+ if (memset_debug_details (NULL))
+ {
+ fprintf (dump_file, "Access function of PHI: ");
+ print_generic_expr (dump_file, access_fn, TDF_SLIM);
+ }
+
+ evolution_part = evolution_part_in_loop_num (access_fn, loop->num);
+
+ if (evolution_part == NULL_TREE)
+ return false;
+
+ /* FORNOW: We do not transform initial conditions of IVs
+ which evolution functions are a polynomial of degree >= 2. */
+
+ if (tree_is_chrec (evolution_part))
+ return false;
+ }
+
+ return true;
+}
+
+
+/* Function debug_loop_details.
+
+ For memset debug dumps. */
+
+static bool
+memset_debug_details (struct loop *loop)
+{
+ basic_block bb;
+ block_stmt_iterator si;
+ tree node = NULL_TREE;
+
+ if (!dump_file || !(dump_flags & TDF_DETAILS))
+ return false;
+
+ if (!loop)
+ {
+ fprintf (dump_file, "\n");
+ return true;
+ }
+
+ if (!loop->header)
+ return false;
+
+ bb = loop->header;
+
+ for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ {
+ node = bsi_stmt (si);
+ if (node && EXPR_P (node) && EXPR_LOCUS (node))
+ break;
+ }
+
+ if (node && EXPR_P (node) && EXPR_LOCUS (node)
+ && EXPR_FILENAME (node) && EXPR_LINENO (node))
+ {
+ fprintf (dump_file, "\nloop at %s:%d: ",
+ EXPR_FILENAME (node), EXPR_LINENO (node));
+ return true;
+ }
+
+ return false;
+}
+
+/* Function debug_loop_stats.
+
+ For vectorization statistics dumps. */
+
+static bool
+memset_debug_stats (struct loop *loop)
+{
+ basic_block bb;
+ block_stmt_iterator si;
+ tree node = NULL_TREE;
+
+ if (!dump_file || !(dump_flags & TDF_STATS))
+ return false;
+
+ if (!loop)
+ {
+ fprintf (dump_file, "\n");
+ return true;
+ }
+
+ if (!loop->header)
+ return false;
+
+ bb = loop->header;
+
+ for (si = bsi_start (bb); !bsi_end_p (si); bsi_next (&si))
+ {
+ node = bsi_stmt (si);
+ if (node && EXPR_P (node) && EXPR_LOCUS (node))
+ break;
+ }
+
+ if (node && EXPR_P (node) && EXPR_LOCUS (node)
+ && EXPR_FILENAME (node) && EXPR_LINENO (node))
+ {
+ fprintf (dump_file, "\nloop at %s:%d: ",
+ EXPR_FILENAME (node), EXPR_LINENO (node));
+ return true;
+ }
+
+ return false;
+}
+
+/* Function memset_analyze_loop_form.
+
+ Verify the following restrictions:
+ - it's an inner-most loop
+ - number of BBs = 2 (which are the loop header and the latch)
+ - the loop has a pre-header
+ - the loop has a single entry and exit
+ - the loop exit condition is simple enough, and the number of iterations
+ can be analyzed (a countable loop).
+
+ This differs from vect_analyze_loop_form by we handle non constant
+ interations. */
+
+static loop_vec_info
+memset_analyze_loop_form (struct loop *loop)
+{
+ loop_vec_info loop_vinfo;
+ tree loop_cond;
+ tree number_of_iterations = NULL_TREE;
+
+ if (memset_debug_details (loop))
+ fprintf (dump_file, "\n<<memset_analyze_loop_form>>\n");
+
+ if (loop->level > 1 /* FORNOW: inner-most loop */
+ || loop->num_exits > 1 || loop->num_entries > 1 || loop->num_nodes != 2
+ || !loop->pre_header || !loop->header || !loop->latch)
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ {
+ fprintf (dump_file, "not vectorized: bad loop form.\n");
+ if (loop->level > 1)
+ fprintf (dump_file, "nested loop.\n");
+ else if (loop->num_exits > 1 || loop->num_entries > 1)
+ fprintf (dump_file, "multiple entries or exits.\n");
+ else if (loop->num_nodes != 2 || !loop->header || !loop->latch)
+ fprintf (dump_file, "too many BBs in loop.\n");
+ else if (!loop->pre_header)
+ fprintf (dump_file, "no pre-header BB for loop.\n");
+ }
+
+ return NULL;
+ }
+
+ /* We assume that the loop exit condition is at the end of the loop. i.e,
+ that the loop is represented as a do-while (with a proper if-guard
+ before the loop if needed), where the loop header contains all the
+ executable statements, and the latch is empty. */
+ if (!empty_block_p (loop->latch))
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ fprintf (dump_file, "not vectorized: unexpectd loop form.");
+ return NULL;
+ }
+
+ if (empty_block_p (loop->header))
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ fprintf (dump_file, "not transformed: empty loop.");
+ return NULL;
+ }
+
+ loop_cond = vect_get_loop_niters (loop, &number_of_iterations);
+ if (!loop_cond)
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ fprintf (dump_file, "not vectorized: complicated exit condition.\n");
+ return NULL;
+ }
+
+ if (!number_of_iterations)
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ fprintf (dump_file,
+ "not vectorized: number of iterations cannot be computed.");
+ return NULL;
+ }
+
+ loop_vinfo = new_loop_vec_info (loop);
+ LOOP_VINFO_NITERS (loop_vinfo) = number_of_iterations;
+
+ if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
+ {
+ if (memset_debug_details (NULL))
+ fprintf (dump_file, "loop bound unknown.");
+
+ /* Unknown loop bound. */
+ if (!memset_analyze_loop_with_symbolic_num_of_iters (number_of_iterations,
+ loop))
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ fprintf (dump_file, "not transformed: can't determine loop bound.\n");
+ return NULL;
+ }
+ else
+ {
+ /* We need only one loop entry for unknown loop bound support. */
+ if (loop->num_entries != 1 || !loop->pre_header)
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ fprintf (dump_file,
+ "not transformed: more than one loop entry.");
+ return NULL;
+ }
+ }
+ }
+ else if (LOOP_VINFO_INT_NITERS (loop_vinfo) == 0)
+ {
+ if (memset_debug_stats (loop) || memset_debug_details (loop))
+ fprintf (dump_file, "not transformed: number of iterations = 0.\n");
+ return NULL;
+ }
+
+ LOOP_VINFO_EXIT_COND (loop_vinfo) = loop_cond;
+
+ return loop_vinfo;
+}
+
+/* Mark all the variables in V_MAY_DEF or V_MUST_DEF operands for STMT for
+ renaming. This becomes necessary when we modify all of a non-scalar. */
+
+static void
+mark_all_v_defs (tree stmt)
+{
+ tree sym;
+ ssa_op_iter iter;
+
+ get_stmt_operands (stmt);
+
+ FOR_EACH_SSA_TREE_OPERAND (sym, stmt, iter, SSA_OP_VIRTUAL_DEFS)
+ {
+ if (TREE_CODE (sym) == SSA_NAME)
+ sym = SSA_NAME_VAR (sym);
+ bitmap_set_bit (vars_to_rename, var_ann (sym)->uid);
+ }
+}
+
+
+/* This is the main entry point for the transformation. */
+void
+tree_ssa_memset (struct loops *loops)
+{
+ unsigned i;
+
+ for (i = 1; i < loops->num; i++)
+ {
+ struct loop *loop = loops->parray[i];
+ loop_vec_info vectorizer_info;
+ varray_type writes;
+ struct data_reference *drw;
+ tree access_chrec;
+ tree noi;
+
+ if (!loop)
+ continue;
+
+ flow_loop_scan (loop, LOOP_ALL);
+ vectorizer_info = memset_analyze_loop_form (loop);
+ if (!vectorizer_info)
+ continue;
+
+ if (!memset_analyze_data_refs (vectorizer_info))
+ {
+ if (memset_debug_details (loop))
+ fprintf (dump_file, "bad data references.");
+ destroy_loop_vec_info (vectorizer_info);
+ continue;
+ }
+
+ writes = LOOP_VINFO_DATAREF_WRITES (vectorizer_info);
+
+ /* TODO: handle more than data write. */
+ if (VARRAY_ACTIVE_SIZE (writes) != 1)
+ {
+ if (memset_debug_details (loop))
+ fprintf (dump_file, "no or more than one store.");
+ destroy_loop_vec_info (vectorizer_info);
+ continue;
+ }
+
+ drw = VARRAY_GENERIC_PTR (writes, 0);
+
+ /* TODO: handle multi-dimension arrays. */
+ if (DR_NUM_DIMENSIONS (drw) != 1)
+ {
+ if (memset_debug_details (loop))
+ fprintf (dump_file, "cannot handle multiple dimension array.");
+ destroy_loop_vec_info (vectorizer_info);
+ continue;
+ }
+
+ if (TREE_CODE (TREE_OPERAND (DR_STMT (drw), 1)) != INTEGER_CST)
+ {
+ if (memset_debug_details (loop))
+ fprintf (dump_file, "non constant store value.");
+ destroy_loop_vec_info (vectorizer_info);
+ continue;
+ }
+
+ /* TODO: handle other than zero values in types
+ where the unit size is greater than one. */
+ if (!integer_zerop (TREE_OPERAND (DR_STMT (drw), 1))
+ && !integer_onep (TYPE_SIZE_UNIT (TREE_TYPE (DR_REF (drw)))))
+ {
+ if (memset_debug_details (loop))
+ fprintf (dump_file, "cannot handle other zero value for types of other than char (for now).");
+ destroy_loop_vec_info (vectorizer_info);
+ continue;
+ }
+
+ access_chrec = DR_ACCESS_FN (drw, 0);
+
+ noi = LOOP_VINFO_NITERS (vectorizer_info);
+
+ /* Build the memset call. */
+ {
+ tree array = DR_BASE_NAME (drw);
+ tree value = TREE_OPERAND (DR_STMT (drw), 1);
+ tree function = implicit_built_in_decls[BUILT_IN_MEMSET];
+ tree args = NULL_TREE;
+ block_stmt_iterator bsi = bsi_last (loop->pre_header);
+ tree array_1 = make_rename_temp (ptr_type_node, NULL);
+ tree temp, stmt, var;
+ tree ni_name;
+
+ stmt = DR_STMT (drw);
+
+ /* Remove the array access stmt. */
+ {
+ block_stmt_iterator access_bsi;
+ /* Mark the MAY_DEF as needed to be renamed. */
+ mark_all_v_defs (stmt);
+ access_bsi = bsi_for_stmt (stmt);
+ bsi_remove (&access_bsi);
+ }
+
+ if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE)
+ {
+ tree type = TREE_TYPE (TREE_TYPE (array));
+ tree base = array;
+
+ while (TREE_CODE (base) == REALPART_EXPR
+ || TREE_CODE (base) == IMAGPART_EXPR
+ || handled_component_p (base))
+ base = TREE_OPERAND (base, 0);
+
+ if (DECL_P (base))
+ TREE_ADDRESSABLE (base) = 1;
+
+ array = build4 (ARRAY_REF, type, array, size_zero_node,
+ NULL_TREE, NULL_TREE);
+ array = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (array)),
+ array);
+ }
+
+ {
+ tree start = CHREC_LEFT (access_chrec);
+ tree size_mult;
+ tree array_var;
+ start = fold_convert (TREE_TYPE (array), start);
+ size_mult = fold_convert (TREE_TYPE (array),
+ TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (array))));
+ array = fold (build2 (PLUS_EXPR,
+ TREE_TYPE (array),
+ array,
+ fold (build2 (MULT_EXPR,
+ TREE_TYPE (array),
+ start,
+ size_mult))));
+ array_var = create_tmp_var (TREE_TYPE (array), "tmp");
+ add_referenced_tmp_var (array_var);
+ array = force_gimple_operand (array, &stmt, false, array_var);
+
+ if (stmt)
+ bsi_insert_after (&bsi, stmt, BSI_CONTINUE_LINKING);
+ }
+
+ var = create_tmp_var (size_type_node, "tmp");
+ add_referenced_tmp_var (var);
+
+ noi = fold (build2 (MULT_EXPR, TREE_TYPE (noi), noi,
+ fold_convert (TREE_TYPE (noi),
+ TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (array))))));
+
+ stmt = NULL_TREE;
+ ni_name = force_gimple_operand (noi, &stmt, false, var);
+
+ if (stmt)
+ bsi_insert_after (&bsi, stmt, BSI_CONTINUE_LINKING);
+
+ temp = build2 (MODIFY_EXPR, void_type_node, array_1,
+ array);
+
+ bsi_insert_after (&bsi, temp, BSI_CONTINUE_LINKING);
+
+ args = tree_cons (NULL, ni_name, args);
+ args = tree_cons (NULL, fold_convert (integer_type_node, value), args);
+ args = tree_cons (NULL, array_1, args);
+
+ temp = build_function_call_expr (function, args);
+
+ bsi_insert_after (&bsi, temp, BSI_CONTINUE_LINKING);
+ }
+
+ destroy_loop_vec_info (vectorizer_info);
+
+ }
+
+ rewrite_into_ssa (false);
+ if (!bitmap_empty_p (vars_to_rename))
+ {
+ /* The rewrite of ssa names may cause violation of loop closed ssa
+ form invariants. TODO -- avoid these rewrites completely.
+ Information in virtual phi nodes is sufficient for it. */
+ rewrite_into_loop_closed_ssa ();
+ }
+ bitmap_clear (vars_to_rename);
+}
+
+/* APPLE LOCAL end loops-to-memset (ENTIRE FILE!) */
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index 21bfce89a2a..25a9082d448 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -1395,3 +1395,86 @@ free_numbers_of_iterations_estimates (struct loops *loops)
free_numbers_of_iterations_estimates_loop (loop);
}
}
+
+
+/* APPLE LOCAL begin lno */
+/*
+
+ Removal of loops in DCE.
+
+*/
+
+/* If we are able to prove that the LOOP always exits, turn off the
+ EDGE_DFS_BACK flag from its latch edge. */
+
+static void
+unmark_surely_finite_loop (struct loop *loop)
+{
+ edge *exits;
+ unsigned i, n_exits;
+ struct tree_niter_desc niter_desc;
+
+ exits = get_loop_exit_edges (loop, &n_exits);
+ for (i = 0; i < n_exits; i++)
+ if (number_of_iterations_exit (loop, exits[i], &niter_desc))
+ {
+ loop_latch_edge (loop)->flags &= ~EDGE_DFS_BACK;
+ return;
+ }
+}
+
+/* Emit special statements preventing removal of possibly infinite loops in
+ CD_DCE to the latches of LOOPS for that we are not able to prove that they
+ iterate just finite number of times. */
+
+void
+mark_maybe_infinite_loops (struct loops *loops)
+{
+ unsigned i;
+ struct loop *loop;
+ basic_block bb;
+ edge e;
+ tree stmt;
+ bool inserted = false;
+ block_stmt_iterator bsi;
+
+ mark_dfs_back_edges ();
+
+ for (i = 1; i < loops->num; i++)
+ {
+ loop = loops->parray[i];
+ if (loop)
+ unmark_surely_finite_loop (loop);
+ }
+
+ FOR_EACH_BB (bb)
+ {
+ edge_iterator ei;
+ FOR_EACH_EDGE (e, ei, bb->succs)
+ if (e->flags & EDGE_DFS_BACK)
+ {
+ stmt = build_function_call_expr (built_in_decls[BUILT_IN_MAYBE_INFINITE_LOOP],
+ NULL);
+
+ if (!(e->flags & EDGE_ABNORMAL))
+ {
+ bsi_insert_on_edge (e, stmt);
+ inserted = true;
+ continue;
+ }
+
+ /* We cannot insert on abnormal edge, so insert to the basic block
+ at its start. */
+ bsi = bsi_last (e->src);
+ if (!bsi_end_p (bsi)
+ && stmt_ends_bb_p (bsi_stmt (bsi)))
+ bsi_insert_before (&bsi, stmt, BSI_NEW_STMT);
+ else
+ bsi_insert_after (&bsi, stmt, BSI_NEW_STMT);
+ }
+ }
+
+ if (inserted)
+ loop_commit_inserts ();
+}
+/* APPLE LOCAL end lno */
diff --git a/gcc/tree-ssa-loop-prefetch.c b/gcc/tree-ssa-loop-prefetch.c
new file mode 100644
index 00000000000..189186a7419
--- /dev/null
+++ b/gcc/tree-ssa-loop-prefetch.c
@@ -0,0 +1,891 @@
+/* APPLE LOCAL file lno */
+/* Array prefetching.
+ Copyright (C) 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 2, or (at your option) any
+later version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+#include "config.h"
+#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
+#include "tree.h"
+#include "rtl.h"
+#include "tm_p.h"
+#include "hard-reg-set.h"
+#include "basic-block.h"
+#include "output.h"
+#include "diagnostic.h"
+#include "tree-flow.h"
+#include "tree-dump.h"
+#include "timevar.h"
+#include "cfgloop.h"
+#include "varray.h"
+#include "expr.h"
+#include "tree-pass.h"
+#include "ggc.h"
+#include "insn-config.h"
+#include "recog.h"
+#include "hashtab.h"
+#include "tree-chrec.h"
+#include "tree-scalar-evolution.h"
+
+/* This pass inserts prefetch instructions to optimize cache usage during
+ accesses to arrays in loops. It processes loops sequentially and:
+
+ 1) Gathers all memory references in the single loop.
+ 2) For each of the references it decides when it is profitable to prefetch
+ it. To do it, we evaluate the reuse among the accesses, and determines
+ two values: PREFETCH_BEFORE (meaning that it only makes sense to do
+ prefetching in the first PREFETCH_BEFORE iterations of the loop) and
+ PREFETCH_MOD (meaning that it only makes sense to prefetch in the
+ iterations of the loop that are zero modulo PREFETCH_MOD). For example
+ (assuming cache line size is 64 bytes, char has size 1 byte and there
+ is no hardware sequential prefetch):
+
+ char *a;
+ for (i = 0; i < max; i++)
+ {
+ a[255] = ...; (0)
+ a[i] = ...; (1)
+ a[i + 64] = ...; (2)
+ a[16*i] = ...; (3)
+ a[187*i] = ...; (4)
+ a[187*i + 50] = ...; (5)
+ }
+
+ (0) obviously has PREFETCH_BEFORE 1
+ (1) has PREFETCH_BEFORE 64, since (2) accesses the same memory
+ location 64 iterations before it, and PREFETCH_MOD 64 (since
+ it hits the same cache line otherwise).
+ (2) has PREFETCH_MOD 64
+ (3) has PREFETCH_MOD 4
+ (4) has PREFETCH_MOD 1. We do not set PREFETCH_BEFORE here, since
+ the cache line accessed by (4) is the same with probability only
+ 7/32.
+ (5) has PREFETCH_MOD 1 as well.
+
+ 3) We determine how much ahead we need to prefetch. The number of
+ iterations needed is time to fetch / time spent in one iteration of
+ the loop. The problem is that we do not know either of these values,
+ so we just make a heuristic guess based on a magic (possibly)
+ target-specific constant and size of the loop.
+
+ 4) Determine which of the references we prefetch. We take into account
+ that there is a maximum number of simultaneous prefetches (provided
+ by machine description). We prefetch as many prefetches as possible
+ while still within this bound (starting with those with lowest
+ prefetch_mod, since they are responsible for most of the cache
+ misses).
+
+ 5) We unroll and peel loops so that we are able to satisfy PREFETCH_MOD
+ and PREFETCH_BEFORE requirements (within some bounds), and to avoid
+ prefetching nonaccessed memory.
+ TODO -- actually implement this.
+
+ 6) We actually emit the prefetch instructions. ??? Perhaps emit the
+ prefetch instructions with guards in cases where 5) was not sufficient
+ to satisfy the constraints?
+
+ Some other TODO:
+ -- write and use more general reuse analysis (that could be also used
+ in other cache aimed loop optimizations)
+ -- make it behave sanely together with the prefetches given by user
+ (now we just ignore them; at the very least we should avoid
+ optimizing loops in that user put his own prefetches)
+ -- we assume cache line size allignment of arrays; this could be
+ improved. */
+
+/* Magic constants follow. These should be replaced by machine specific
+ numbers. */
+
+/* A number that should rouhgly correspond to the number of instructions
+ executed before the prefetch is completed. */
+
+#ifndef PREFETCH_LATENCY
+#define PREFETCH_LATENCY 50
+#endif
+
+/* Number of prefetches that can run at the same time. */
+
+#ifndef SIMULTANEOUS_PREFETCHES
+#define SIMULTANEOUS_PREFETCHES 3
+#endif
+
+/* True if write can be prefetched by a read prefetch. */
+
+#ifndef WRITE_CAN_USE_READ_PREFETCH
+#define WRITE_CAN_USE_READ_PREFETCH 1
+#endif
+
+/* True if read can be prefetched by a write prefetch. */
+
+#ifndef READ_CAN_USE_WRITE_PREFETCH
+#define READ_CAN_USE_WRITE_PREFETCH 0
+#endif
+
+/* Cache line size. Assumed to be a power of two. */
+
+#ifndef PREFETCH_BLOCK
+#define PREFETCH_BLOCK 32
+#endif
+
+/* Do we have a forward hardware sequential prefetching? */
+
+#ifndef HAVE_FORWARD_PREFETCH
+#define HAVE_FORWARD_PREFETCH 0
+#endif
+
+/* Do we have a backward hardware sequential prefetching? */
+
+#ifndef HAVE_BACKWARD_PREFETCH
+#define HAVE_BACKWARD_PREFETCH 0
+#endif
+
+/* In some cases we are only able to determine that there is a certain
+ probability that the two accesses hit the same cache line. In this
+ case, we issue the prefetches for both of them if this probability
+ is less then (1000 - ACCEPTABLE_MISS_RATE) promile. */
+
+#ifndef ACCEPTABLE_MISS_RATE
+#define ACCEPTABLE_MISS_RATE 50
+#endif
+
+#ifndef HAVE_prefetch
+#define HAVE_prefetch 0
+#endif
+
+/* The group of references between that reuse may occur. */
+
+struct mem_ref_group
+{
+ tree base; /* Base of the reference. */
+ HOST_WIDE_INT step; /* Step of the reference. */
+ tree group_iv; /* Induction variable for the group. */
+ bool issue_prefetch_p; /* Is there any prefetch issued in the
+ group? */
+ struct mem_ref *refs; /* References in the group. */
+ struct mem_ref_group *next; /* Next group of references. */
+};
+
+/* Assigned to PREFETCH_BEFORE when all iterations are to be prefetched. */
+
+#define PREFETCH_ALL (~(unsigned HOST_WIDE_INT) 0)
+
+/* The memory reference. */
+
+struct mem_ref
+{
+ HOST_WIDE_INT delta; /* Constant offset of the reference. */
+ bool write_p; /* Is it a write? */
+ struct mem_ref_group *group; /* The group of references it belongs to. */
+ unsigned HOST_WIDE_INT prefetch_mod;
+ /* Prefetch only each PREFETCH_MOD-th
+ iteration. */
+ unsigned HOST_WIDE_INT prefetch_before;
+ /* Prefetch only first PREFETCH_BEFORE
+ iterations. */
+ bool issue_prefetch_p; /* Should we really issue the prefetch? */
+ struct mem_ref *next; /* The next reference in the group. */
+};
+
+/* Dumps information obout reference REF to FILE. */
+
+static void
+dump_mem_ref (FILE *file, struct mem_ref *ref)
+{
+ fprintf (file, "Reference %p:\n", (void *) ref);
+
+ fprintf (file, " group %p (base ", (void *) ref->group);
+ print_generic_expr (file, ref->group->base, TDF_SLIM);
+ fprintf (file, ", step ");
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, ref->group->step);
+ fprintf (file, ")\n");
+
+ fprintf (dump_file, " delta ");
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC, ref->delta);
+ fprintf (file, "\n");
+
+ fprintf (file, " %s\n", ref->write_p ? "write" : "read");
+
+ fprintf (file, "\n");
+}
+
+/* Finds a group with BASE and STEP in GROUPS, or creates one if it does not
+ exist. */
+
+static struct mem_ref_group *
+find_or_create_group (struct mem_ref_group **groups, tree base,
+ HOST_WIDE_INT step)
+{
+ for (; *groups; groups = &(*groups)->next)
+ {
+ if ((*groups)->step == step
+ && operand_equal_p ((*groups)->base, base, 0))
+ return *groups;
+ }
+
+ (*groups) = xcalloc (1, sizeof (struct mem_ref_group));
+ (*groups)->base = base;
+ (*groups)->step = step;
+ (*groups)->group_iv = NULL_TREE;
+ (*groups)->refs = NULL;
+ (*groups)->next = NULL;
+
+ return *groups;
+}
+
+/* Records a memory reference in GROUP with offset DELTA and write status
+ WRITE_P. */
+
+static void
+record_ref (struct mem_ref_group *group, HOST_WIDE_INT delta,
+ bool write_p)
+{
+ struct mem_ref **aref;
+
+ for (aref = &group->refs; *aref; aref = &(*aref)->next)
+ {
+ /* It does not have to be possible for write reference to reuse the read
+ prefetch, or vice versa. */
+ if (!WRITE_CAN_USE_READ_PREFETCH
+ && write_p
+ && !(*aref)->write_p)
+ continue;
+ if (!READ_CAN_USE_WRITE_PREFETCH
+ && !write_p
+ && (*aref)->write_p)
+ continue;
+
+ if ((*aref)->delta == delta)
+ return;
+ }
+
+ (*aref) = xcalloc (1, sizeof (struct mem_ref));
+ (*aref)->delta = delta;
+ (*aref)->write_p = write_p;
+ (*aref)->prefetch_before = PREFETCH_ALL;
+ (*aref)->prefetch_mod = 1;
+ (*aref)->issue_prefetch_p = false;
+ (*aref)->group = group;
+ (*aref)->next = NULL;
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ dump_mem_ref (dump_file, *aref);
+}
+
+/* Release memory references in GROUPS. */
+
+static void
+release_mem_refs (struct mem_ref_group *groups)
+{
+ struct mem_ref_group *next_g;
+ struct mem_ref *ref, *next_r;
+
+ for (; groups; groups = next_g)
+ {
+ next_g = groups->next;
+ for (ref = groups->refs; ref; ref = next_r)
+ {
+ next_r = ref->next;
+ free (ref);
+ }
+ free (groups);
+ }
+}
+
+/* A structure used to pass arguments to idx_analyze_ref. */
+
+struct ar_data
+{
+ struct loop *loop; /* Loop of the reference. */
+ tree stmt; /* Statement of the reference. */
+ HOST_WIDE_INT *step; /* Step of the memory reference. */
+ HOST_WIDE_INT *delta; /* Offset of the memory reference. */
+};
+
+/* Analyzes a single INDEX of a memory reference to obtain information
+ described at analyze_ref. Callback for for_each_index. */
+
+static bool
+idx_analyze_ref (tree base, tree *index, void *data)
+{
+ struct ar_data *ar_data = data;
+ tree ibase, step, stepsize;
+ HOST_WIDE_INT istep, idelta = 0, imult = 1;
+
+ if (!simple_iv (ar_data->loop, ar_data->stmt, *index, &ibase, &step))
+ return false;
+
+ if (zero_p (step))
+ istep = 0;
+ else
+ {
+ if (!cst_and_fits_in_hwi (step))
+ return false;
+ istep = int_cst_value (step);
+ }
+
+ if (TREE_CODE (ibase) == PLUS_EXPR
+ && cst_and_fits_in_hwi (TREE_OPERAND (ibase, 1)))
+ {
+ idelta = int_cst_value (TREE_OPERAND (ibase, 1));
+ ibase = TREE_OPERAND (ibase, 0);
+ }
+ if (cst_and_fits_in_hwi (ibase))
+ {
+ idelta += int_cst_value (ibase);
+ ibase = fold_convert (TREE_TYPE (ibase), integer_zero_node);
+ }
+
+ if (base)
+ {
+ stepsize = TYPE_SIZE_UNIT (TREE_TYPE (TREE_TYPE (base)));
+ if (!cst_and_fits_in_hwi (stepsize))
+ return false;
+ imult = int_cst_value (stepsize);
+
+ istep *= imult;
+ idelta *= imult;
+ }
+
+ *ar_data->step += istep;
+ *ar_data->delta += idelta;
+ *index = ibase;
+
+ return true;
+}
+
+/* Tries to express REF in shape &BASE + STEP * iter + DELTA, where DELTA and
+ STEP are integer constants and iter is number of iterations of LOOP. The
+ reference occurs in statement STMT. */
+
+static bool
+analyze_ref (struct loop *loop, tree ref, tree *base,
+ HOST_WIDE_INT *step, HOST_WIDE_INT *delta,
+ tree stmt)
+{
+ struct ar_data ar_data;
+ tree off;
+ HOST_WIDE_INT bit_offset;
+
+ *step = 0;
+ *delta = 0;
+
+ /* First strip off the component references. Ignore bitfields. */
+ if (TREE_CODE (ref) == COMPONENT_REF
+ && DECL_NONADDRESSABLE_P (TREE_OPERAND (ref, 1)))
+ ref = TREE_OPERAND (ref, 0);
+
+ for (; TREE_CODE (ref) == COMPONENT_REF; ref = TREE_OPERAND (ref, 0))
+ {
+ off = DECL_FIELD_BIT_OFFSET (TREE_OPERAND (ref, 1));
+ bit_offset = TREE_INT_CST_LOW (off);
+
+ if (bit_offset % BITS_PER_UNIT)
+ abort ();
+
+ *delta += bit_offset / BITS_PER_UNIT;
+ }
+
+ *base = unshare_expr (ref);
+ ar_data.loop = loop;
+ ar_data.stmt = stmt;
+ ar_data.step = step;
+ ar_data.delta = delta;
+ return for_each_index (base, idx_analyze_ref, &ar_data);
+}
+
+/* Record a memory reference REF to the list REFS. The reference occurs in
+ LOOP in statement STMT and it is write if WRITE_P. */
+
+static void
+gather_memory_references_ref (struct loop *loop, struct mem_ref_group **refs,
+ tree ref, bool write_p, tree stmt)
+{
+ tree base;
+ HOST_WIDE_INT step, delta;
+ struct mem_ref_group *agrp;
+
+ if (!analyze_ref (loop, ref, &base, &step, &delta, stmt))
+ return;
+
+ /* Now we know that REF = &BASE + STEP * iter + DELTA, where DELTA and STEP
+ are integer constants. */
+ agrp = find_or_create_group (refs, base, step);
+ record_ref (agrp, delta, write_p);
+}
+
+/* Record the suitable memory references in LOOP. */
+
+static struct mem_ref_group *
+gather_memory_references (struct loop *loop)
+{
+ basic_block *body = get_loop_body_in_dom_order (loop);
+ basic_block bb;
+ unsigned i;
+ block_stmt_iterator bsi;
+ tree stmt, lhs, rhs;
+ struct mem_ref_group *refs = NULL;
+
+ /* Scan the loop body in order, so that the former references precede the
+ later ones. */
+ for (i = 0; i < loop->num_nodes; i++)
+ {
+ bb = body[i];
+ if (bb->loop_father != loop)
+ continue;
+
+ for (bsi = bsi_start (bb); !bsi_end_p (bsi); bsi_next (&bsi))
+ {
+ stmt = bsi_stmt (bsi);
+ if (TREE_CODE (stmt) != MODIFY_EXPR)
+ continue;
+
+ lhs = TREE_OPERAND (stmt, 0);
+ rhs = TREE_OPERAND (stmt, 1);
+
+ if (TREE_CODE_CLASS (TREE_CODE (rhs)) == 'r')
+ gather_memory_references_ref (loop, &refs, rhs, false, stmt);
+ if (TREE_CODE_CLASS (TREE_CODE (lhs)) == 'r')
+ gather_memory_references_ref (loop, &refs, lhs, true, stmt);
+ }
+ }
+ free (body);
+
+ return refs;
+}
+
+/* Prune the prefetch candidate REF using the self-reuse. */
+
+static void
+prune_ref_by_self_reuse (struct mem_ref *ref)
+{
+ HOST_WIDE_INT step = ref->group->step;
+ bool backward = step < 0;
+
+ if (step == 0)
+ {
+ /* Prefetch references to invariant address just once. */
+ ref->prefetch_before = 1;
+ return;
+ }
+
+ if (backward)
+ step = -step;
+
+ if (step > PREFETCH_BLOCK)
+ return;
+
+ if ((backward && HAVE_BACKWARD_PREFETCH)
+ || (!backward && HAVE_FORWARD_PREFETCH))
+ {
+ ref->prefetch_before = 1;
+ return;
+ }
+
+ ref->prefetch_mod = PREFETCH_BLOCK / step;
+}
+
+/* Divides X by BY, rounding down. */
+
+static HOST_WIDE_INT
+ddown (HOST_WIDE_INT x, unsigned HOST_WIDE_INT by)
+{
+ if (by <= 0)
+ abort ();
+
+ if (x >= 0)
+ return x / by;
+ else
+ return (x + by - 1) / by;
+}
+
+/* Prune the prefetch candidate REF using the reuse with BY.
+ If BY_IS_BEFORE is true, BY is before REF in the loop. */
+
+static void
+prune_ref_by_group_reuse (struct mem_ref *ref, struct mem_ref *by,
+ bool by_is_before)
+{
+ HOST_WIDE_INT step = ref->group->step;
+ bool backward = step < 0;
+ HOST_WIDE_INT delta_r = ref->delta, delta_b = by->delta;
+ HOST_WIDE_INT delta = delta_b - delta_r;
+ HOST_WIDE_INT hit_from;
+ unsigned HOST_WIDE_INT prefetch_before, prefetch_block;
+
+ if (delta == 0)
+ {
+ /* If the references has the same address, only prefetch the
+ former. */
+ if (by_is_before)
+ ref->prefetch_before = 0;
+
+ return;
+ }
+
+ if (!step)
+ {
+ /* If the reference addresses are invariant and fall into the
+ same cache line, prefetch just the first one. */
+ if (!by_is_before)
+ return;
+
+ if (ddown (ref->delta, PREFETCH_BLOCK)
+ != ddown (by->delta, PREFETCH_BLOCK))
+ return;
+
+ ref->prefetch_before = 0;
+ return;
+ }
+
+ /* Only prune the reference that is behind in the array. */
+ if (backward)
+ {
+ if (delta > 0)
+ return;
+
+ /* Transform the data so that we may assume that the accesses
+ are forward. */
+ delta = - delta;
+ step = -step;
+ delta_r = PREFETCH_BLOCK - 1 - delta_r;
+ delta_b = PREFETCH_BLOCK - 1 - delta_b;
+ }
+ else
+ {
+ if (delta < 0)
+ return;
+ }
+
+ /* Check whether the two references are likely to hit the same cache
+ line, and how distant the iterations in that it occurs are from
+ each other. */
+
+ if (step <= PREFETCH_BLOCK)
+ {
+ /* The accesses are sure to meet. Let us check when. */
+ hit_from = ddown (delta_b, PREFETCH_BLOCK) * PREFETCH_BLOCK;
+ prefetch_before = (hit_from - delta_r + step - 1) / step;
+
+ if (prefetch_before < ref->prefetch_before)
+ ref->prefetch_before = prefetch_before;
+
+ return;
+ }
+
+ /* A more complicated case. First let us ensure that size of cache line
+ and step are coprime (here we assume that PREFETCH_BLOCK is a power
+ of two. */
+ prefetch_block = PREFETCH_BLOCK;
+ while ((step & 1) == 0
+ && prefetch_block > 1)
+ {
+ step >>= 1;
+ prefetch_block >>= 1;
+ delta >>= 1;
+ }
+
+ /* Now step > prefetch_block, and step and prefetch_block are coprime.
+ Determine the probability that the accesses hit the same cache line. */
+
+ prefetch_before = delta / step;
+ delta %= step;
+ if ((unsigned HOST_WIDE_INT) delta
+ <= (prefetch_block * ACCEPTABLE_MISS_RATE / 1000))
+ {
+ if (prefetch_before < ref->prefetch_before)
+ ref->prefetch_before = prefetch_before;
+
+ return;
+ }
+
+ /* Try also the following iteration. */
+ prefetch_before++;
+ delta = step - delta;
+ if ((unsigned HOST_WIDE_INT) delta
+ <= (prefetch_block * ACCEPTABLE_MISS_RATE / 1000))
+ {
+ if (prefetch_before < ref->prefetch_before)
+ ref->prefetch_before = prefetch_before;
+
+ return;
+ }
+
+ /* The ref probably does not reuse by. */
+ return;
+}
+
+/* Prune the prefetch candidate REF using the reuses with other references
+ in REFS. */
+
+static void
+prune_ref_by_reuse (struct mem_ref *ref, struct mem_ref *refs)
+{
+ struct mem_ref *prune_by;
+ bool before = true;
+
+ prune_ref_by_self_reuse (ref);
+
+ for (prune_by = refs; prune_by; prune_by = prune_by->next)
+ {
+ if (prune_by == ref)
+ {
+ before = false;
+ continue;
+ }
+
+ if (!WRITE_CAN_USE_READ_PREFETCH
+ && ref->write_p
+ && !prune_by->write_p)
+ continue;
+ if (!READ_CAN_USE_WRITE_PREFETCH
+ && !ref->write_p
+ && prune_by->write_p)
+ continue;
+
+ prune_ref_by_group_reuse (ref, prune_by, before);
+ }
+}
+
+/* Prune the prefetch candidates in GROUP using the reuse analysis. */
+
+static void
+prune_group_by_reuse (struct mem_ref_group *group)
+{
+ struct mem_ref *ref_pruned;
+
+ for (ref_pruned = group->refs; ref_pruned; ref_pruned = ref_pruned->next)
+ {
+ prune_ref_by_reuse (ref_pruned, group->refs);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ {
+ fprintf (dump_file, "Reference %p:", (void *) ref_pruned);
+
+ if (ref_pruned->prefetch_before == PREFETCH_ALL
+ && ref_pruned->prefetch_mod == 1)
+ fprintf (dump_file, " no restrictions");
+ else if (ref_pruned->prefetch_before == 0)
+ fprintf (dump_file, " do not prefetch");
+ else if (ref_pruned->prefetch_before <= ref_pruned->prefetch_mod)
+ fprintf (dump_file, " prefetch once");
+ else
+ {
+ if (ref_pruned->prefetch_before != PREFETCH_ALL)
+ {
+ fprintf (dump_file, " prefetch before ");
+ fprintf (dump_file, HOST_WIDE_INT_PRINT_DEC,
+ ref_pruned->prefetch_before);
+ }
+ if (ref_pruned->prefetch_mod != 1)
+ {
+ fprintf (dump_file, " prefetch mod ");
+ fprintf (dump_file, HOST_WIDE_INT_PRINT_DEC,
+ ref_pruned->prefetch_mod);
+ }
+ }
+ fprintf (dump_file, "\n");
+ }
+ }
+}
+
+/* Prune the list of prefetch candidates GROUPS using the reuse analysis. */
+
+static void
+prune_by_reuse (struct mem_ref_group *groups)
+{
+ for (; groups; groups = groups->next)
+ prune_group_by_reuse (groups);
+}
+
+/* Decide which of the prefetch candidates in GROUPS to prefetch.
+ AHEAD is the number of iterations to prefetch ahead (which corresponds
+ to the number of simultaneous instances of one prefetch running at a
+ time). */
+
+static void
+schedule_prefetches (struct mem_ref_group *groups, unsigned ahead)
+{
+ unsigned max_prefetches = SIMULTANEOUS_PREFETCHES / ahead;
+ struct mem_ref *ref;
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "Max prefetches to issue: %d.\n", max_prefetches);
+
+ /* For now we just take memory references one by one and issue
+ prefetches for as many as possible. TODO -- select the most
+ profitable prefetches. */
+
+ if (!max_prefetches)
+ return;
+
+ for (; groups; groups = groups->next)
+ for (ref = groups->refs; ref; ref = ref->next)
+ {
+ /* For now do not issue prefetches for only first few of the
+ iterations. */
+ if (ref->prefetch_before != PREFETCH_ALL)
+ continue;
+
+ ref->issue_prefetch_p = true;
+ groups->issue_prefetch_p = true;
+ max_prefetches--;
+
+ if (!max_prefetches)
+ return;
+ }
+}
+
+/* Issue prefetches for the referenc REF into LOOP as decided before.
+ HEAD is the number of iterations to prefetch ahead. */
+
+static void
+issue_prefetch_ref (struct loop *loop, struct mem_ref *ref, unsigned ahead)
+{
+ HOST_WIDE_INT delta;
+ tree addr, stmts, prefetch, params, write_p;
+ block_stmt_iterator bsi;
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "Issued prefetch for %p.\n", (void *) ref);
+
+ /* Determine the address to prefetch. */
+ delta = ahead * ref->group->step + ref->delta;
+ addr = ref->group->group_iv;
+ if (delta)
+ addr = build (PLUS_EXPR, ptr_type_node,
+ addr, build_int_cst (ptr_type_node, delta));
+
+ addr = force_gimple_operand (addr, &stmts, false,
+ SSA_NAME_VAR (ref->group->group_iv));
+
+ /* Create the prefetch instruction. */
+ write_p = ref->write_p ? integer_one_node : integer_zero_node;
+ params = tree_cons (NULL_TREE, addr,
+ tree_cons (NULL_TREE, write_p, NULL_TREE));
+
+ prefetch = build_function_call_expr (built_in_decls[BUILT_IN_PREFETCH],
+ params);
+
+ /* And emit all the stuff. We put the prefetch to the loop header, so
+ that it runs early. */
+ bsi = bsi_after_labels (loop->header);
+ if (stmts)
+ bsi_insert_after (&bsi, stmts, BSI_CONTINUE_LINKING);
+ bsi_insert_after (&bsi, prefetch, BSI_NEW_STMT);
+}
+
+/* Issue prefetches for the references in GROUPS into LOOP as decided before.
+ HEAD is the number of iterations to prefetch ahead. */
+
+static void
+issue_prefetches (struct loop *loop, struct mem_ref_group *groups,
+ unsigned ahead)
+{
+ struct mem_ref *ref;
+ tree iv_var, base, step;
+ block_stmt_iterator bsi;
+ bool after;
+
+ for (; groups; groups = groups->next)
+ {
+ if (!groups->issue_prefetch_p)
+ continue;
+
+ /* Create the induction variable for the group. */
+ iv_var = create_tmp_var (ptr_type_node, "prefetchtmp");
+ add_referenced_tmp_var (iv_var);
+ if (TREE_CODE (groups->base) == INDIRECT_REF)
+ base = fold_convert (ptr_type_node, TREE_OPERAND (groups->base, 0));
+ else
+ base = build (ADDR_EXPR, ptr_type_node, groups->base);
+ step = build_int_cst (ptr_type_node, groups->step);
+
+ standard_iv_increment_position (loop, &bsi, &after);
+ create_iv (base, step, iv_var, loop, &bsi, after, &groups->group_iv,
+ NULL);
+
+ for (ref = groups->refs; ref; ref = ref->next)
+ if (ref->issue_prefetch_p)
+ issue_prefetch_ref (loop, ref, ahead);
+ }
+}
+
+/* Issue prefetch instructions for array references in LOOP. */
+
+static void
+loop_prefetch_arrays (struct loop *loop)
+{
+ struct mem_ref_group *refs;
+ unsigned ahead, ninsns;
+
+ /* Step 1: gather the memory references. */
+ refs = gather_memory_references (loop);
+
+ /* Step 2: estimate the reuse effects. */
+ prune_by_reuse (refs);
+
+ /* Step 3: determine the ahead. */
+
+ /* FIXME: We should use not size of the loop, but the average number of
+ instructions executed per iteration of the loop. */
+ ninsns = tree_num_loop_insns (loop);
+ ahead = (PREFETCH_LATENCY + ninsns - 1) / ninsns;
+
+ /* Step 4: what to prefetch? */
+ schedule_prefetches (refs, ahead);
+
+ /* Step 5: unroll and peel the loops. TODO. */
+
+ /* Step 6: issue the prefetches. */
+ issue_prefetches (loop, refs, ahead);
+
+ release_mem_refs (refs);
+}
+
+/* Issue prefetch instructions for array references in LOOPS. */
+
+void
+tree_ssa_prefetch_arrays (struct loops *loops)
+{
+ unsigned i;
+ struct loop *loop;
+
+ if (!HAVE_prefetch)
+ return;
+
+ /* We assume that size of cache line is a power of two, so verify this
+ here. */
+ if (PREFETCH_BLOCK & (PREFETCH_BLOCK - 1))
+ abort ();
+
+ for (i = 1; i < loops->num; i++)
+ {
+ loop = loops->parray[i];
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "Processing loop %d:\n", loop->num);
+
+ if (loop)
+ loop_prefetch_arrays (loop);
+
+ if (dump_file && (dump_flags & TDF_DETAILS))
+ fprintf (dump_file, "\n\n");
+ }
+}
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c
index e5ec3f37066..a82d046796a 100644
--- a/gcc/tree-ssa-loop.c
+++ b/gcc/tree-ssa-loop.c
@@ -37,6 +37,10 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "flags.h"
#include "tree-inline.h"
#include "tree-scalar-evolution.h"
+/* APPLE LOCAL begin lno */
+#include "tree-data-ref.h"
+#include "function.h"
+/* APPLE LOCAL end lno */
/* The loop tree currently optimized. */
@@ -45,7 +49,8 @@ struct loops *current_loops;
/* Initializes the loop structures. DUMP is the file to that the details
about the analysis should be dumped. */
-static struct loops *
+/* APPLE LOCAL lno */
+struct loops *
tree_loop_optimizer_init (FILE *dump)
{
struct loops *loops = loop_optimizer_init (dump);
@@ -53,14 +58,15 @@ tree_loop_optimizer_init (FILE *dump)
if (!loops)
return NULL;
- /* Creation of preheaders may create redundant phi nodes if the loop is
+ /* Creation of preheaders may create redundant phi nodes (if the loop is
entered by more than one edge, but the initial value of the induction
- variable is the same on all of them. */
+ variable is the same on all of them). */
kill_redundant_phi_nodes ();
rewrite_into_ssa (false);
bitmap_clear (vars_to_rename);
rewrite_into_loop_closed_ssa ();
+
#ifdef ENABLE_CHECKING
verify_loop_closed_ssa ();
#endif
@@ -193,6 +199,116 @@ struct tree_opt_pass pass_unswitch =
0 /* letter */
};
+/* APPLE LOCAL begin lno */
+/* A pass for testing of loop infrastructure. */
+
+static void
+tree_ssa_loop_test (void)
+{
+ if (!current_loops)
+ return;
+
+ scev_analysis ();
+ analyze_all_data_dependences (current_loops);
+}
+
+static bool
+gate_tree_ssa_loop_test (void)
+{
+ return flag_tree_ssa_loop_test != 0;
+}
+
+struct tree_opt_pass pass_loop_test =
+{
+ "lptest", /* name */
+ gate_tree_ssa_loop_test, /* gate */
+ tree_ssa_loop_test, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ 0, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ 0, /* todo_flags_finish */
+ 0
+};
+
+/* Marks loops that cannot be removed in DCE, since they are possibly
+ infinite. */
+
+static void
+tree_mark_maybe_inf_loops (void)
+{
+ if (!current_loops)
+ return;
+
+ cfun->marked_maybe_inf_loops = 1;
+ mark_maybe_infinite_loops (current_loops);
+}
+
+static bool
+gate_tree_mark_maybe_inf_loops (void)
+{
+ return (flag_tree_dce != 0 && optimize >= 2);
+}
+
+struct tree_opt_pass pass_mark_maybe_inf_loops =
+{
+ "miloops", /* name */
+ gate_tree_mark_maybe_inf_loops, /* gate */
+ tree_mark_maybe_inf_loops, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_MARK_MILOOPS, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func, /* todo_flags_finish */
+ 0
+};
+
+/* APPLE LOCAL end lno */
+
+/* APPLE LOCAL begin loops-to-memset */
+/* Loops to memset pass. */
+
+static void
+tree_ssa_loop_memset (void)
+{
+ if (!current_loops)
+ return;
+
+ tree_ssa_memset (current_loops);
+}
+
+static bool
+gate_tree_ssa_loop_memset (void)
+{
+ return flag_tree_loop_memset != 0;
+}
+
+struct tree_opt_pass pass_memset =
+{
+ "memset", /* name */
+ gate_tree_ssa_loop_memset, /* gate */
+ tree_ssa_loop_memset, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_LIM, /* tv_id */
+ PROP_cfg, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func, /* todo_flags_finish */
+ 0 /* letter */
+};
+/* APPLE LOCAL end loops-to-memset */
+
/* Loop autovectorization. */
static void
@@ -263,6 +379,42 @@ struct tree_opt_pass pass_linear_transform =
0 /* letter */
};
+/* APPLE LOCAL begin lno */
+/* Prefetching. */
+
+static void
+tree_ssa_loop_prefetch (void)
+{
+ if (!current_loops)
+ return;
+
+ tree_ssa_prefetch_arrays (current_loops);
+}
+
+static bool
+gate_tree_ssa_loop_prefetch (void)
+{
+ return flag_prefetch_loop_arrays != 0;
+}
+
+struct tree_opt_pass pass_loop_prefetch =
+{
+ "prefetch", /* name */
+ gate_tree_ssa_loop_prefetch, /* gate */
+ tree_ssa_loop_prefetch, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ TV_TREE_PREFETCH, /* tv_id */
+ PROP_cfg | PROP_ssa, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func, /* todo_flags_finish */
+ 0
+};
+/* APPLE LOCAL end lno */
+
/* Canonical induction variable creation pass. */
static void
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 0f279128f9c..27eda5df818 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -1030,6 +1030,32 @@ get_stmt_operands (tree stmt)
}
+/* APPLE LOCAL begin lno */
+/* Returns true if the function call EXPR does not access memory. */
+
+static bool
+function_ignores_memory_p (tree expr)
+{
+ tree fndecl = get_callee_fndecl (expr);
+ enum built_in_function fcode;
+
+ if (!fndecl || !DECL_BUILT_IN (fndecl))
+ return false;
+
+ fcode = DECL_FUNCTION_CODE (fndecl);
+
+ switch (fcode)
+ {
+ case BUILT_IN_PREFETCH:
+ case BUILT_IN_MAYBE_INFINITE_LOOP:
+ return true;
+
+ default:
+ return false;
+ }
+}
+/* APPLE LOCAL end lno */
+
/* Recursively scan the expression pointed by EXPR_P in statement referred to
by INFO. FLAGS is one of the OPF_* constants modifying how to interpret the
operands found. */
@@ -1465,7 +1491,11 @@ get_call_expr_operands (tree stmt, tree expr)
/* A 'pure' or a 'const' functions never call clobber anything.
A 'noreturn' function might, but since we don't return anyway
there is no point in recording that. */
- if (TREE_SIDE_EFFECTS (expr)
+ /* APPLE LOCAL begin lno */
+ if (function_ignores_memory_p (expr))
+ ;
+ else if (TREE_SIDE_EFFECTS (expr)
+ /* APPLE LOCAL end lno */
&& !(call_flags & (ECF_PURE | ECF_CONST | ECF_NORETURN)))
add_call_clobber_ops (stmt);
else if (!(call_flags & ECF_CONST))
@@ -1496,6 +1526,10 @@ add_stmt_operand (tree *var_p, stmt_ann_t s_ann, int flags)
var_ann_t v_ann;
var = *var_p;
+ /* APPLE LOCAL begin lno */
+ if (!var)
+ return;
+ /* APPLE LOCAL end lno */
STRIP_NOPS (var);
/* If the operand is an ADDR_EXPR, add its operand to the list of
diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c
index 1b01ac2a110..0c7586bf501 100644
--- a/gcc/tree-vectorizer.c
+++ b/gcc/tree-vectorizer.c
@@ -209,20 +209,32 @@ static bool vectorizable_operation (tree, block_stmt_iterator *, tree *);
static bool vectorizable_assignment (tree, block_stmt_iterator *, tree *);
static enum dr_alignment_support vect_supportable_dr_alignment
(struct data_reference *);
+/* APPLE LOCAL begin AV cond expr. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004.
+ New function, vectoriable_select. */
+static bool vectorizable_select (tree, block_stmt_iterator *, tree *);
+/* APPLE LOCAL end AV cond expr. -dpatel */
static void vect_align_data_ref (tree);
static void vect_enhance_data_refs_alignment (loop_vec_info);
/* Utility functions for the analyses. */
static bool vect_is_simple_use (tree , loop_vec_info, tree *);
+/* APPLE LOCAL begin AV cond expr. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004.
+ New function, vect_is_simple_cond. */
+static bool vect_is_simple_cond (tree, loop_vec_info);
+/* APPLE LOCAL end AV cond expr. -dpatel */
static bool exist_non_indexing_operands_for_use_p (tree, tree);
static bool vect_is_simple_iv_evolution (unsigned, tree, tree *, tree *);
static void vect_mark_relevant (varray_type *, tree);
static bool vect_stmt_relevant_p (tree, loop_vec_info);
-static tree vect_get_loop_niters (struct loop *, tree *);
+/* APPLE LOCAL loops-to-memset */
+extern tree vect_get_loop_niters (struct loop *, tree *);
static bool vect_compute_data_ref_alignment (struct data_reference *);
static bool vect_analyze_data_ref_access (struct data_reference *);
static bool vect_can_force_dr_alignment_p (tree, unsigned int);
-static struct data_reference * vect_analyze_pointer_ref_access
+/* APPLE LOCAL loops-to-memset */
+extern struct data_reference * vect_analyze_pointer_ref_access
(tree, tree, bool, tree, tree *, tree *);
static bool vect_can_advance_ivs_p (loop_vec_info);
static tree vect_get_ptr_offset (tree, tree, tree *);
@@ -286,6 +298,11 @@ static void vect_set_dump_settings (void);
void vect_set_verbosity_level (const char *);
+/* APPLE LOCAL begin AV data dependence. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004.
+ New variable, loops_num. */
+static unsigned int loops_num;
+/* APPLE LOCAL end AV data dependence. -dpatel */
/*************************************************************************
Simple Loop Peeling Utilities
@@ -293,6 +310,13 @@ void vect_set_verbosity_level (const char *);
Utilities to support loop peeling for vectorization purposes.
*************************************************************************/
+/* APPLE LOCAL begin AV data dependence. -dpatel */
+/* Utilities for dependence analysis. */
+/* Patch is waiting FSF review since mid Sep, 2004.
+ New function, vect_build_dist_vector. */
+static unsigned int vect_build_dist_vector (struct loop *,
+ struct data_dependence_relation *);
+/* APPLE LOCAL end AV data dependence. -dpatel */
/* For each definition in DEFINITIONS this function allocates
new ssa name. */
@@ -2793,6 +2817,103 @@ vect_supportable_dr_alignment (struct data_reference *dr)
}
+/* APPLE LOCAL begin AV cond expr. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004. */
+/* vectorizable_select.
+
+ Check if STMT is conditional modify expression that can be vectorized.
+ If VEC_STMT is also passed, vectorize the STMT: create a vectorized
+ stmt using VEC_COND_EXPR to replace it, put it in VEC_STMT, and insert it
+ at BSI.
+
+ Return FALSE if not a vectorizable STMT, TRUE otherwise. */
+
+static bool
+vectorizable_select (tree stmt, block_stmt_iterator *bsi, tree *vec_stmt)
+{
+ tree scalar_dest = NULL_TREE;
+ tree vec_dest = NULL_TREE;
+ tree op = NULL_TREE;
+ tree cond_expr, then_clause, else_clause;
+ stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
+ tree vectype = STMT_VINFO_VECTYPE (stmt_info);
+ tree vec_cond_lhs, vec_cond_rhs, vec_then_clause, vec_else_clause;
+ tree vec_compare, vec_cond_expr;
+ tree new_temp;
+ loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_info);
+ enum machine_mode vec_mode;
+
+ if (TREE_CODE (stmt) != MODIFY_EXPR)
+ return false;
+
+ op = TREE_OPERAND (stmt, 1);
+
+ if (TREE_CODE (op) != COND_EXPR)
+ return false;
+
+ cond_expr = TREE_OPERAND (op, 0);
+ then_clause = TREE_OPERAND (op, 1);
+ else_clause = TREE_OPERAND (op, 2);
+
+ if (!vect_is_simple_cond (cond_expr, loop_vinfo))
+ return false;
+
+ if (TREE_CODE (then_clause) == SSA_NAME)
+ {
+ tree then_def_stmt = SSA_NAME_DEF_STMT (then_clause);
+ if (!vect_is_simple_use (then_clause, loop_vinfo, &then_def_stmt))
+ return false;
+ }
+ else if (TREE_CODE (then_clause) != INTEGER_CST
+ && TREE_CODE (then_clause) != REAL_CST)
+ return false;
+
+ if (TREE_CODE (else_clause) == SSA_NAME)
+ {
+ tree else_def_stmt = SSA_NAME_DEF_STMT (else_clause);
+ if (!vect_is_simple_use (else_clause, loop_vinfo, &else_def_stmt))
+ return false;
+ }
+ else if (TREE_CODE (else_clause) != INTEGER_CST
+ && TREE_CODE (else_clause) != REAL_CST)
+ return false;
+
+
+ vec_mode = TYPE_MODE (vectype);
+
+ if (!vec_stmt)
+ {
+ STMT_VINFO_TYPE (stmt_info) = select_vec_info_type;
+ return expand_vec_cond_expr_p (op, vec_mode);
+ }
+
+ /* Transform */
+
+ /* Handle def. */
+ scalar_dest = TREE_OPERAND (stmt, 0);
+ vec_dest = vect_create_destination_var (scalar_dest, vectype);
+
+ /* Handle cond expr. */
+ vec_cond_lhs = vect_get_vec_def_for_operand (TREE_OPERAND (cond_expr, 0), stmt);
+ vec_cond_rhs = vect_get_vec_def_for_operand (TREE_OPERAND (cond_expr, 1), stmt);
+ vec_then_clause = vect_get_vec_def_for_operand (then_clause, stmt);
+ vec_else_clause = vect_get_vec_def_for_operand (else_clause, stmt);
+
+ /* Arguments are ready. create the new vector stmt. */
+ vec_compare = build2 (TREE_CODE (cond_expr), vectype,
+ vec_cond_lhs, vec_cond_rhs);
+ vec_cond_expr = build (VEC_COND_EXPR, vectype,
+ vec_compare, vec_then_clause, vec_else_clause);
+
+ *vec_stmt = build2 (MODIFY_EXPR, vectype, vec_dest, vec_cond_expr);
+ new_temp = make_ssa_name (vec_dest, *vec_stmt);
+ TREE_OPERAND (*vec_stmt, 0) = new_temp;
+ vect_finish_stmt_generation (stmt, *vec_stmt, bsi);
+
+ return true;
+}
+/* APPLE LOCAL end AV cond expr. -dpatel */
+
/* Function vect_transform_stmt.
Create a vectorized stmt to replace STMT, and insert it at BSI. */
@@ -2827,6 +2948,15 @@ vect_transform_stmt (tree stmt, block_stmt_iterator *bsi)
gcc_assert (done);
is_store = true;
break;
+
+/* APPLE LOCAL begin AV cond expr. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004. */
+ case select_vec_info_type:
+ if (!vectorizable_select (stmt, bsi, &vec_stmt))
+ abort ();
+ break;
+/* APPLE LOCAL end AV cond expr. -dpatel */
+
default:
if (vect_print_dump_info (REPORT_DETAILS, UNKNOWN_LOC))
fprintf (vect_dump, "stmt not supported.");
@@ -3408,6 +3538,49 @@ vect_transform_loop (loop_vec_info loop_vinfo,
fprintf (vect_dump, "LOOP VECTORIZED.");
}
+/* APPLE LOCAL begin AV cond expr. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004. */
+/* FUnction vect_is_simple_cond.
+
+ Input:
+ LOOP - the loop that is being vectorized.
+ COND - Condition that is checked for simple use.
+
+ Returns whether a COND can be vectorized. Checkes whether
+ condition operands are supportable using vec_is_simple_use. */
+
+static bool
+vect_is_simple_cond (tree cond, loop_vec_info loop_vinfo)
+{
+ tree lhs, rhs;
+
+ if (TREE_CODE_CLASS (TREE_CODE (cond)) != tcc_comparison)
+ return false;
+
+ lhs = TREE_OPERAND (cond, 0);
+ rhs = TREE_OPERAND (cond, 1);
+
+ if (TREE_CODE (lhs) == SSA_NAME)
+ {
+ tree lhs_def_stmt = SSA_NAME_DEF_STMT (lhs);
+ if (!vect_is_simple_use (lhs, loop_vinfo, &lhs_def_stmt))
+ return false;
+ }
+ else if (TREE_CODE (lhs) != INTEGER_CST && TREE_CODE (lhs) != REAL_CST)
+ return false;
+
+ if (TREE_CODE (rhs) == SSA_NAME)
+ {
+ tree rhs_def_stmt = SSA_NAME_DEF_STMT (rhs);
+ if (!vect_is_simple_use (rhs, loop_vinfo, &rhs_def_stmt))
+ return false;
+ }
+ else if (TREE_CODE (rhs) != INTEGER_CST && TREE_CODE (rhs) != REAL_CST)
+ return false;
+
+ return true;
+}
+/* APPLE LOCAL end AV cond expr. -dpatel */
/* Function vect_is_simple_use.
@@ -3583,6 +3756,8 @@ vect_analyze_operations (loop_vec_info loop_vinfo)
ok = (vectorizable_operation (stmt, NULL, NULL)
|| vectorizable_assignment (stmt, NULL, NULL)
|| vectorizable_load (stmt, NULL, NULL)
+ /* APPLE LOCAL AV cond expr. -dpatel */
+ || vectorizable_select (stmt, NULL, NULL)
|| vectorizable_store (stmt, NULL, NULL));
if (!ok)
@@ -3879,6 +4054,39 @@ vect_analyze_scalar_cycles (loop_vec_info loop_vinfo)
return true;
}
+/* APPLE LOCAL begin AV data dependence. -dpatel */
+/* Patch is waiting FSF review since mid Sep, 2004. */
+/* Function vect_build_dist_vector.
+
+ Build classic dist vector for dependence relation DDR using LOOP's loop
+ nest. Return LOOP's depth in its loop nest. */
+
+static unsigned int
+vect_build_dist_vector (struct loop *loop,
+ struct data_dependence_relation *ddr)
+{
+ struct loop *loop_nest = loop;
+ unsigned int loop_depth = 1;
+
+ /* Find loop nest and loop depth. */
+ while (loop_nest)
+ {
+ if (loop_nest->outer && loop_nest->outer->outer)
+ {
+ loop_nest = loop_nest->outer;
+ loop_depth++;
+ }
+ else
+ break;
+ }
+
+ /* Compute distance vector. */
+ compute_subscript_distance (ddr);
+ build_classic_dist_vector (ddr, loops_num, loop_nest->depth);
+
+ return loop_depth - 1;
+}
+/* APPLE LOCAL end AV data dependence. -dpatel */
/* Function vect_base_addr_differ_p.
@@ -3947,6 +4155,12 @@ vect_analyze_data_ref_dependence (struct data_reference *dra,
{
bool differ_p;
struct data_dependence_relation *ddr;
+ /* APPLE LOCAL begin AV data dependence. -dpatel */
+ int vectorization_factor = LOOP_VINFO_VECT_FACTOR (loop_vinfo);
+ struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
+ unsigned int loop_depth = 0;
+ int dist;
+ /* APPLE LOCAL end AV data dependence. -dpatel */
if (!vect_base_addr_differ_p (dra, drb, &differ_p))
{
@@ -3970,6 +4184,27 @@ vect_analyze_data_ref_dependence (struct data_reference *dra,
if (DDR_ARE_DEPENDENT (ddr) == chrec_known)
return false;
+
+ /* APPLE LOCAL begin AV data dependence. -dpatel */
+ if (DDR_ARE_DEPENDENT (ddr) == chrec_dont_know)
+ return true;
+
+ loop_depth = vect_build_dist_vector (loop, ddr);
+
+ if (!DDR_DIST_VECT (ddr))
+ return true;
+
+ dist = DDR_DIST_VECT (ddr)[loop_depth];
+
+ /* Same loop iteration. */
+ if (dist == 0)
+ return false;
+
+ if (dist >= vectorization_factor)
+ /* Dependence distance does not create dependence, as far as vectorization
+ is concerned, in this case. */
+ return false;
+ /* APPLE LOCAL end AV data dependence. -dpatel */
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS,
LOOP_LOC (loop_vinfo)))
@@ -4510,7 +4745,8 @@ vect_analyze_data_ref_accesses (loop_vec_info loop_vinfo)
INIT - the initial condition of MEMREF in the loop.
*/
-static struct data_reference *
+/* APPLE LOCAL loops-to-memset */
+struct data_reference *
vect_analyze_pointer_ref_access (tree memref, tree stmt, bool is_read,
tree access_fn, tree *ptr_init, tree *ptr_step)
{
@@ -5492,7 +5728,8 @@ vect_can_advance_ivs_p (loop_vec_info loop_vinfo)
can be constructed, place it in NUMBER_OF_ITERATIONS.
Return the loop exit condition. */
-static tree
+/* APPLE LOCAL loops-to-memset */
+tree
vect_get_loop_niters (struct loop *loop, tree *number_of_iterations)
{
tree niters;
@@ -5720,6 +5957,21 @@ vect_analyze_loop (struct loop *loop)
return NULL;
}
+ /* APPLE LOCAL begin AV data dependence. -dpatel */
+ /* Analyze operations before data dependence. */
+
+ /* Scan all the operations in the loop and make sure they are
+ vectorizable. */
+
+ ok = vect_analyze_operations (loop_vinfo);
+ if (!ok)
+ {
+ if (vect_print_dump_info (REPORT_DETAILS, LOOP_LOC (loop_vinfo)))
+ fprintf (vect_dump, "bad data access.");
+ destroy_loop_vec_info (loop_vinfo);
+ return NULL;
+ }
+
/* Analyze data dependences between the data-refs in the loop.
FORNOW: fail at the first data dependence that we encounter. */
@@ -5727,7 +5979,7 @@ vect_analyze_loop (struct loop *loop)
if (!ok)
{
if (vect_print_dump_info (REPORT_DETAILS, LOOP_LOC (loop_vinfo)))
- fprintf (vect_dump, "bad data dependence.");
+ fprintf (vect_dump, "bad data alignment.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
@@ -5739,7 +5991,7 @@ vect_analyze_loop (struct loop *loop)
if (!ok)
{
if (vect_print_dump_info (REPORT_DETAILS, LOOP_LOC (loop_vinfo)))
- fprintf (vect_dump, "bad data access.");
+ fprintf (vect_dump, "bad operation or unsupported loop bound.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
@@ -5751,23 +6003,13 @@ vect_analyze_loop (struct loop *loop)
if (!ok)
{
if (vect_print_dump_info (REPORT_DETAILS, LOOP_LOC (loop_vinfo)))
- fprintf (vect_dump, "bad data alignment.");
- destroy_loop_vec_info (loop_vinfo);
- return NULL;
- }
-
- /* Scan all the operations in the loop and make sure they are
- vectorizable. */
-
- ok = vect_analyze_operations (loop_vinfo);
- if (!ok)
- {
- if (vect_print_dump_info (REPORT_DETAILS, LOOP_LOC (loop_vinfo)))
- fprintf (vect_dump, "bad operation or unsupported loop bound.");
+ fprintf (vect_dump, "bad data dependence.");
destroy_loop_vec_info (loop_vinfo);
return NULL;
}
+ /* APPLE LOCAL end AV data dependence. -dpatel */
+
LOOP_VINFO_VECTORIZABLE_P (loop_vinfo) = 1;
return loop_vinfo;
@@ -5794,7 +6036,8 @@ need_imm_uses_for (tree var)
void
vectorize_loops (struct loops *loops)
{
- unsigned int i, loops_num;
+ /* APPLE LOCAL AV data dependence. -dpatel */
+ unsigned int i;
unsigned int num_vectorized_loops = 0;
/* Fix the verbosity level if not defined explicitly by the user. */
diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h
index 7876cb6d7cb..866bd2b4dd9 100644
--- a/gcc/tree-vectorizer.h
+++ b/gcc/tree-vectorizer.h
@@ -138,6 +138,8 @@ enum stmt_vec_info_type {
load_vec_info_type,
store_vec_info_type,
op_vec_info_type,
+ /* APPLE LOCAL AV cond expr. -dpatel */
+ select_vec_info_type,
assignment_vec_info_type
};
@@ -270,5 +272,9 @@ extern void vectorize_loops (struct loops *);
extern loop_vec_info new_loop_vec_info (struct loop *loop);
extern void destroy_loop_vec_info (loop_vec_info);
extern stmt_vec_info new_stmt_vec_info (tree stmt, loop_vec_info);
+/* APPLE LOCAL begin loops-to-memset */
+extern struct data_reference * vect_analyze_pointer_ref_access (tree, tree, bool, tree, tree *, tree *);
+extern tree vect_get_loop_niters (struct loop *, tree *);
+/* APPLE LOCAL end loops-to-memset */
#endif /* GCC_TREE_VECTORIZER_H */
diff --git a/gcc/tree.c b/gcc/tree.c
index 3a0054c507e..3002cc2a770 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -113,7 +113,8 @@ struct type_hash GTY(())
};
/* Initial size of the hash table (rounded to next prime). */
-#define TYPE_HASH_INITIAL_SIZE 1000
+/* APPLE LOCAL fsf candidate */
+#define TYPE_HASH_INITIAL_SIZE 4111
/* Now here is the hash table. When recording a type, it is added to
the slot whose index is the hash code. Note that the hash table is
@@ -753,6 +754,10 @@ build_vector (tree type, tree vals)
tree v = make_node (VECTOR_CST);
int over1 = 0, over2 = 0;
tree link;
+ /* APPLE LOCAL begin AltiVec */
+ int max_index, count = 0;
+ tree list = NULL_TREE;
+ /* APPLE LOCAL end AltiVec */
TREE_VECTOR_CST_ELTS (v) = vals;
TREE_TYPE (v) = type;
@@ -762,10 +767,29 @@ build_vector (tree type, tree vals)
{
tree value = TREE_VALUE (link);
+ /* APPLE LOCAL begin AltiVec */
+ value = fold (value);
+ TREE_VALUE (link) = value;
+ count++;
+ list = link;
+ /* APPLE LOCAL end AltiVec */
over1 |= TREE_OVERFLOW (value);
over2 |= TREE_CONSTANT_OVERFLOW (value);
}
+ /* APPLE LOCAL begin AltiVec */
+ max_index = TYPE_VECTOR_SUBPARTS (type);
+ if (count > 0 && count < max_index)
+ {
+ int index;
+ tree expr = TREE_VALUE (list);
+ for (index = count; index < max_index; ++index)
+ list = chainon (list,
+ build_tree_list (NULL_TREE,
+ convert (TREE_TYPE (type), expr)));
+ }
+ /* APPLE LOCAL end AltiVec */
+
TREE_OVERFLOW (v) = over1;
TREE_CONSTANT_OVERFLOW (v) = over2;
@@ -2605,6 +2629,8 @@ build2_stat (enum tree_code code, tree tt, tree arg0, tree arg1 MEM_STAT_DECL)
/* Expressions without side effects may be constant if their
arguments are as well. */
constant = (TREE_CODE_CLASS (code) == tcc_comparison
+ /* APPLE LOCAL Altivec */
+ || TREE_CODE_CLASS (code) == tcc_expression
|| TREE_CODE_CLASS (code) == tcc_binary);
read_only = 1;
side_effects = TREE_SIDE_EFFECTS (t);
@@ -5965,7 +5991,11 @@ reconstruct_complex_type (tree type, tree bottom)
if (POINTER_TYPE_P (type))
{
inner = reconstruct_complex_type (TREE_TYPE (type), bottom);
- outer = build_pointer_type (inner);
+ /* APPLE LOCAL begin AltiVec */
+ outer = (TREE_CODE (type) == REFERENCE_TYPE
+ ? build_reference_type (inner)
+ : build_pointer_type (inner));
+ /* APPLE LOCAL end AltiVec */
}
else if (TREE_CODE (type) == ARRAY_TYPE)
{
diff --git a/gcc/tree.def b/gcc/tree.def
index 9a7c7e0db3b..967a75fbdb3 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -896,6 +896,11 @@ DEFTREECODE (POLYNOMIAL_CHREC, "polynomial_chrec", tcc_expression, 3)
Use the interface in tree-iterator.h to access this node. */
DEFTREECODE (STATEMENT_LIST, "statement_list", tcc_exceptional, 0)
+/* APPLE LOCAL begin AV vmul_uch --haifa */
+/* Used during vectorization to represent computation idioms. */
+DEFTREECODE (MULT_UCH_EXPR, "mult_uch", '2', 2)
+/* APPLE LOCAL end AV vmul_uch --haifa */
+
/* Value handles. Artificial nodes to represent expressions in
partial redundancy elimination (tree-ssa-pre.c). These nodes are
used for expression canonicalization. If two expressions compute
diff --git a/gcc/tree.h b/gcc/tree.h
index 62e9bb332bb..d36becd7258 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -288,6 +288,8 @@ struct tree_common GTY(())
unsigned lang_flag_5 : 1;
unsigned lang_flag_6 : 1;
unsigned visited : 1;
+ /* APPLE LOCAL "unavailable" attribute (Radar 2809697) --ilr */
+ unsigned unavailable_flag : 1;
};
/* The following table lists the uses of each of the above flags and
@@ -421,6 +423,13 @@ struct tree_common GTY(())
TREE_DEPRECATED in
..._DECL
+ APPLE LOCAL begin "unavailable" attribute (Radar 2809697)
+ unavailable_flag:
+
+ TREE_UNAVAILABLE in
+ ..._DECL
+ APPLE LOCAL end "unavailable" attribute (Radar 2809697)
+
visited:
Used in tree traversals to mark visited nodes.
@@ -1024,6 +1033,12 @@ extern void tree_operand_check_failed (int, enum tree_code,
deprecated feature by __attribute__((deprecated)). */
#define TREE_DEPRECATED(NODE) ((NODE)->common.deprecated_flag)
+/* APPLE LOCAL begin "unavailable" attribute (Radar 2809697) */
+/* Nonzero in a IDENTIFIER_NODE if the use of the name is defined as a
+ unavailable feature by __attribute__((unavailable)). */
+#define TREE_UNAVAILABLE(NODE) ((NODE)->common.unavailable_flag)
+/* APPLE LOCAL end "unavailable" attribute (Radar 2809697) */
+
/* Value of expression is function invariant. A strict subset of
TREE_CONSTANT, such an expression is constant over any one function
invocation, though not across different invocations. May appear in
@@ -2231,6 +2246,15 @@ struct tree_binfo GTY (())
/* Used to indicate that this DECL has weak linkage. */
#define DECL_WEAK(NODE) (DECL_CHECK (NODE)->decl.weak_flag)
+/* APPLE LOCAL handling duplicate decls across files */
+#define DECL_DUPLICATE_DECL(NODE) (DECL_CHECK (NODE)->decl.duplicate_decl)
+
+/* APPLE LOCAL begin CW asm blocks */
+#define DECL_CW_ASM_FUNCTION(NODE) (DECL_CHECK (NODE)->decl.cw_asm_function_flag)
+#define DECL_CW_ASM_NORETURN(NODE) (DECL_CHECK (NODE)->decl.cw_asm_noreturn_flag)
+#define DECL_CW_ASM_FRAME_SIZE(NODE) (DECL_CHECK (NODE)->decl.cw_asm_frame_size)
+/* APPLE LOCAL end CW asm blocks */
+
/* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
multiple translation units should be merged. */
#define DECL_ONE_ONLY(NODE) (DECL_CHECK (NODE)->decl.transparent_union)
@@ -2292,6 +2316,15 @@ struct tree_binfo GTY (())
#define DECL_POINTER_ALIAS_SET_KNOWN_P(NODE) \
(DECL_POINTER_ALIAS_SET (NODE) != - 1)
+/* APPLE LOCAL begin DECL_ESTIMATED_INSNS */
+/* In a FUNCTION_DECL for which DECL_BUILT_IN does not hold, this is
+ the approximate number of statements in this function. There is
+ no need for this number to be exact; it is only used in various
+ heuristics regarding optimization. */
+#define DECL_ESTIMATED_INSNS(NODE) \
+ (FUNCTION_DECL_CHECK (NODE)->decl.u1.i)
+/* APPLE LOCAL end */
+
/* Nonzero for a decl which is at file scope. */
#define DECL_FILE_SCOPE_P(EXP) \
(! DECL_CONTEXT (EXP) \
@@ -2378,11 +2411,19 @@ struct tree_decl GTY(())
unsigned lang_flag_6 : 1;
unsigned lang_flag_7 : 1;
+ /* APPLE LOCAL duplicate decls in multiple files. */
+ unsigned duplicate_decl : 1;
unsigned possibly_inlined : 1;
unsigned preserve_flag: 1;
unsigned gimple_formal_temp : 1;
unsigned debug_expr_is_from : 1;
- /* 12 unused bits. */
+ /* APPLE LOCAL unused bits */
+ /* 9 unused bits. */
+ /* APPLE LOCAL begin CW asm blocks */
+ unsigned cw_asm_function_flag : 1;
+ unsigned cw_asm_noreturn_flag : 1;
+ unsigned int cw_asm_frame_size;
+ /* APPLE LOCAL end CW asm blocks */
union tree_decl_u1 {
/* In a FUNCTION_DECL for which DECL_BUILT_IN holds, this is
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 7c1f7e17a50..0d96977b931 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -255,6 +255,11 @@ insn_prefetch_values_to_profile (rtx insn, histogram_values *values)
address = XEXP (mem, 0);
if (side_effects_p (address))
return false;
+
+ /* APPLE LOCAL begin should be in FSF, and has been submitted. */
+ if (GET_CODE (PATTERN (insn)) == CLOBBER)
+ return false;
+ /* APPLE LOCAL end should be in FSF, and has been submitted. */
if (CONSTANT_P (address))
return false;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 12ab1b7b01a..50dcd67ef2f 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1236,8 +1236,18 @@ assemble_start_function (tree decl, const char *fnname)
if (flag_reorder_blocks_and_partition)
{
+ /* APPLE LOCAL begin hot/cold partitioning */
+ /* We don't want to print out the label for the cold section here,
+ just fix the alignment. Therefore play games with
+ unlikely_section_label_printed to get this behavior. */
+
+ unlikely_section_label_printed = true;
+ /* APPLE LOCAL end hot/cold partitioning */
unlikely_text_section ();
assemble_align (FUNCTION_BOUNDARY);
+ /* APPLE LOCAL begin hot/cold partitioning */
+ unlikely_section_label_printed = false;
+ /* APPLE LOCAL end hot/cold partitioning */
}
resolve_unique_section (decl, 0, flag_function_sections);
@@ -1576,6 +1586,11 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
if (flag_syntax_only)
return;
+ /* APPLE LOCAL begin duplicate decls in multiple files. */
+ if (DECL_DUPLICATE_DECL (decl))
+ return;
+ /* APPLE LOCAL end duplicate decls in multiple files. */
+
app_disable ();
if (! dont_output_data
@@ -1699,6 +1714,27 @@ assemble_variable (tree decl, int top_level ATTRIBUTE_UNUSED,
resolve_unique_section (decl, reloc, flag_data_sections);
variable_section (decl, reloc);
+ /* APPLE LOCAL begin zerofill 20020218 --turly */
+#ifdef ASM_OUTPUT_ZEROFILL
+ /* We need a ZEROFILL COALESCED option! */
+ if (!DECL_COMMON (decl)
+ && ! dont_output_data
+ && ! DECL_ONE_ONLY (decl)
+ && ! DECL_WEAK (decl)
+ && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
+ {
+ ASM_OUTPUT_ZEROFILL (asm_out_file, name,
+ tree_low_cst (DECL_SIZE_UNIT (decl), 1),
+ floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT));
+
+ /********************************/
+ /* NOTE THE EARLY RETURN HERE!! */
+ /********************************/
+ return;
+ }
+#endif
+ /* APPLE LOCAL end zerofill 20020218 --turly */
+
/* dbxout.c needs to know this. */
if (in_text_section () || in_unlikely_text_section ())
DECL_IN_TEXT_SECTION (decl) = 1;
@@ -2296,8 +2332,19 @@ const_hash_1 (const tree exp)
return real_hash (TREE_REAL_CST_PTR (exp));
case STRING_CST:
- p = TREE_STRING_POINTER (exp);
- len = TREE_STRING_LENGTH (exp);
+ /* APPLE LOCAL begin fwritable strings */
+ if (flag_writable_strings
+ && !darwin_constant_cfstring_p (exp))
+ {
+ p = (char *) &exp;
+ len = sizeof exp;
+ }
+ else
+ {
+ p = TREE_STRING_POINTER (exp);
+ len = TREE_STRING_LENGTH (exp);
+ }
+ /* APPLE LOCAL end fwritable strings */
break;
case COMPLEX_CST:
@@ -2402,6 +2449,13 @@ compare_constant (const tree t1, const tree t2)
return REAL_VALUES_IDENTICAL (TREE_REAL_CST (t1), TREE_REAL_CST (t2));
case STRING_CST:
+ /* APPLE LOCAL begin fwritable strings */
+ if (flag_writable_strings
+ && !darwin_constant_cfstring_p (t1)
+ && !darwin_constant_cfstring_p (t2))
+ return t1 == t2;
+ /* APPLE LOCAL end fwritable strings */
+
if (TYPE_MODE (TREE_TYPE (t1)) != TYPE_MODE (TREE_TYPE (t2)))
return 0;
@@ -2583,7 +2637,12 @@ build_constant_desc (tree exp)
struct constant_descriptor_tree *desc;
desc = ggc_alloc (sizeof (*desc));
- desc->value = copy_constant (exp);
+ /* APPLE LOCAL begin fwritable strings */
+ if (flag_writable_strings && TREE_CODE (exp) == STRING_CST)
+ desc->value = exp;
+ else
+ desc->value = copy_constant (exp);
+ /* APPLE LOCAL end fwritable strings */
/* Propagate marked-ness to copied constant. */
if (flag_mudflap && mf_marked_p (exp))
@@ -2669,9 +2728,11 @@ maybe_output_constant_def_contents (struct constant_descriptor_tree *desc,
/* Already output; don't do it again. */
return;
- /* We can always defer constants as long as the context allows
- doing so. */
- if (defer)
+ /* APPLE LOCAL begin fwritable strings */
+ /* The only constants that cannot safely be deferred, assuming the
+ context allows it, are strings under flag_writable_strings. */
+ if (defer && (TREE_CODE (exp) != STRING_CST || !flag_writable_strings))
+ /* APPLE LOCAL end fwritable strings */
{
/* Increment n_deferred_constants if it exists. It needs to be at
least as large as the number of constants actually referred to
@@ -3468,6 +3529,8 @@ initializer_constant_valid_p (tree value, tree endtype)
{
case CONSTRUCTOR:
if ((TREE_CODE (TREE_TYPE (value)) == UNION_TYPE
+ /* APPLE LOCAL AltiVec */
+ || TREE_CODE (TREE_TYPE (value)) == VECTOR_TYPE
|| TREE_CODE (TREE_TYPE (value)) == RECORD_TYPE)
&& TREE_CONSTANT (value)
&& CONSTRUCTOR_ELTS (value))
@@ -4839,7 +4902,8 @@ default_select_section (tree decl, int reloc,
readonly = true;
}
else if (TREE_CODE (decl) == STRING_CST)
- readonly = true;
+ /* APPLE LOCAL fwritable strings */
+ readonly = !flag_writable_strings;
else if (! (flag_pic && reloc))
readonly = true;
@@ -4898,6 +4962,10 @@ categorize_decl_for_section (tree decl, int reloc, int shlib)
return SECCAT_TEXT;
else if (TREE_CODE (decl) == STRING_CST)
{
+ /* APPLE LOCAL begin fwritable strings */
+ if (flag_writable_strings)
+ return SECCAT_DATA;
+ /* APPLE LOCAL end fwritable strings */
if (flag_mudflap) /* or !flag_merge_constants */
return SECCAT_RODATA;
else
diff --git a/gcc/version.c b/gcc/version.c
index cba695ecab2..799c58ed1ff 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -5,7 +5,19 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
-const char version_string[] = "4.0.0 20050216 (experimental)";
+/* APPLE LOCAL begin Apple version */
+/* When updating this string:
+ - For each internal build, increment the build number.
+ - When merging from the FSF, delete any (experimental) or (prerelease).
+ Apple doesn't mark its GCC versions as 'prerelease', because a released
+ compiler will be identical to the last prerelease compiler and it
+ makes no sense to mark released compilers as 'prerelease'.
+ - There are other scripts that search for first word of the string
+ to get version number string. Do not use new line.
+*/
+
+const char version_string[] = "4.0.0 20050216 (Apple Computer, Inc. build 5000)";
+/* APPLE LOCAL end Apple version */
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
@@ -14,4 +26,6 @@ const char version_string[] = "4.0.0 20050216 (experimental)";
forward us bugs reported to you, if you determine that they are
not bugs in your modifications.) */
-const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
+/* APPLE LOCAL begin Apple bug-report */
+const char bug_report_url[] = "<URL:http://developer.apple.com/bugreporter>";
+/* APPLE LOCAL end Apple bug-report */
diff --git a/include/demangle.h b/include/demangle.h
index b3b8c58c517..83c0d1f3293 100644
--- a/include/demangle.h
+++ b/include/demangle.h
@@ -141,6 +141,8 @@ enum gnu_v3_ctor_kinds {
gnu_v3_complete_object_ctor = 1,
gnu_v3_base_object_ctor,
gnu_v3_complete_object_allocating_ctor
+ /* APPLE LOCAL decloning */
+ , gnu_v3_unified_ctor
};
/* Return non-zero iff NAME is the mangled form of a constructor name
@@ -155,6 +157,8 @@ enum gnu_v3_dtor_kinds {
gnu_v3_deleting_dtor = 1,
gnu_v3_complete_object_dtor,
gnu_v3_base_object_dtor
+ /* APPLE LOCAL decloning */
+ , gnu_v3_unified_dtor
};
/* Return non-zero iff NAME is the mangled form of a destructor name
diff --git a/libcpp/ChangeLog.apple-ppc b/libcpp/ChangeLog.apple-ppc
new file mode 100644
index 00000000000..384f4181532
--- /dev/null
+++ b/libcpp/ChangeLog.apple-ppc
@@ -0,0 +1,67 @@
+2005-03-06 Devang Patel <dpatel@apple.com>
+
+ * init.c (cpp_read_main_file): Remove Symbol Separation support.
+ * internal.h (cpp_cinfo_state): Remove.
+ (struct cpp_reader): Remove Symbol Separation support.
+ (find_include_cinfo): Remove.
+ * pch.c (count_defs): Remove Symbol Separation support.
+ (write_defs): Same.
+ (cpp_valid_state): Remove warn_invalid_sr use.
+ * directives.c (find_include_cinfo, cpp_symbol_separation_init,
+ cpp_write_symbol_deps, cpp_get_stabs_checksum): Remove.
+
+2005-02-27 Devang Patel <dpatel@apple.com>
+
+ Radar 3982899
+ * directives.c (do_line): Save sysp early before line table is realloc'ed.
+
+2005-02-21 Devang Patel <dpatel@apple.com>
+
+ Radar 4007432
+ * charset.c (_cpp_convert_input): Check '\r' before inserting
+ '\n' at the end.
+
+2005-02-17 Devang Patel <dpatel@apple.com>
+
+ Radar 3958387
+ * libcpp/lex.c (_cpp_get_fresh_line): Check warn_newline_at_eof.
+
+2005-01-04 Anders Bertelrud <anders@apple.com>
+
+ Radar 3871393
+ * include/cpplib.h (struct cpp_dir): Added 'header_map' field.
+
+2005-01-06 Mike Stump <mrs@apple.com>
+
+ Radar 3929334
+ * files.c (pch_open_file): Add indirection for pch files for distcc.
+ (read_from_parent): Add.
+ (write_to_parent): Add.
+ (init_indirect_pipes): Add.
+ (indirect_file): Add.
+
+2004-12-10 Devang Patel <dpatel@apple.com>
+
+ Undo Radar 3909961
+ * libcpp/directivec.c (do_elif): Do not check EOL when -Wextra-tokens is used.
+
+2004-12-10 Devang Patel <dpatel@apple.com>
+
+ Radar 3909961
+ * libcpp/directivec.c (do_elif): Check EOL when -Wextra-tokens is used.
+
+2004-08-03 Stan Shebs <shebs@apple.com>
+
+ Radar 3368707
+ Support for CodeWarrior-style assembly language blocks and
+ functions.
+ * include/cpplib.h (CPP_BOL, CPP_EOL): Define.
+ * internal.h (struct cpp_context): New field bol_p.
+ * lex.c (lex_identifier): Handle special chars in opcodes.
+ (cw_asm_label_follows): New global.
+ (_cpp_lex_direct): Special handling for @-labels,
+ flag end of operands when ';' seen.
+ * macro.c (enter_macro_context): Add bol_p argument and use.
+ (push_ptoken_context): Seed bol_p field.
+ (push_token_context): Ditto.
+ (cpp_get_token): Detect tokens at beginning of line and record.
diff --git a/libcpp/charset.c b/libcpp/charset.c
index 7a88a708e6c..44e54341862 100644
--- a/libcpp/charset.c
+++ b/libcpp/charset.c
@@ -1137,7 +1137,8 @@ convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit,
false for failure. */
bool
cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
- cpp_string *to, bool wide)
+ /* APPLE LOCAL pascal strings */
+ cpp_string *to, bool wide, bool pascal_p)
{
struct _cpp_strbuf tbuf;
const uchar *p, *base, *limit;
@@ -1147,7 +1148,8 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
tbuf.asize = MAX (OUTBUF_BLOCK_SIZE, from->len);
tbuf.text = xmalloc (tbuf.asize);
- tbuf.len = 0;
+ /* APPLE LOCAL pascal strings */
+ tbuf.len = (pascal_p ? 1 : 0); /* Reserve space for Pascal length byte. */
for (i = 0; i < count; i++)
{
@@ -1155,6 +1157,13 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
if (*p == 'L') p++;
p++; /* Skip leading quote. */
limit = from[i].text + from[i].len - 1; /* Skip trailing quote. */
+ /* APPLE LOCAL begin pascal strings */
+ /* Handle narrow literals beginning with "\p..." specially, but only
+ if '-fpascal-strings' has been specified. */
+ if (pascal_p && p[0] == '\\' && p[1] == 'p')
+ p += 2;
+ /* APPLE LOCAL end pascal strings */
+
for (;;)
{
@@ -1174,6 +1183,17 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
p = convert_escape (pfile, p + 1, limit, &tbuf, wide);
}
}
+
+ /* APPLE LOCAL begin pascal strings */
+ /* For Pascal strings, compute the length byte. */
+ if (pascal_p)
+ {
+ *tbuf.text = (unsigned char) (tbuf.len - 1);
+ if (tbuf.len > 256)
+ cpp_error (pfile, CPP_DL_ERROR, "Pascal string is too long");
+ }
+ /* APPLE LOCAL end pascal strings */
+
/* NUL-terminate the 'to' buffer and translate it to a cpp_string
structure. */
emit_numeric_escape (pfile, 0, &tbuf, wide);
@@ -1192,7 +1212,10 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
in a string, but do not perform character set conversion. */
bool
cpp_interpret_string_notranslate (cpp_reader *pfile, const cpp_string *from,
- size_t count, cpp_string *to, bool wide)
+ /* APPLE LOCAL begin pascal strings */
+ size_t count, cpp_string *to, bool wide,
+ bool pascal_p)
+ /* APPLE LOCAL end pascal strings */
{
struct cset_converter save_narrow_cset_desc = pfile->narrow_cset_desc;
bool retval;
@@ -1200,7 +1223,8 @@ cpp_interpret_string_notranslate (cpp_reader *pfile, const cpp_string *from,
pfile->narrow_cset_desc.func = convert_no_conversion;
pfile->narrow_cset_desc.cd = (iconv_t) -1;
- retval = cpp_interpret_string (pfile, from, count, to, wide);
+ /* APPLE LOCAL pascal strings */
+ retval = cpp_interpret_string (pfile, from, count, to, wide, pascal_p);
pfile->narrow_cset_desc = save_narrow_cset_desc;
return retval;
@@ -1248,7 +1272,10 @@ narrow_str_to_charconst (cpp_reader *pfile, cpp_string str,
cpp_error (pfile, CPP_DL_WARNING,
"character constant too long for its type");
}
- else if (i > 1 && CPP_OPTION (pfile, warn_multichar))
+ /* APPLE LOCAL begin -Wfour-char-constants */
+ else if ((i == 4 && CPP_OPTION (pfile, warn_four_char_constants))
+ || (i > 1 && i != 4 && CPP_OPTION (pfile, warn_multichar)))
+ /* APPLE LOCAL end -Wfour-char-constants */
cpp_error (pfile, CPP_DL_WARNING, "multi-character character constant");
/* Multichar constants are of type int and therefore signed. */
@@ -1344,7 +1371,8 @@ cpp_interpret_charconst (cpp_reader *pfile, const cpp_token *token,
cpp_error (pfile, CPP_DL_ERROR, "empty character constant");
return 0;
}
- else if (!cpp_interpret_string (pfile, &token->val.str, 1, &str, wide))
+ /* APPLE LOCAL pascal strings */
+ else if (!cpp_interpret_string (pfile, &token->val.str, 1, &str, wide, false))
return 0;
if (wide)
@@ -1405,7 +1433,17 @@ _cpp_convert_input (cpp_reader *pfile, const char *input_charset,
if (to.len + 4096 < to.asize || to.len >= to.asize)
to.text = xrealloc (to.text, to.len + 1);
- to.text[to.len] = '\n';
+ /* APPLE LOCAL begin mainline 2005-03-04 */
+ /* If the file is using old-school Mac line endings (\r only),
+ terminate with another \r, not an \n, so that we do not mistake
+ the \r\n sequence for a single DOS line ending and erroneously
+ issue the "No newline at end of file" diagnostic. */
+ if (to.text[to.len - 1] == '\r')
+ to.text[to.len] = '\r';
+ else
+ to.text[to.len] = '\n';
+ /* APPLE LOCAL end mainline 2005-03-04 */
+
*st_size = to.len;
return to.text;
}
diff --git a/libcpp/directives.c b/libcpp/directives.c
index 8a6d45ac191..2bad9543690 100644
--- a/libcpp/directives.c
+++ b/libcpp/directives.c
@@ -66,12 +66,20 @@ struct pragma_entry
means this directive should be handled even if -fpreprocessed is in
effect (these are the directives with callback hooks).
+ APPLE LOCAL begin pch distcc --mrs
+ IN_I_PCH means that this directive should be handled even if
+ -fpreprocessed is in effect as long as pch_preprocess is also in
+ effect.
+ APPLE LOCAL end pch distcc --mrs
+
EXPAND is set on directives that are always macro-expanded. */
#define COND (1 << 0)
#define IF_COND (1 << 1)
#define INCL (1 << 2)
#define IN_I (1 << 3)
#define EXPAND (1 << 4)
+/* APPLE LOCAL pch distcc --mrs */
+#define IN_I_PCH (1 << 5)
/* Defines one #-directive, including how to handle it. */
typedef void (*directive_handler) (cpp_reader *);
@@ -141,6 +149,8 @@ static void handle_assertion (cpp_reader *, const char *, int);
#define DIRECTIVE_TABLE \
D(define, T_DEFINE = 0, KANDR, IN_I) /* 270554 */ \
D(include, T_INCLUDE, KANDR, INCL | EXPAND) /* 52262 */ \
+/* APPLE LOCAL pch distcc --mrs */ \
+D(include_pch, T_INCLUDE_PCH, KANDR, INCL | IN_I_PCH) \
D(endif, T_ENDIF, KANDR, COND) /* 45855 */ \
D(ifdef, T_IFDEF, KANDR, COND | IF_COND) /* 22000 */ \
D(if, T_IF, KANDR, COND | IF_COND | EXPAND) /* 18162 */ \
@@ -212,7 +222,10 @@ skip_rest_of_line (cpp_reader *pfile)
static void
check_eol (cpp_reader *pfile)
{
- if (! SEEN_EOL () && _cpp_lex_token (pfile)->type != CPP_EOF)
+ /* APPLE LOCAL begin -Wextra-tokens 2001-08-02 --sts */
+ if (! SEEN_EOL () && _cpp_lex_token (pfile)->type != CPP_EOF
+ && CPP_OPTION (pfile, warn_extra_tokens))
+ /* APPLE LOCAL end -Wextra-tokens 2001-08-02 --sts */
cpp_error (pfile, CPP_DL_PEDWARN, "extra tokens at end of #%s directive",
pfile->directive->name);
}
@@ -385,7 +398,11 @@ _cpp_handle_directive (cpp_reader *pfile, int indented)
-fpreprocessed mode only if the # is in column 1. macro.c
puts a space in front of any '#' at the start of a macro. */
if (CPP_OPTION (pfile, preprocessed)
- && (indented || !(dir->flags & IN_I)))
+ /* APPLE LOCAL begin pch distcc --mrs */
+ && (indented || !(dir->flags & IN_I))
+ && ! (CPP_OPTION (pfile, pch_preprocess)
+ && (dir->flags & IN_I_PCH)))
+ /* APPLE LOCAL end pch distcc --mrs */
{
skip = 0;
dir = 0;
@@ -700,6 +717,14 @@ do_include (cpp_reader *pfile)
do_include_common (pfile, IT_INCLUDE);
}
+/* APPLE LOCAL begin pch distcc --mrs */
+static void
+do_include_pch (cpp_reader *pfile)
+{
+ do_include_common (pfile, IT_INCLUDE_PCH);
+}
+/* APPLE LOCAL end pch distcc --mrs */
+
static void
do_import (cpp_reader *pfile)
{
@@ -775,6 +800,13 @@ do_line (cpp_reader *pfile)
{
const struct line_maps *line_table = pfile->line_table;
const struct line_map *map = &line_table->maps[line_table->used - 1];
+
+ /* APPLE LOCAL begin mainline 2005-03-04 */
+ /* skip_rest_of_line() may cause line table to be realloc()ed so note down
+ sysp right now. */
+
+ unsigned char map_sysp = map->sysp;
+ /* APPLE LOCAL end mainline 2005-03-04 */
const cpp_token *token;
const char *new_file = map->to_file;
unsigned long new_lineno;
@@ -802,7 +834,8 @@ do_line (cpp_reader *pfile)
{
cpp_string s = { 0, 0 };
if (cpp_interpret_string_notranslate (pfile, &token->val.str, 1,
- &s, false))
+ /* APPLE LOCAL pascal strings */
+ &s, false, false))
new_file = (const char *)s.text;
check_eol (pfile);
}
@@ -815,7 +848,8 @@ do_line (cpp_reader *pfile)
skip_rest_of_line (pfile);
_cpp_do_file_change (pfile, LC_RENAME, new_file, new_lineno,
- map->sysp);
+ /* APPLE LOCAL mainline 2005-03-04 */
+ map_sysp);
}
/* Interpret the # 44 "file" [flags] notation, which has slightly
@@ -855,7 +889,8 @@ do_linemarker (cpp_reader *pfile)
{
cpp_string s = { 0, 0 };
if (cpp_interpret_string_notranslate (pfile, &token->val.str,
- 1, &s, false))
+ /* APPLE LOCAL pascal strings */
+ 1, &s, false, false))
new_file = (const char *)s.text;
new_sysp = 0;
@@ -937,7 +972,14 @@ static void
do_warning (cpp_reader *pfile)
{
/* We want #warning diagnostics to be emitted in system headers too. */
- do_diagnostic (pfile, CPP_DL_WARNING_SYSHDR, 1);
+ /* APPLE LOCAL begin handle -Wno-system-headers (2910306) --ilr */
+ /* Unless explicitly suppressed with -Wno-system-headers or
+ -Wno-#warning. */
+ if (!CPP_OPTION (pfile, no_pound_warnings)
+ && (!CPP_IN_SYSTEM_HEADER (pfile)
+ || CPP_OPTION (pfile, warn_system_headers)))
+ do_diagnostic (pfile, CPP_DL_WARNING_SYSHDR, 1);
+ /* APPLE LOCAL end handle -Wno-system-headers (2910306) --ilr */
}
/* Report program identification. */
@@ -1562,7 +1604,10 @@ do_else (cpp_reader *pfile)
ifs->mi_cmacro = 0;
/* Only check EOL if was not originally skipping. */
- if (!ifs->was_skipping && CPP_OPTION (pfile, warn_endif_labels))
+ /* APPLE LOCAL begin -Wextra-tokens */
+ if (!ifs->was_skipping
+ && (CPP_OPTION (pfile, warn_endif_labels) || CPP_OPTION (pfile, warn_extra_tokens)))
+ /* APPLE LOCAL end -Wextra-tokens */
check_eol (pfile);
}
}
@@ -1615,7 +1660,10 @@ do_endif (cpp_reader *pfile)
else
{
/* Only check EOL if was not originally skipping. */
- if (!ifs->was_skipping && CPP_OPTION (pfile, warn_endif_labels))
+ /* APPLE LOCAL begin -Wextra-tokens */
+ if (!ifs->was_skipping
+ && (CPP_OPTION (pfile, warn_endif_labels) || CPP_OPTION (pfile, warn_extra_tokens)))
+ /* APPLE LOCAL end -Wextra-tokens */
check_eol (pfile);
/* If potential control macro, we go back outside again. */
@@ -2002,6 +2050,20 @@ cpp_get_options (cpp_reader *pfile)
return &pfile->opts;
}
+/* APPLE LOCAL begin predictive compilation */
+void
+set_stdin_option (cpp_reader *pfile, int predict_comp_size)
+{
+ if (! CPP_OPTION (pfile, preprocessed))
+ {
+ /* -fpreprocessed -fpredictive-compilation=n: compiler is reading from
+ the processed file in this case. */
+ CPP_OPTION (pfile, predictive_compilation) = true;
+ CPP_OPTION (pfile, predictive_compilation_size) = predict_comp_size;
+ }
+}
+/* APPLE LOCAL end predictive compilation */
+
/* The callbacks structure. */
cpp_callbacks *
cpp_get_callbacks (cpp_reader *pfile)
@@ -2097,3 +2159,4 @@ _cpp_init_directives (cpp_reader *pfile)
node->directive_index = i;
}
}
+
diff --git a/libcpp/errors.c b/libcpp/errors.c
index 2aa814016a1..98d309a0e6a 100644
--- a/libcpp/errors.c
+++ b/libcpp/errors.c
@@ -28,6 +28,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "cpplib.h"
#include "internal.h"
+/* APPLE LOCAL error-colon */
+static int gcc_error_colon = 0;
static void print_location (cpp_reader *, source_location, unsigned int);
/* Print the logical file location (LINE, COL) in preparation for a
@@ -37,6 +39,23 @@ static void print_location (cpp_reader *, source_location, unsigned int);
static void
print_location (cpp_reader *pfile, source_location line, unsigned int col)
{
+ /* APPLE LOCAL begin error-colon */
+ const char *estr;
+ {
+ static int done = 0;
+ if ( ! done)
+ {
+ done = 1; /* Do this only once. */
+ /* Pretend we saw "-w" on commandline. */
+ if (getenv ("GCC_DASH_W"))
+ CPP_OPTION (pfile, inhibit_warnings) = 1; /* referenced by diagnostic.h:diagnostic_report_warnings() */
+ if (getenv ("GCC_ERROR_COLON"))
+ gcc_error_colon = 1;
+ }
+ }
+ estr = (gcc_error_colon) ? "error:" : "" ;
+ /* APPLE LOCAL end error-colon */
+
if (line == 0)
fprintf (stderr, "%s: ", progname);
else
@@ -55,12 +74,14 @@ print_location (cpp_reader *pfile, source_location line, unsigned int col)
col = 1;
}
+ /* APPLE LOCAL begin error-colon */
if (lin == 0)
- fprintf (stderr, "%s:", map->to_file);
+ fprintf (stderr, "%s:%s", map->to_file, estr);
else if (CPP_OPTION (pfile, show_column) == 0)
- fprintf (stderr, "%s:%u:", map->to_file, lin);
+ fprintf (stderr, "%s:%u:%s", map->to_file, lin, estr);
else
- fprintf (stderr, "%s:%u:%u:", map->to_file, lin, col);
+ fprintf (stderr, "%s:%u:%u:%s", map->to_file, lin, col, estr);
+ /* APPLE LOCAL end error-colon */
fputc (' ', stderr);
}
diff --git a/libcpp/files.c b/libcpp/files.c
index 593e5ebf0c8..0ea5722c02f 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -36,7 +36,9 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
# define FAB_C_VAR 2 /* variable length records (see Starlet fabdef.h) */
# define STAT_SIZE_RELIABLE(ST) ((ST).st_fab_rfm != FAB_C_VAR)
#else
-# define STAT_SIZE_RELIABLE(ST) true
+/* APPLE LOCAL begin predictive compilation */
+# define STAT_SIZE_RELIABLE(ST) (!CPP_OPTION (pfile, predictive_compilation))
+/* APPLE LOCAL end predictive compilation */
#endif
#ifdef __DJGPP__
@@ -177,6 +179,11 @@ static int pchf_save_compare (const void *e1, const void *e2);
static int pchf_compare (const void *d_p, const void *e_p);
static bool check_file_against_entries (cpp_reader *, _cpp_file *, bool);
+/* APPLE LOCAL begin distcc pch indirection --mrs */
+#include <sys/param.h>
+char *indirect_file (char *, const int);
+/* APPLE LOCAL end distcc pch indirection --mrs */
+
/* Given a filename in FILE->PATH, with the empty string interpreted
as <stdin>, open it.
@@ -248,9 +255,11 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
struct stat st;
bool valid = false;
- /* No PCH on <stdin> or if not requested. */
- if (file->name[0] == '\0' || !pfile->cb.valid_pch)
+ /* APPLE LOCAL begin predictive compilation */
+ /* No PCH on <stdin> or if predictive compilation or if not requested. */
+ if (pfile->is_main_file || file->name[0] == '\0' || !pfile->cb.valid_pch)
return false;
+ /* APPLE LOCAL end predictive compilation */
flen = strlen (path);
len = flen + sizeof (extension);
@@ -258,6 +267,11 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
memcpy (pchname, path, flen);
memcpy (pchname + flen, extension, sizeof (extension));
+ /* APPLE LOCAL begin distcc pch indirection --mrs */
+ if (! file->main_file)
+ pchname = indirect_file (pchname, 0);
+ /* APPLE LOCAL end distcc pch indirection --mrs */
+
if (stat (pchname, &st) == 0)
{
DIR *pchdir;
@@ -321,11 +335,21 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
if (path)
{
+ /* APPLE LOCAL predictive compilation */
+ bool res_open_file;
file->path = path;
if (pch_open_file (pfile, file, invalid_pch))
return true;
- if (open_file (file))
+ /* APPLE LOCAL begin predictive compilation */
+ /* Temporary path change to force opening stdin */
+ if (pfile->is_main_file)
+ file->path = "";
+ res_open_file = open_file (file);
+ file->path = path;
+
+ if (res_open_file)
+ /* APPLE LOCAL end predictive compilation */
return true;
if (file->err_no != ENOENT)
@@ -542,6 +566,17 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file)
size = file->st.st_size;
}
+ /* APPLE LOCAL begin predictive compilation */
+ else
+ if (CPP_OPTION (pfile, predictive_compilation))
+ {
+ size = CPP_OPTION (pfile, predictive_compilation_size);
+ regular = size >= 0;
+ if (size < 0)
+ size = 8 * 1024;
+ CPP_OPTION(pfile, predictive_compilation_size) = -1;
+ }
+ /* APPLE LOCAL end predictive compilation */
else
/* 8 kilobytes is a sensible starting size. It ought to be bigger
than the kernel pipe buffer, and it's definitely bigger than
@@ -601,8 +636,13 @@ read_file (cpp_reader *pfile, _cpp_file *file)
}
file->dont_read = !read_file_guts (pfile, file);
- close (file->fd);
- file->fd = -1;
+ /* APPLE LOCAL begin predictive compilation */
+ if (file->fd != 0) /* Don't close stdin */
+ {
+ close (file->fd);
+ file->fd = -1;
+ }
+ /* APPLE LOCAL end predictive compilation */
return !file->dont_read;
}
@@ -974,6 +1014,22 @@ new_file_hash_entry (cpp_reader *pfile)
return &pfile->file_hash_entries[pfile->file_hash_entries_used++];
}
+/* APPLE LOCAL begin predictive compilation */
+bool read_from_stdin (cpp_reader *pfile)
+{
+ _cpp_file *file;
+
+ if (pfile->buffer->file->fd != 0)
+ return false;
+
+ file = pfile->main_file;
+ file->dont_read = !read_file_guts (pfile, file);
+ pfile->buffer->next_line = file->buffer;
+ pfile->buffer->rlimit = file->buffer + file->st.st_size;
+ return !file->dont_read;
+}
+/* APPLE LOCAL end predictive compilation */
+
/* Returns TRUE if a file FNAME has ever been successfully opened.
This routine is not intended to correctly handle filenames aliased
by links or redundant . or .. traversals etc. */
@@ -1615,3 +1671,145 @@ check_file_against_entries (cpp_reader *pfile ATTRIBUTE_UNUSED,
return bsearch (&d, pchf->entries, pchf->count, sizeof (struct pchf_entry),
pchf_compare) != NULL;
}
+
+/* APPLE LOCAL begin distcc pch indirection --mrs */
+static const char message_terminator = '\n';
+
+/* Communications routine to communicate with filename translation
+ server for distributed builds. This routine reads data from the
+ server. */
+
+static int
+read_from_parent (int fd, char *buffer, int size)
+{
+ int index = 0;
+ int result;
+
+ if (size <= 0)
+ return 0;
+
+ do {
+ result = read (fd, &buffer[index], size - index);
+
+ if (result <= 0 || index >= size )
+ return 0;
+ else
+ index += result;
+ } while (buffer[index - 1] != message_terminator);
+
+ /* Straighten out the string termination. */
+ buffer[index - 1] = '\0';
+
+ return 1;
+}
+
+/* Communications routine to communicate with filename translation server
+ for distributed builds. This routine writes data to the server. */
+
+static int
+write_to_parent (int fd, const char *message)
+{
+ int result;
+
+ if (message) {
+ const int length = strlen (message);
+ int index = 0;
+
+ while (index < length) {
+ result = write (fd, &message[index], length - index);
+
+ if (result < 0)
+ return 0;
+ else
+ index += result;
+ }
+ }
+
+ result = write (fd, &message_terminator, 1);
+
+ if (result < 0)
+ return 0;
+
+ return 1;
+}
+
+
+/* Initialize the filename translation service. */
+
+static int
+init_indirect_pipes (int *read_fd, int *write_fd)
+{
+ const char *file_indirect_pipes = getenv ("GCC_INDIRECT_FILES");
+ const char *protocol_operation = "VERS";
+ const char *protocol_version = "1";
+ char response[MAXPATHLEN];
+
+ if (!file_indirect_pipes)
+ return -1;
+
+ /* The environment variable indicates that the process that invoked
+ gcc would like to provide a different path for certain files.
+ This is mainly intended to be used with PCH headers and symbol
+ separation files (.cinfo) files under certain circumstances. */
+
+ if (sscanf (file_indirect_pipes, "%d, %d", read_fd, write_fd) != 2)
+ return -1;
+
+ /* Verify the protocol version. */
+ if (write_to_parent (*write_fd, protocol_operation))
+ if (write_to_parent (*write_fd, protocol_version))
+ if (read_from_parent (*read_fd, response, MAXPATHLEN))
+ if (strcmp ("OK", response) == 0)
+ return 1;
+
+ return -1;
+}
+
+/* Redirect file I/O at the direction of a translation server. fname
+ is the filename to transform. OPERATION is:
+
+ 0 for reading
+ 1 for writing
+ 2 for reading and writing */
+
+char *
+indirect_file (char *fname, int operation)
+{
+ static int indirection_initialized;
+ static int read_fd;
+ static int write_fd;
+ const char *operation_identifier = NULL;
+
+ if (!indirection_initialized)
+ indirection_initialized = init_indirect_pipes (&read_fd, &write_fd);
+
+ if (indirection_initialized != 1)
+ return fname;
+
+ switch (operation)
+ {
+ case 0:
+ operation_identifier = "PULL";
+ break;
+ case 1:
+ operation_identifier = "PUSH";
+ break;
+ case 2:
+ operation_identifier = "BOTH";
+ break;
+ default:
+ return fname;
+ }
+
+ if (write_to_parent (write_fd, operation_identifier))
+ if (write_to_parent (write_fd, fname))
+ {
+ char response[MAXPATHLEN];
+
+ if (read_from_parent (read_fd, response, MAXPATHLEN))
+ fname = xstrdup (response);
+ }
+
+ return fname;
+}
+/* APPLE LOCAL end distcc pch indirection --mrs */
diff --git a/libcpp/include/cpplib.h b/libcpp/include/cpplib.h
index c3814460705..2be20f9eb71 100644
--- a/libcpp/include/cpplib.h
+++ b/libcpp/include/cpplib.h
@@ -129,8 +129,14 @@ struct _cpp_file;
TK(STRING, LITERAL) /* "string" */ \
TK(WSTRING, LITERAL) /* L"string" */ \
TK(OBJC_STRING, LITERAL) /* @"string" - Objective-C */ \
+ /* APPLE LOCAL pascal strings */ \
+ TK(PASCAL_STRING, LITERAL) /* Pascal ("\p...") string */ \
TK(HEADER_NAME, LITERAL) /* <stdio.h> in #include */ \
\
+ /* APPLE LOCAL begin CW asm blocks */ \
+ TK(BOL, LITERAL) /* asm bol */ \
+ TK(EOL, LITERAL) /* asm eol */ \
+ /* APPLE LOCAL end CW asm blocks */ \
TK(COMMENT, LITERAL) /* Only if output comments. */ \
/* SPELL_LITERAL happens to DTRT. */ \
TK(MACRO_ARG, NONE) /* Macro argument. */ \
@@ -243,6 +249,11 @@ struct cpp_options
/* Characters between tab stops. */
unsigned int tabstop;
+ /* APPLE LOCAL begin predictive compilation */
+ bool predictive_compilation;
+ int predictive_compilation_size;
+ /* APPLE LOCAL end predictive compilation */
+
/* The language we're preprocessing. */
enum c_lang lang;
@@ -301,6 +312,27 @@ struct cpp_options
/* Nonzero means warn if there are any trigraphs. */
unsigned char warn_trigraphs;
+ /* APPLE LOCAL begin -Wextra-tokens 2001-08-02 --sts */
+ /* Nonzero means warn if extra tokens at end of directives. */
+ unsigned char warn_extra_tokens;
+ /* APPLE LOCAL end -Wextra-tokens 2001-08-02 --sts */
+ /* APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts */
+ /* Nonzero means warn if no newline at end of file. */
+ unsigned char warn_newline_at_eof;
+ /* APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts */
+ /* APPLE LOCAL begin -Wfour-char-constants */
+ /* Warn about four-char literals (e.g., MacOS-style OSTypes: 'APPL'). */
+ unsigned char warn_four_char_constants;
+ /* APPLE LOCAL end -Wfour-char-constants */
+
+ /* APPLE LOCAL begin pascal strings */
+ /* Nonzero means allow "\p...." Pascal string literals, where '\p'
+ is replaced with the length of the remaining string (excluding the
+ terminating NUL). Pascal string literals have type
+ 'const unsigned char *'. */
+ unsigned char pascal_strings;
+ /* APPLE LOCAL end pascal strings */
+
/* Nonzero means warn about multicharacter charconsts. */
unsigned char warn_multichar;
@@ -361,6 +393,11 @@ struct cpp_options
/* Nonzero means handle C++ alternate operator names. */
unsigned char operator_names;
+ /* APPLE LOCAL begin -Wno-#warnings */
+ /* Nonzero means suppress all #warning messages. (Radar 2796309) */
+ int no_pound_warnings;
+ /* APPLE LOCAL end -Wno-#warnings */
+
/* True for traditional preprocessing. */
unsigned char traditional;
@@ -379,6 +416,20 @@ struct cpp_options
/* True if dependencies should be restored from a precompiled header. */
bool restore_pch_deps;
+ /* APPLE LOCAL begin Symbol Separation */
+ unsigned char making_pch;
+ unsigned char making_ss;
+ /* True to warn about symbol repositories we couldn't use. */
+ bool warn_invalid_sr;
+ bool use_ss;
+ /* APPLE LOCAL end Symbol Separation */
+
+ /* APPLE LOCAL begin pch distcc --mrs */
+ /* True if PCH should omit from the -E output all lines from PCH files
+ found in PCH files. */
+ unsigned char pch_preprocess;
+ /* APPLE LOCAL end pch distcc --mrs */
+
/* Dependency generation. */
struct
{
@@ -447,6 +498,21 @@ struct cpp_callbacks
int (*valid_pch) (cpp_reader *, const char *, int);
void (*read_pch) (cpp_reader *, const char *, int, const char *);
missing_header_cb missing_header;
+
+ /* APPLE LOCAL begin Symbol Separation */
+ void (*restore_write_symbols) (void);
+ void (*clear_write_symbols) (const char *, unsigned long);
+ void (*start_symbol_repository) (unsigned int, const char *, unsigned long);
+ void (*end_symbol_repository) (unsigned int);
+ int (*is_builtin_identifier) (cpp_hashnode *);
+ /* APPLE LOCAL end Symbol Separation */
+ /* APPLE LOCAL - PCH distcc debugging --mrs */
+ void (*set_working_directory)(const char *);
+ /* APPLE LOCAL begin AltiVec */
+ /* Context-sensitive macro support. Returns macro (if any) that should
+ be expanded. */
+ cpp_hashnode * (*macro_to_expand) (cpp_reader *, const cpp_token *);
+ /* APPLE LOCAL end AltiVec */
};
/* Chain of directories to look for include files in. */
@@ -467,6 +533,13 @@ struct cpp_dir
platforms. A NULL-terminated array of (from, to) pairs. */
const char **name_map;
+ /* APPLE LOCAL begin headermaps 3871393 */
+ /* Arbitrary mapping of include strings to paths of redirected
+ files. Contents are a special data format -- see struct
+ hmap_header_map below. */
+ void *header_map;
+ /* APPLE LOCAL end headermaps 3871393 */
+
/* Routine to construct pathname, given the search path name and the
HEADER we are trying to find, return a constructed pathname to
try and open. If this is NULL, the constructed pathname is as
@@ -504,6 +577,8 @@ extern const char *progname;
#define NODE_WARN (1 << 4) /* Warn if redefined or undefined. */
#define NODE_DISABLED (1 << 5) /* A disabled macro. */
#define NODE_MACRO_ARG (1 << 6) /* Used during #define processing. */
+/* APPLE LOCAL AltiVec */
+#define NODE_CONDITIONAL (1 << 7) /* Conditional macro */
/* Different flavors of hash node. */
enum node_type
@@ -576,6 +651,20 @@ struct cpp_hashnode GTY(())
} GTY ((desc ("CPP_HASHNODE_VALUE_IDX (%1)"))) value;
};
+/* APPLE LOCAL begin Symbol Separation */
+struct cpp_stab_checksum GTY(())
+{
+ unsigned long checksum;
+};
+extern void cpp_write_symbol_deps PARAMS ((struct cpp_reader *));
+extern void cpp_read_stabs_checksum PARAMS ((struct cpp_reader *, int));
+extern unsigned long cpp_get_stabs_checksum PARAMS ((void));
+extern void cpp_calculate_stabs_checksum PARAMS ((const char *));
+extern const char * cpp_symbol_separation_init PARAMS ((struct cpp_reader *, const char *,
+ const char *));
+
+/* APPLE LOCAL end Symbol Separation */
+
/* Call this first to get a handle to pass to other functions.
If you want cpplib to manage its own hashtable, pass in a NULL
@@ -646,6 +735,10 @@ extern int cpp_avoid_paste (cpp_reader *, const cpp_token *,
extern const cpp_token *cpp_get_token (cpp_reader *);
extern const unsigned char *cpp_macro_definition (cpp_reader *,
const cpp_hashnode *);
+/* APPLE LOCAL begin AltiVec */
+extern const cpp_token *_cpp_peek_token (cpp_reader *, int);
+extern void _cpp_backup_tokens_direct (cpp_reader *, unsigned int);
+/* APPLE LOCAL end AltiVec */
extern void _cpp_backup_tokens (cpp_reader *, unsigned int);
/* Evaluate a CPP_CHAR or CPP_WCHAR token. */
@@ -654,10 +747,12 @@ extern cppchar_t cpp_interpret_charconst (cpp_reader *, const cpp_token *,
/* Evaluate a vector of CPP_STRING or CPP_WSTRING tokens. */
extern bool cpp_interpret_string (cpp_reader *,
const cpp_string *, size_t,
- cpp_string *, bool);
+ /* APPLE LOCAL pascal strings */
+ cpp_string *, bool, bool);
extern bool cpp_interpret_string_notranslate (cpp_reader *,
const cpp_string *, size_t,
- cpp_string *, bool);
+ /* APPLE LOCAL pascal strings */
+ cpp_string *, bool, bool);
/* Used to register macros and assertions, perhaps from the command line.
The text is the same as the command line argument. */
@@ -763,6 +858,40 @@ extern void cpp_errno (cpp_reader *, int, const char *msgid);
extern void cpp_error_with_line (cpp_reader *, int, source_location, unsigned,
const char *msgid, ...) ATTRIBUTE_PRINTF_5;
+/* APPLE LOCAL begin headermaps 3871393 */
+#define HMAP_SAME_ENDIANNESS_MAGIC (((((('h' << 8) | 'm') << 8) | 'a') << 8) | 'p')
+#define HMAP_OPPOSITE_ENDIANNESS_MAGIC (((((('p' << 8) | 'a') << 8) | 'm') << 8) | 'h')
+
+#define HMAP_NOT_A_KEY 0x00000000
+
+#if !defined(uint32)
+typedef unsigned short uint16;
+typedef unsigned long uint32;
+#endif
+
+struct hmap_bucket
+{
+ uint32 key; /* Offset (into strings) of key */
+ struct {
+ uint32 prefix; /* Offset (into strings) of value prefix */
+ uint32 suffix; /* Offset (into strings) of value suffix */
+ } value; /* Value (prefix- and suffix-strings) */
+};
+
+struct hmap_header_map
+{
+ uint32 magic; /* Magic word, also indicates byte order */
+ uint16 version; /* Version number -- currently 1 */
+ uint16 _reserved; /* Reserved for future use -- zero for now */
+ uint32 strings_offset; /* Offset to start of string pool */
+ uint32 count; /* Number of entries in the string table */
+ uint32 capacity; /* Number of buckets (always a power of 2) */
+ uint32 max_value_length; /* Length of longest result path (excl. '\0') */
+ struct hmap_bucket buckets[1]; /* Inline array of 'capacity' maptable buckets */
+ /* Strings follow the buckets, at strings_offset. */
+};
+/* APPLE LOCAL end headermaps 3871393 */
+
/* In cpplex.c */
extern int cpp_ideq (const cpp_token *, const char *);
extern void cpp_output_line (cpp_reader *, FILE *);
@@ -803,6 +932,11 @@ extern cpp_buffer *cpp_get_buffer (cpp_reader *);
extern struct _cpp_file *cpp_get_file (cpp_buffer *);
extern cpp_buffer *cpp_get_prev (cpp_buffer *);
+/* APPLE LOCAL begin predictive compilation */
+extern bool read_from_stdin PARAMS ((cpp_reader *));
+extern void set_stdin_option PARAMS ((cpp_reader *, int));
+/* APPLE LOCAL end predictive compilation */
+
/* In cpppch.c */
struct save_macro_data;
extern int cpp_save_state (cpp_reader *, FILE *);
diff --git a/libcpp/init.c b/libcpp/init.c
index 39e50f5a519..3e529e63909 100644
--- a/libcpp/init.c
+++ b/libcpp/init.c
@@ -140,6 +140,19 @@ cpp_create_reader (enum c_lang lang, hash_table *table,
pfile = xcalloc (1, sizeof (cpp_reader));
cpp_set_lang (pfile, lang);
+ /* APPLE LOCAL begin -Wextra-tokens 2001-08-01 --sts */
+ /* Suppress warnings about extra tokens after #endif etc. */
+ CPP_OPTION (pfile, warn_extra_tokens) = 0;
+ /* APPLE LOCAL end -Wextra-tokens 2001-08-01 --sts */
+ /* APPLE LOCAL begin -Wnewline-eof 2001-08-23 --sts */
+ /* Suppress warnings about missing newlines at ends of files. */
+ CPP_OPTION (pfile, warn_newline_at_eof) = 0;
+ /* APPLE LOCAL end -Wnewline-eof 2001-08-23 --sts */
+ /* APPLE LOCAL begin -Wfour-char-constants */
+ CPP_OPTION (pfile, warn_four_char_constants) = 1;
+ /* APPLE LOCAL end -Wfour-char-constants */
+ /* APPLE LOCAL pascal strings */
+ CPP_OPTION (pfile, pascal_strings) = 0;
CPP_OPTION (pfile, warn_multichar) = 1;
CPP_OPTION (pfile, discard_comments) = 1;
CPP_OPTION (pfile, discard_comments_in_macro_exp) = 1;
@@ -147,8 +160,12 @@ cpp_create_reader (enum c_lang lang, hash_table *table,
CPP_OPTION (pfile, tabstop) = 8;
CPP_OPTION (pfile, operator_names) = 1;
CPP_OPTION (pfile, warn_trigraphs) = 2;
- CPP_OPTION (pfile, warn_endif_labels) = 1;
- CPP_OPTION (pfile, warn_deprecated) = 1;
+ /* APPLE LOCAL begin -Wextra-tokens */
+ /* Suppress warnings about extra tokens after #endif etc. */
+ CPP_OPTION (pfile, warn_endif_labels) = 0;
+ /* APPLE LOCAL end -Wextra-tokens */
+ /* APPLE LOCAL suppress useful warnings */
+ CPP_OPTION (pfile, warn_deprecated) = 0;
CPP_OPTION (pfile, warn_long_long) = !CPP_OPTION (pfile, c99);
CPP_OPTION (pfile, dollars_in_ident) = 1;
CPP_OPTION (pfile, warn_dollars) = 1;
@@ -459,8 +476,14 @@ cpp_read_main_file (cpp_reader *pfile, const char *fname)
deps_add_default_target (pfile->deps, fname);
}
+ /* APPLE LOCAL begin predictive compilation */
+ pfile->is_main_file = CPP_OPTION (pfile, predictive_compilation);
+ /* APPLE LOCAL end predictive compilation */
pfile->main_file
= _cpp_find_file (pfile, fname, &pfile->no_search_path, false);
+ /* APPLE LOCAL begin predictive compilation */
+ pfile->is_main_file = false;
+ /* APPLE LOCAL end predictive compilation */
if (_cpp_find_failed (pfile->main_file))
return NULL;
diff --git a/libcpp/internal.h b/libcpp/internal.h
index 0ae13d58cb6..89576aad980 100644
--- a/libcpp/internal.h
+++ b/libcpp/internal.h
@@ -115,7 +115,8 @@ extern unsigned char *_cpp_unaligned_alloc (cpp_reader *, size_t);
#define BUFF_LIMIT(BUFF) ((BUFF)->limit)
/* #include types. */
-enum include_type {IT_INCLUDE, IT_INCLUDE_NEXT, IT_IMPORT, IT_CMDLINE};
+/* APPLE LOCAL pch distcc --mrs */
+enum include_type {IT_INCLUDE, IT_INCLUDE_PCH, IT_INCLUDE_NEXT, IT_IMPORT, IT_CMDLINE};
union utoken
{
@@ -171,6 +172,11 @@ struct cpp_context
/* True if utoken element is token, else ptoken. */
bool direct_p;
+
+ /* APPLE LOCAL begin CW asm blocks */
+ /* True if this expansion is at the beginning of a line. */
+ bool bol_p;
+ /* APPLE LOCAL end CW asm blocks */
};
struct lexer_state
@@ -341,6 +347,9 @@ struct cpp_reader
struct _cpp_file *all_files;
struct _cpp_file *main_file;
+ /* APPLE LOCAL begin predictive compilation */
+ bool is_main_file;
+ /* APPLE LOCAL end predictive compilation */
/* File and directory hash table. */
struct htab *file_hash;
@@ -472,6 +481,10 @@ extern unsigned char _cpp_trigraph_map[UCHAR_MAX + 1];
/* Macros. */
+/* APPLE LOCAL begin warning in system headers */
+#define CPP_IN_SYSTEM_HEADER(PFILE) ((PFILE)->line_table && (PFILE)->line_table->maps && (PFILE)->line_table->maps->sysp)
+/* APPLE LOCAL end warning in system headers */
+
static inline int cpp_in_system_header (cpp_reader *);
static inline int
cpp_in_system_header (cpp_reader *pfile)
diff --git a/libcpp/lex.c b/libcpp/lex.c
index 62a28f81b87..510873044ff 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -24,6 +24,12 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "cpplib.h"
#include "internal.h"
+/* APPLE LOCAL begin CW asm blocks */
+/* A hack that would be better done with a callback or some such. */
+extern enum cw_asm_states { cw_asm_none, cw_asm_decls, cw_asm_asm } cw_asm_state;
+extern int cw_asm_in_operands;
+/* APPLE LOCAL end CW asm blocks */
+
enum spell_type
{
SPELL_OPERATOR = 0,
@@ -474,6 +480,8 @@ lex_identifier (cpp_reader *pfile, const uchar *base)
unsigned int len;
unsigned int hash = HT_HASHSTEP (0, *base);
+ /* APPLE LOCAL CW asm blocks */
+ while (1) {
cur = pfile->buffer->cur;
for (;;)
{
@@ -498,6 +506,21 @@ lex_identifier (cpp_reader *pfile, const uchar *base)
len = cur - base;
hash = HT_HASHFINISH (hash, len);
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Allow [.+-] in CW asm opcodes (PowerPC specific). Do this here
+ so we don't have to figure out "bl- 45" vs "bl -45". */
+ if (cw_asm_state < cw_asm_decls
+ || cw_asm_in_operands
+ || !(*pfile->buffer->cur == '.'
+ || *pfile->buffer->cur == '+'
+ || *pfile->buffer->cur == '-'))
+ break;
+ /* Pick up the non-alpha char and go around again. */
+ pfile->buffer->cur++;
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
+
result = (cpp_hashnode *)
ht_lookup_with_hash (pfile->hash_table, base, len, hash, HT_ALLOC);
@@ -681,6 +704,47 @@ next_tokenrun (tokenrun *run)
return run->next;
}
+/* APPLE LOCAL begin AltiVec */
+/* Look ahead in the input stream. */
+const cpp_token *
+_cpp_peek_token (cpp_reader *pfile, int index)
+{
+ cpp_context *context = pfile->context;
+ const cpp_token *peektok;
+ int count;
+
+ /* First, scan through any pending cpp_context objects. */
+ while (context->prev)
+ {
+ ptrdiff_t sz = (context->direct_p
+ ? LAST (context).token - FIRST (context).token
+ : LAST (context).ptoken - FIRST (context).ptoken);
+
+ if (index < (int) sz)
+ return (context->direct_p
+ ? FIRST (context).token + index
+ : *(FIRST (context).ptoken + index));
+
+ index -= (int) sz;
+ context = context->prev;
+ }
+
+ /* We will have to read some new tokens after all (and do so
+ without invalidating preceding tokens). */
+ count = index;
+ pfile->keep_tokens++;
+
+ do
+ peektok = _cpp_lex_token (pfile);
+ while (index--);
+
+ _cpp_backup_tokens_direct (pfile, count + 1);
+ pfile->keep_tokens--;
+
+ return peektok;
+}
+/* APPLE LOCAL end AltiVec */
+
/* Allocate a single token that is invalidated at the same time as the
rest of the tokens on the line. Has its line and col set to the
same as the last lexed token, so that diagnostics appear in the
@@ -689,9 +753,34 @@ cpp_token *
_cpp_temp_token (cpp_reader *pfile)
{
cpp_token *old, *result;
+ /* APPLE LOCAL begin AltiVec */
+ ptrdiff_t sz = pfile->cur_run->limit - pfile->cur_token;
+ ptrdiff_t la = (ptrdiff_t) pfile->lookaheads;
+ /* APPLE LOCAL end AltiVec */
old = pfile->cur_token - 1;
- if (pfile->cur_token == pfile->cur_run->limit)
+ /* APPLE LOCAL begin AltiVec */
+ /* Any pre-existing lookaheads must not be clobbered. */
+ if (la)
+ {
+ if (sz <= la)
+ {
+ tokenrun *next = next_tokenrun (pfile->cur_run);
+
+ if (sz < la)
+ memmove (next->base + 1, next->base,
+ (la - sz) * sizeof (cpp_token));
+
+ next->base[0] = pfile->cur_run->limit[-1];
+ }
+
+ if (sz > 1)
+ memmove (pfile->cur_token + 1, pfile->cur_token,
+ MIN (la, sz - 1) * sizeof (cpp_token));
+ }
+
+ if (!sz)
+ /* APPLE LOCAL end AltiVec */
{
pfile->cur_run = next_tokenrun (pfile->cur_run);
pfile->cur_token = pfile->cur_run->base;
@@ -742,6 +831,11 @@ _cpp_lex_token (cpp_reader *pfile)
else
{
result = &pfile->directive_result;
+
+ /* APPLE LOCAL begin CW asm blocks C++ */
+ /* We put this back on the result. */
+ result->flags |= BOL;
+ /* APPLE LOCAL end CW asm blocks C++ */
break;
}
}
@@ -783,6 +877,12 @@ _cpp_get_fresh_line (cpp_reader *pfile)
if (!buffer->need_line)
return true;
+ /* APPLE LOCAL begin predictive compilation */
+ if (CPP_OPTION (pfile, predictive_compilation)
+ && buffer->next_line >= buffer->rlimit)
+ read_from_stdin (pfile);
+ /* APPLE LOCAL end predictive compilation */
+
if (buffer->next_line < buffer->rlimit)
{
_cpp_clean_line (pfile);
@@ -800,9 +900,14 @@ _cpp_get_fresh_line (cpp_reader *pfile)
{
/* Only warn once. */
buffer->next_line = buffer->rlimit;
- cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line,
- CPP_BUF_COLUMN (buffer, buffer->cur),
- "no newline at end of file");
+ /* APPLE LOCAL begin suppress no newline warning. */
+ if ( CPP_OPTION (pfile, warn_newline_at_eof))
+ {
+ cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line_table->highest_line,
+ CPP_BUF_COLUMN (buffer, buffer->cur),
+ "no newline at end of file");
+ }
+ /* APPLE LOCAL end suppress no newline warning. */
}
return_at_eof = buffer->return_at_eof;
@@ -821,6 +926,10 @@ _cpp_get_fresh_line (cpp_reader *pfile)
} \
while (0)
+/* APPLE LOCAL begin CW asm blocks */
+static int cw_asm_label_follows;
+/* APPLE LOCAL end CW asm blocks */
+
/* Lex a token into pfile->cur_token, which is also incremented, to
get diagnostics pointing to the correct location.
@@ -897,6 +1006,12 @@ _cpp_lex_direct (cpp_reader *pfile)
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
+ /* APPLE LOCAL begin CW asm blocks */
+ /* An '@' in assembly code makes a following digit string into
+ an identifier. */
+ if (cw_asm_label_follows)
+ goto start_ident;
+ /* APPLE LOCAL end CW asm blocks */
result->type = CPP_NUMBER;
lex_number (pfile, &result->val.str);
break;
@@ -910,6 +1025,8 @@ _cpp_lex_direct (cpp_reader *pfile)
}
/* Fall through. */
+ /* APPLE LOCAL CW asm blocks */
+ start_ident:
case '_':
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
case 'g': case 'h': case 'i': case 'j': case 'k': case 'l':
@@ -930,6 +1047,10 @@ _cpp_lex_direct (cpp_reader *pfile)
result->flags |= NAMED_OP;
result->type = result->val.node->directive_index;
}
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Got an identifier, reset the CW asm label hack flag. */
+ cw_asm_label_follows = 0;
+ /* APPLE LOCAL end CW asm blocks */
break;
case '\'':
@@ -1142,10 +1263,24 @@ _cpp_lex_direct (cpp_reader *pfile)
case ']': result->type = CPP_CLOSE_SQUARE; break;
case '{': result->type = CPP_OPEN_BRACE; break;
case '}': result->type = CPP_CLOSE_BRACE; break;
- case ';': result->type = CPP_SEMICOLON; break;
-
- /* @ is a punctuator in Objective-C. */
- case '@': result->type = CPP_ATSIGN; break;
+ /* APPLE LOCAL begin CW asm blocks */
+ case ';':
+ /* ';' separates instructions in CW asm, so flag that we're no
+ longer seeing operands. */
+ if (cw_asm_state >= cw_asm_decls)
+ cw_asm_in_operands = 0;
+ result->type = CPP_SEMICOLON;
+ break;
+ case '@':
+ /* In CW asm, @ can indicate a label, which may consist of
+ either letters or digits, so set a hack flag for this. (We
+ still want to return the @ as a separate token so that the
+ parser can distinguish labels from opcodes.) */
+ if (cw_asm_state >= cw_asm_decls)
+ cw_asm_label_follows = 1;
+ result->type = CPP_ATSIGN;
+ break;
+ /* APPLE LOCAL end CW asm blocks */
case '$':
case '\\':
diff --git a/libcpp/macro.c b/libcpp/macro.c
index 5e596699e01..19584980125 100644
--- a/libcpp/macro.c
+++ b/libcpp/macro.c
@@ -40,7 +40,10 @@ struct macro_arg
/* Macro expansion. */
-static int enter_macro_context (cpp_reader *, cpp_hashnode *);
+/* APPLE LOCAL begin CW asm blocks */
+extern int flag_cw_asm_blocks;
+static int enter_macro_context (cpp_reader *, cpp_hashnode *, int bol_p);
+/* APPLE LOCAL end CW asm blocks */
static int builtin_macro (cpp_reader *, cpp_hashnode *);
static void push_token_context (cpp_reader *, cpp_hashnode *,
const cpp_token *, unsigned int);
@@ -714,7 +717,8 @@ funlike_invocation_p (cpp_reader *pfile, cpp_hashnode *node)
containing its yet-to-be-rescanned replacement list and return one.
Otherwise, we don't push a context and return zero. */
static int
-enter_macro_context (cpp_reader *pfile, cpp_hashnode *node)
+/* APPLE LOCAL CW asm blocks */
+enter_macro_context (cpp_reader *pfile, cpp_hashnode *node, int bol_p)
{
/* The presence of a macro invalidates a file's controlling macro. */
pfile->mi_valid = false;
@@ -761,6 +765,12 @@ enter_macro_context (cpp_reader *pfile, cpp_hashnode *node)
if (macro->paramc == 0)
push_token_context (pfile, node, macro->exp.tokens, macro->count);
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Mark this context as being at the beginning of a line. */
+ if (bol_p && pfile->context)
+ pfile->context->bol_p = true;
+ /* APPLE LOCAL end CW asm blocks */
+
return 1;
}
@@ -947,6 +957,8 @@ push_ptoken_context (cpp_reader *pfile, cpp_hashnode *macro, _cpp_buff *buff,
context->direct_p = false;
context->macro = macro;
context->buff = buff;
+ /* APPLE LOCAL CW asm blocks */
+ context->bol_p = false;
FIRST (context).ptoken = first;
LAST (context).ptoken = first + count;
}
@@ -961,6 +973,8 @@ push_token_context (cpp_reader *pfile, cpp_hashnode *macro,
context->direct_p = true;
context->macro = macro;
context->buff = NULL;
+ /* APPLE LOCAL CW asm blocks */
+ context->bol_p = false;
FIRST (context).token = first;
LAST (context).token = first + count;
}
@@ -1059,7 +1073,8 @@ _cpp_pop_context (cpp_reader *pfile)
const cpp_token *
cpp_get_token (cpp_reader *pfile)
{
- const cpp_token *result;
+ /* APPLE LOCAL CW asm blocks */
+ cpp_token *result; /* not 'const' */
for (;;)
{
@@ -1076,6 +1091,16 @@ cpp_get_token (cpp_reader *pfile)
else
result = *FIRST (context).ptoken++;
+ /* APPLE LOCAL begin CW asm blocks */
+ /* Make the context's bol flag stick to the first token, and
+ only the first. */
+ if (context->bol_p)
+ {
+ result->flags |= BOL;
+ context->bol_p = false;
+ }
+ /* APPLE LOCAL end CW asm blocks */
+
if (result->flags & PASTE_LEFT)
{
paste_all_tokens (pfile, result);
@@ -1106,7 +1131,15 @@ cpp_get_token (cpp_reader *pfile)
if (!(node->flags & NODE_DISABLED))
{
if (!pfile->state.prevent_expansion
- && enter_macro_context (pfile, node))
+ /* APPLE LOCAL begin AltiVec */
+ /* Conditional macros require that a predicate be
+ evaluated first. */
+ && (!(node->flags & NODE_CONDITIONAL)
+ || (pfile->cb.macro_to_expand
+ && (node = pfile->cb.macro_to_expand (pfile, result))))
+ /* APPLE LOCAL end AltiVec */
+ /* APPLE LOCAL CW asm blocks */
+ && enter_macro_context (pfile, node, (flag_cw_asm_blocks && result->flags & BOL)))
{
if (pfile->state.in_directive)
continue;
@@ -1164,26 +1197,34 @@ cpp_scan_nooutput (cpp_reader *pfile)
pfile->state.prevent_expansion--;
}
+/* APPLE LOCAL begin AltiVec */
+/* Step back one or more tokens obtained from the lexer. */
+void
+_cpp_backup_tokens_direct (cpp_reader *pfile, unsigned int count)
+{
+ pfile->lookaheads += count;
+ while (count--)
+ {
+ pfile->cur_token--;
+ if (pfile->cur_token == pfile->cur_run->base
+ /* Possible with -fpreprocessed and no leading #line. */
+ && pfile->cur_run->prev != NULL)
+ {
+ pfile->cur_run = pfile->cur_run->prev;
+ pfile->cur_token = pfile->cur_run->limit;
+ }
+ }
+}
+/* APPLE LOCAL end AltiVec */
+
/* Step back one (or more) tokens. Can only step mack more than 1 if
they are from the lexer, and not from macro expansion. */
void
_cpp_backup_tokens (cpp_reader *pfile, unsigned int count)
{
if (pfile->context->prev == NULL)
- {
- pfile->lookaheads += count;
- while (count--)
- {
- pfile->cur_token--;
- if (pfile->cur_token == pfile->cur_run->base
- /* Possible with -fpreprocessed and no leading #line. */
- && pfile->cur_run->prev != NULL)
- {
- pfile->cur_run = pfile->cur_run->prev;
- pfile->cur_token = pfile->cur_run->limit;
- }
- }
- }
+ /* APPLE LOCAL AltiVec */
+ _cpp_backup_tokens_direct (pfile, count);
else
{
if (count != 1)
@@ -1209,6 +1250,13 @@ warn_of_redefinition (cpp_reader *pfile, const cpp_hashnode *node,
if (node->flags & NODE_WARN)
return true;
+ /* APPLE LOCAL begin AltiVec */
+ /* Redefinitions of conditional (context-sensitive) macros, on
+ the other hand, must be allowed silently. */
+ if (node->flags & NODE_CONDITIONAL)
+ return false;
+ /* APPLE LOCAL end AltiVec */
+
/* Redefinition of a macro is allowed if and only if the old and new
definitions are the same. (6.10.3 paragraph 2). */
macro1 = node->value.macro;
diff --git a/libcpp/makedepend.c b/libcpp/makedepend.c
index f28f9699828..777427d2542 100644
--- a/libcpp/makedepend.c
+++ b/libcpp/makedepend.c
@@ -27,6 +27,13 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "getopt.h"
#include "mkdeps.h"
+/* APPLE LOCAL begin CW asm blocks -sshebs */
+/* Dummies needed because we use them from cpplib, yuck. */
+int flag_cw_asm_blocks;
+int cw_asm_state;
+int cw_asm_in_operands;
+/* APPLE LOCAL end CW asm blocks -sshebs */
+
const char *progname;
const char *vpath;
diff --git a/libcpp/pch.c b/libcpp/pch.c
index 79900c30c36..1fbc49f1bde 100644
--- a/libcpp/pch.c
+++ b/libcpp/pch.c
@@ -223,7 +223,7 @@ count_defs (cpp_reader *pfile ATTRIBUTE_UNUSED, cpp_hashnode *hn, void *ss_p)
{
struct cpp_string news;
void **slot;
-
+
news.len = NODE_LEN (hn);
news.text = NODE_NAME (hn);
slot = htab_find (ss->definedhash, &news);
@@ -423,7 +423,14 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
struct ht_node_list nl = { 0, 0, 0 };
unsigned char *first, *last;
unsigned int i;
-
+ /* APPLE LOCAL begin pch distcc --mrs */
+ int skip_validation;
+
+ /* Skip pch validation if we have just validated it. */
+ skip_validation = CPP_OPTION (r, pch_preprocess)
+ && CPP_OPTION (r, preprocessed);
+ /* APPLE LOCAL end pch distcc --mrs */
+
/* Read in the list of identifiers that must be defined
Check that they are defined in the same way. */
for (;;)
@@ -456,13 +463,18 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
if ((size_t)read (fd, namebuf, m.definition_length)
!= m.definition_length)
goto error;
+
+ /* APPLE LOCAL begin pch distcc --mrs */
+ if (skip_validation)
+ continue;
+ /* APPLE LOCAL end pch distcc --mrs */
h = cpp_lookup (r, namebuf, m.name_length);
if (m.flags & NODE_POISONED
|| h->type != NT_MACRO
|| h->flags & NODE_POISONED)
{
- if (CPP_OPTION (r, warn_invalid_pch))
+ if (CPP_OPTION (r, warn_invalid_pch))
cpp_error (r, CPP_DL_WARNING_SYSHDR,
"%s: not used because `%.*s' not defined",
name, m.name_length, namebuf);
@@ -492,6 +504,14 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
if ((size_t) read (fd, undeftab, m.definition_length) != m.definition_length)
goto error;
+ /* APPLE LOCAL begin pch distcc --mrs */
+ if (skip_validation)
+ {
+ free (undeftab);
+ return 0;
+ }
+ /* APPLE LOCAL end pch distcc --mrs */
+
/* Collect identifiers from the current hash table. */
nl.n_defs = 0;
nl.asize = 10;
@@ -630,6 +650,12 @@ cpp_read_state (cpp_reader *r, const char *name, FILE *f,
struct save_macro_data *data)
{
size_t i;
+ /* APPLE LOCAL begin pch distcc --mrs */
+ void (*saved_line_change) PARAMS ((cpp_reader *, const cpp_token *, int));
+
+ saved_line_change = r->cb.line_change;
+ /* APPLE LOCAL end pch distcc --mrs */
+
struct lexer_state old_state;
/* Restore spec_nodes, which will be full of references to the old
@@ -646,6 +672,8 @@ cpp_read_state (cpp_reader *r, const char *name, FILE *f,
r->state.in_directive = 1;
r->state.prevent_expansion = 1;
r->state.angled_headers = 0;
+ /* APPLE LOCAL pch distcc --mrs */
+ r->cb.line_change = 0;
/* Run through the carefully-saved macros, insert them. */
for (i = 0; i < data->count; i++)
@@ -678,6 +706,8 @@ cpp_read_state (cpp_reader *r, const char *name, FILE *f,
free (data->defns[i]);
}
r->state = old_state;
+ /* APPLE LOCAL pch distcc --mrs */
+ r->cb.line_change = saved_line_change;
_cpp_restore_pragma_names (r, data->saved_pragmas);
diff --git a/libobjc/encoding.c b/libobjc/encoding.c
index 7f71276b556..046b664b8fb 100644
--- a/libobjc/encoding.c
+++ b/libobjc/encoding.c
@@ -780,6 +780,23 @@ objc_layout_structure (const char *type,
layout->record_align = MAX (layout->record_align, STRUCTURE_SIZE_BOUNDARY);
}
+/* APPLE LOCAL begin Macintosh alignment 2002-2-26 --ff */
+#ifdef RS6000_PIC_OFFSET_TABLE_REGNUM
+/* Ick, darwin.h doesn't work anymore... Fix this please. */
+#undef ROUND_TYPE_ALIGN
+#define ROUND_TYPE_ALIGN(STRUCT, COMPUTED, SPECIFIED) \
+ ((TREE_CODE (STRUCT) == RECORD_TYPE \
+ || TREE_CODE (STRUCT) == UNION_TYPE \
+ || TREE_CODE (STRUCT) == QUAL_UNION_TYPE) \
+ && TARGET_ALIGN_NATURAL == 0 \
+ ? rs6000_special_round_type_align (STRUCT, COMPUTED, SPECIFIED) \
+ : (TREE_CODE (STRUCT) == VECTOR_TYPE \
+ && ALTIVEC_VECTOR_MODE (TYPE_MODE (STRUCT))) \
+ ? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
+ : MAX ((COMPUTED), (SPECIFIED)))
+#define TARGET_ALIGN_MAC68K 0
+#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-26 --ff */
BOOL
objc_layout_structure_next_member (struct objc_struct_layout *layout)
@@ -845,9 +862,11 @@ objc_layout_structure_next_member (struct objc_struct_layout *layout)
#ifdef BIGGEST_FIELD_ALIGNMENT
desired_align = MIN (desired_align, BIGGEST_FIELD_ALIGNMENT);
#endif
+/* APPLE LOCAL begin Macintosh alignment 2002-2-26 --ff */
#ifdef ADJUST_FIELD_ALIGN
- desired_align = ADJUST_FIELD_ALIGN (type, desired_align);
+ desired_align = ADJUST_FIELD_ALIGN (type, desired_align, layout->prev_type == 0);
#endif
+/* APPLE LOCAL end Macintosh alignment 2002-2-26 --ff */
/* Record must have at least as much alignment as any field.
Otherwise, the alignment of the field within the record
diff --git a/libstdc++-v3/config/os/bsd/darwin/os_defines.h b/libstdc++-v3/config/os/bsd/darwin/os_defines.h
index 07fb55b6125..bbe2000c8e5 100644
--- a/libstdc++-v3/config/os/bsd/darwin/os_defines.h
+++ b/libstdc++-v3/config/os/bsd/darwin/os_defines.h
@@ -44,4 +44,142 @@
// -flat_namespace to work around the way that it doesn't.
#define _GLIBCXX_WEAK_DEFINITION __attribute__ ((weak))
+/* APPLE LOCAL begin keymgr */
+/* Copyright (C) 1989, 92-97, 1998, Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+
+/*
+ * This file added by Apple Computer Inc. for its OS X
+ * environment.
+ */
+
+#ifndef __KEYMGR_H
+#define __KEYMGR_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+/*
+ * keymgr - Create and maintain process-wide global data known to
+ * all threads across all dynamic libraries.
+ *
+ */
+
+typedef enum node_kinds {
+ NODE_THREAD_SPECIFIC_DATA=1,
+ NODE_PROCESSWIDE_PTR=2,
+ NODE_LAST_KIND
+ } TnodeKind ;
+
+/*
+ * These enum members are bits or combination of bits.
+ */
+
+typedef enum node_mode {
+ NM_ALLOW_RECURSION=1,
+ NM_RECURSION_ILLEGAL=2,
+ NM_ENHANCED_LOCKING=3,
+ NM_LOCKED=4
+ } TnodeMode ;
+
+/* WARNING: the return value of _keymgr_set_per_thread_data is
+ not meaningful on Tiger and above. Use the macro
+ KEYMGR_SET_PER_THREAD_DATA (below) to handle this properly. */
+extern void * _keymgr_get_per_thread_data(unsigned int key) ;
+extern int _keymgr_set_per_thread_data(unsigned int key, void *keydata) ;
+extern void *_keymgr_get_and_lock_processwide_ptr(unsigned int key) ;
+extern void _keymgr_set_and_unlock_processwide_ptr(unsigned int key, void *ptr) ;
+extern void _keymgr_unlock_processwide_ptr(unsigned int key) ;
+extern void _keymgr_set_lockmode_processwide_ptr(unsigned int key, unsigned int mode) ;
+extern unsigned int _keymgr_get_lockmode_processwide_ptr(unsigned int key) ;
+extern int _keymgr_get_lock_count_processwide_ptr(unsigned int key) ;
+
+extern void *__keymgr_global[];
+typedef struct _Sinfo_Node {
+ unsigned int size ; /*size of this node*/
+ unsigned short major_version ; /*API major version.*/
+ unsigned short minor_version ; /*API minor version.*/
+ } _Tinfo_Node ;
+
+#define KEYMGR_VERSION \
+ (__keymgr_global[2] ? ((_Tinfo_Node *)__keymgr_global[2])->major_version : 0)
+
+#define KEYMGR_SET_PER_THREAD_DATA(key, keydata) \
+ (KEYMGR_VERSION >= 4 \
+ ? _keymgr_set_per_thread_data((key), (keydata)) \
+ : (_keymgr_set_per_thread_data((key), (keydata)), 0))
+
+#ifndef NULL
+#ifdef __GNUG__
+#define NULL __null
+#else
+#define NULL 0
+#endif
+#endif
+
+/*
+ * Keys currently in use:
+ */
+
+#define KEYMGR_EH_CONTEXT_KEY 1 /*stores handle for root pointer of exception context node.*/
+
+#define KEYMGR_NEW_HANLDER_KEY 2 /*store handle for new handler pointer.*/
+
+#define KEYMGR_UNEXPECTED_HANDLER_KEY 3 /*store handle for unexpected exception pointer.*/
+
+#define KEYMGR_TERMINATE_HANDLER_KEY 4 /*store handle for terminate handler pointer. */
+
+#define KEYMGR_MODE_BITS 5 /*stores handle for runtime mode bits.*/
+
+#define KEYMGR_IO_LIST 6 /*Root pointer to the list of open streams.*/
+
+#define KEYMGR_IO_STDIN 7 /*GNU stdin.*/
+
+#define KEYMGR_IO_STDOUT 8 /*GNU stdout.*/
+
+#define KEYMGR_IO_STDERR 9 /*GNU stderr.*/
+
+#define KEYMGR_IO_REFCNT 10 /*How many plugins/main program currently using streams.*/
+
+#define KEYMGR_IO_MODE_BITS 11 /*Flags controlling the behavior of C++ I/O.*/
+
+#define KEYMGR_ZOE_IMAGE_LIST 12 /*Head pointer for list of per image dwarf2 unwind sections.*/
+
+#define KEYMGR_EH_GLOBALS_KEY 13 /* Variable used in eh_globals.cc */
+
+/*
+ * Other important data.
+ */
+
+#define KEYMGR_API_REV_MAJOR 2 /*Major revision number of the keymgr API.*/
+#define KEYMGR_API_REV_MINOR 1 /*Minor revision number of the keymgr API.*/
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __KEYMGR_H */
+/* APPLE LOCAL end keymgr */
#endif
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index 2d5016a374a..648514f3727 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -1544,7 +1544,16 @@ if test "$build" != "$host"; then
GLIBCXX_IS_NATIVE=false
else
- GLIBCXX_IS_NATIVE=true
+ # APPLE LOCAL begin 64-bit
+ case "$target" in
+ powerpc-apple-darwin8*)
+ GLIBCXX_IS_NATIVE=false
+ cross_compiling=yes
+ ;;
+ *)
+ GLIBCXX_IS_NATIVE=true ;;
+ esac
+ # APPLE LOCAL end 64-bit
fi
# Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
@@ -4390,7 +4399,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4393 "configure"' > conftest.$ac_ext
+ echo '#line 4402 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -5011,7 +5020,7 @@ fi;
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
-#line 5014 "configure"
+#line 5023 "configure"
struct S { ~S(); };
void bar();
void foo()
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index 5d0a54f9c4c..e0e55ad70b2 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -44,7 +44,16 @@ if test "$build" != "$host"; then
GLIBCXX_IS_NATIVE=false
GCC_NO_EXECUTABLES
else
- GLIBCXX_IS_NATIVE=true
+ # APPLE LOCAL begin 64-bit
+ case "$target" in
+ powerpc-apple-darwin8*)
+ GLIBCXX_IS_NATIVE=false
+ cross_compiling=yes
+ ;;
+ *)
+ GLIBCXX_IS_NATIVE=true ;;
+ esac
+ # APPLE LOCAL end 64-bit
fi
# Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index b3582a41d79..c1c063ee1f9 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -180,12 +180,16 @@ case "${host_os}" in
# treatment of coalesced symbols.
OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module -Wl,-flat_namespace"
os_include_dir="os/bsd/darwin"
+ # APPLE LOCAL darwin native radar 3729768
+ enable_cxx_flags="-DAPPLE_KEYMGR $enable_cxx_flags"
;;
darwin[89] | darwin[89].* | darwin[1-9][0-9]* )
# On Darwin, performance is improved if libstdc++ is single-module,
# and on 8+ compatibility is better if not -flat_namespace.
OPT_LDFLAGS="${OPT_LDFLAGS} -Wl,-single_module"
os_include_dir="os/bsd/darwin"
+ # APPLE LOCAL darwin native radar 3729768
+ enable_cxx_flags="-DAPPLE_KEYMGR $enable_cxx_flags"
;;
*djgpp*) # leading * picks up "msdosdjgpp"
os_include_dir="os/djgpp"
diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h
index ed119d4c8ea..6993042eb60 100644
--- a/libstdc++-v3/include/std/std_fstream.h
+++ b/libstdc++-v3/include/std/std_fstream.h
@@ -414,7 +414,8 @@ namespace std
typedef basic_istream<char_type, traits_type> __istream_type;
private:
- __filebuf_type _M_filebuf;
+ /* APPLE LOCAL work with -malign-natural. */
+ __filebuf_type _M_filebuf __attribute((aligned(8)));
public:
// Constructors/Destructors:
@@ -538,7 +539,8 @@ namespace std
typedef basic_ostream<char_type, traits_type> __ostream_type;
private:
- __filebuf_type _M_filebuf;
+ /* APPLE LOCAL work with -malign-natural. */
+ __filebuf_type _M_filebuf __attribute__((aligned(8)));
public:
// Constructors:
diff --git a/libstdc++-v3/libsupc++/eh_alloc.cc b/libstdc++-v3/libsupc++/eh_alloc.cc
index 4728bcbf380..64a36f9e95a 100644
--- a/libstdc++-v3/libsupc++/eh_alloc.cc
+++ b/libstdc++-v3/libsupc++/eh_alloc.cc
@@ -77,6 +77,14 @@ using namespace __cxxabiv1;
# define EMERGENCY_OBJ_COUNT 4
#endif
+/* APPLE LOCAL begin reduce emergency buffer size */
+/* 256 bytes is more than large enough for an std::bad_alloc object */
+#undef EMERGENCY_OBJ_SIZE
+#undef EMERGENCY_OBJ_COUNT
+#define EMERGENCY_OBJ_SIZE 256
+#define EMERGENCY_OBJ_COUNT 2
+/* APPLE LOCAL end reduce emergency buffer size */
+
#if INT_MAX == 32767 || EMERGENCY_OBJ_COUNT <= 32
typedef unsigned int bitmask_type;
#else
diff --git a/libstdc++-v3/libsupc++/eh_globals.cc b/libstdc++-v3/libsupc++/eh_globals.cc
index 0f0dee58d45..3243e2ae414 100644
--- a/libstdc++-v3/libsupc++/eh_globals.cc
+++ b/libstdc++-v3/libsupc++/eh_globals.cc
@@ -41,41 +41,15 @@ using namespace __cxxabiv1;
static __cxa_eh_globals globals_static;
#if __GTHREADS
-static __gthread_key_t globals_key;
+/* APPLE LOCAL begin radar 3373515 */
static int use_thread_key = -1;
static void
-get_globals_dtor (void *ptr)
-{
- if (ptr)
- {
- __cxa_exception *exn, *next;
- exn = ((__cxa_eh_globals *) ptr)->caughtExceptions;
- while (exn)
- {
- next = exn->nextException;
- _Unwind_DeleteException (&exn->unwindHeader);
- exn = next;
- }
- std::free (ptr);
- }
-}
-
-static void
-get_globals_init ()
-{
- use_thread_key =
- (__gthread_key_create (&globals_key, get_globals_dtor) == 0);
-}
-
-static void
get_globals_init_once ()
{
- static __gthread_once_t once = __GTHREAD_ONCE_INIT;
- if (__gthread_once (&once, get_globals_init) != 0
- || use_thread_key < 0)
- use_thread_key = 0;
+ use_thread_key = 1;
}
+/* APPLE LOCAL end radar 3373515 */
#endif
extern "C" __cxa_eh_globals *
@@ -83,7 +57,9 @@ __cxxabiv1::__cxa_get_globals_fast () throw()
{
#if __GTHREADS
if (use_thread_key)
- return (__cxa_eh_globals *) __gthread_getspecific (globals_key);
+ /* APPLE LOCAL begin radar 3373515 */
+ return (__cxa_eh_globals *) _keymgr_get_per_thread_data (KEYMGR_EH_GLOBALS_KEY);
+ /* APPLE LOCAL end radar 3373515 */
else
return &globals_static;
#else
@@ -109,12 +85,16 @@ __cxxabiv1::__cxa_get_globals () throw()
return &globals_static;
}
- g = (__cxa_eh_globals *) __gthread_getspecific (globals_key);
+ /* APPLE LOCAL begin radar 3373515 */
+ g = (__cxa_eh_globals *) _keymgr_get_per_thread_data (KEYMGR_EH_GLOBALS_KEY);
+ /* APPLE LOCAL end radar 3373515 */
if (! g)
{
if ((g = (__cxa_eh_globals *)
std::malloc (sizeof (__cxa_eh_globals))) == 0
- || __gthread_setspecific (globals_key, (void *) g) != 0)
+ /* APPLE LOCAL begin radar 3373515 */
+ || KEYMGR_SET_PER_THREAD_DATA (KEYMGR_EH_GLOBALS_KEY, (void *) g) != 0)
+ /* APPLE LOCAL end radar 3373515 */
std::terminate ();
g->caughtExceptions = 0;
g->uncaughtExceptions = 0;
diff --git a/libstdc++-v3/libsupc++/eh_terminate.cc b/libstdc++-v3/libsupc++/eh_terminate.cc
index bf9d74db116..14b5c88e013 100644
--- a/libstdc++-v3/libsupc++/eh_terminate.cc
+++ b/libstdc++-v3/libsupc++/eh_terminate.cc
@@ -34,6 +34,12 @@
#include "unwind-cxx.h"
#include "exception_defines.h"
+/* APPLE LOCAL begin keymgr */
+#if defined(APPLE_KEYMGR) && ! defined(APPLE_KERNEL_EXTENSION) && ! defined(LIBCC_KEXT)
+#include "bits/os_defines.h"
+#endif
+/* APPLE LOCAL end keymgr */
+
using namespace __cxxabiv1;
void
@@ -50,6 +56,18 @@ __cxxabiv1::__terminate (std::terminate_handler handler)
void
std::terminate ()
{
+ /* APPLE LOCAL begin keymgr */
+#if defined(APPLE_KEYMGR) && ! defined(APPLE_KERNEL_EXTENSION) && ! defined(LIBCC_KEXT)
+ /*
+ * If the Key Manager has a terminate function assigned to this thread, invoke that fn.
+ * If not (KeyMgr has 0), use whatever is initialized into my local static pointer (above).
+ */
+ std::terminate_handler __keymgr_terminate_func = (std::terminate_handler)
+ _keymgr_get_per_thread_data (KEYMGR_TERMINATE_HANDLER_KEY);
+ if (__keymgr_terminate_func)
+ __terminate_handler = __keymgr_terminate_func;
+#endif /* APPLE_KEYMGR */
+ /* APPLE LOCAL end keymgr */
__terminate (__terminate_handler);
}
@@ -63,13 +81,32 @@ __cxxabiv1::__unexpected (std::unexpected_handler handler)
void
std::unexpected ()
{
+ /* APPLE LOCAL begin keymgr */
+#if defined(APPLE_KEYMGR) && ! defined(APPLE_KERNEL_EXTENSION) && ! defined(LIBCC_KEXT)
+ /* Similar to terminate case above. */
+ std::unexpected_handler __keymgr_unexpected_func = (std::unexpected_handler)
+ _keymgr_get_per_thread_data (KEYMGR_UNEXPECTED_HANDLER_KEY);
+ if (__keymgr_unexpected_func)
+ __unexpected_handler = __keymgr_unexpected_func;
+#endif /* APPLE_KEYMGR */
+ /* APPLE LOCAL end keymgr */
__unexpected (__unexpected_handler);
}
std::terminate_handler
std::set_terminate (std::terminate_handler func) throw()
{
+ /* APPLE LOCAL begin keymgr */
+#if defined(APPLE_KEYMGR) && ! defined(APPLE_KERNEL_EXTENSION) && ! defined(LIBCC_KEXT)
+ std::terminate_handler old =
+ (std::terminate_handler) _keymgr_get_per_thread_data (KEYMGR_TERMINATE_HANDLER_KEY);
+ _keymgr_set_per_thread_data (KEYMGR_TERMINATE_HANDLER_KEY, (void *) func) ;
+ if ( ! old)
+ old = __terminate_handler;
+#else
std::terminate_handler old = __terminate_handler;
+#endif /* APPLE_KEYMGR */
+ /* APPLE LOCAL end keymgr */
__terminate_handler = func;
return old;
}
@@ -77,7 +114,17 @@ std::set_terminate (std::terminate_handler func) throw()
std::unexpected_handler
std::set_unexpected (std::unexpected_handler func) throw()
{
+ /* APPLE LOCAL begin keymgr */
+#if defined(APPLE_KEYMGR) && ! defined(APPLE_KERNEL_EXTENSION) && ! defined(LIBCC_KEXT)
+ std::unexpected_handler old =
+ (std::unexpected_handler) _keymgr_get_per_thread_data (KEYMGR_UNEXPECTED_HANDLER_KEY);
+ _keymgr_set_per_thread_data (KEYMGR_UNEXPECTED_HANDLER_KEY, (void *) func);
+ if ( ! old)
+ old = __unexpected_handler;
+#else
std::unexpected_handler old = __unexpected_handler;
+#endif /* APPLE_KEYMGR */
+ /* APPLE LOCAL end keymgr */
__unexpected_handler = func;
return old;
}
diff --git a/libstdc++-v3/libsupc++/new_handler.cc b/libstdc++-v3/libsupc++/new_handler.cc
index 2f9f6bd3579..42b19e69367 100644
--- a/libstdc++-v3/libsupc++/new_handler.cc
+++ b/libstdc++-v3/libsupc++/new_handler.cc
@@ -31,6 +31,12 @@
#include "new"
+/* APPLE LOCAL begin keymgr */
+#if defined APPLE_KEYMGR && ! defined(LIBCC_KEXT) && ! defined(APPLE_KERNEL_EXTENSION)
+#include "bits/os_defines.h"
+#endif
+/* APPLE LOCAL end keymgr */
+
const std::nothrow_t std::nothrow = { };
using std::new_handler;
@@ -39,9 +45,23 @@ new_handler __new_handler;
new_handler
std::set_new_handler (new_handler handler) throw()
{
+/* APPLE LOCAL begin keymgr */
+#if defined(APPLE_KEYMGR) && ! defined(APPLE_KERNEL_EXTENSION) && ! defined(LIBCC_KEXT)
+ new_handler prev_handler =
+ (new_handler) _keymgr_get_per_thread_data (KEYMGR_NEW_HANLDER_KEY);
+ if ( ! prev_handler)
+ prev_handler = __new_handler;
+ _keymgr_set_per_thread_data (KEYMGR_NEW_HANLDER_KEY, (void *) handler);
+#else /* ! APPLE_KEYMGR */
new_handler prev_handler = __new_handler;
+#endif /* APPLE_KEYMGR */
+/* APPLE LOCAL end keymgr */
__new_handler = handler;
return prev_handler;
}
+/* APPLE LOCAL begin libcc_kext */
+#if !defined(LIBCC_KEXT)
std::bad_alloc::~bad_alloc() throw() { }
+#endif
+/* APPLE LOCAL end libcc_kext */
diff --git a/libstdc++-v3/libsupc++/new_op.cc b/libstdc++-v3/libsupc++/new_op.cc
index 43c22405eb5..124fcdd68f4 100644
--- a/libstdc++-v3/libsupc++/new_op.cc
+++ b/libstdc++-v3/libsupc++/new_op.cc
@@ -30,13 +30,25 @@
// the GNU General Public License.
#include "new"
+/* APPLE LOCAL begin libcc_kext */
+#ifdef LIBCC_KEXT
+extern "C" {
+extern void *malloc (size_t);
+extern int panic ();
+}
+#define ABORT() panic ()
+#else
#include <cstdlib>
+#define ABORT() std::abort ()
+#endif
+/* APPLE LOCAL end libcc_kext */
#include <exception_defines.h>
#include <bits/c++config.h>
using std::new_handler;
using std::bad_alloc;
-#if _GLIBCXX_HOSTED
+/* APPLE LOCAL libcc_kext */
+#if _GLIBCXX_HOSTED && !defined(LIBCC_KEXT)
using std::malloc;
#else
// A freestanding C runtime may not provide "malloc" -- but there is no
@@ -57,12 +69,21 @@ operator new (std::size_t sz) throw (std::bad_alloc)
p = (void *) malloc (sz);
while (p == 0)
{
+ /* APPLE LOCAL begin keymgr */
+#if defined(APPLE_KEYMGR) && ! defined(APPLE_KERNEL_EXTENSION) && ! defined(LIBCC_KEXT)
+ /* Ask Key Manager for new_handler; if provided (!=0), use it, else use local version. */
+ new_handler handler =
+ (new_handler) _keymgr_get_per_thread_data (KEYMGR_NEW_HANLDER_KEY);
+#else /* ! APPLE_KEYMGR */
new_handler handler = __new_handler;
+#endif /* APPLE_KEYMGR */
+ /* APPLE LOCAL end keymgr */
if (! handler)
#ifdef __EXCEPTIONS
throw bad_alloc();
#else
- std::abort();
+ /* APPLE LOCAL libcc_kext */
+ ABORT();
#endif
handler ();
p = (void *) malloc (sz);
diff --git a/libstdc++-v3/libsupc++/new_opnt.cc b/libstdc++-v3/libsupc++/new_opnt.cc
index c25ce5a2d30..8f61ebd79c7 100644
--- a/libstdc++-v3/libsupc++/new_opnt.cc
+++ b/libstdc++-v3/libsupc++/new_opnt.cc
@@ -31,6 +31,12 @@
#include <exception_defines.h>
#include <bits/c++config.h>
+/* APPLE LOCAL begin keymgr */
+#if defined APPLE_KEYMGR && ! defined(LIBCC_KEXT) && ! defined(APPLE_KERNEL_EXTENSION)
+#include "bits/os_defines.h"
+#endif /* APPLE_KEYMGR */
+/* APPLE LOCAL end keymgr */
+
using std::new_handler;
using std::bad_alloc;
@@ -48,7 +54,14 @@ operator new (std::size_t sz, const std::nothrow_t&) throw()
p = (void *) malloc (sz);
while (p == 0)
{
+ /* APPLE LOCAL begin keymgr */
+#if defined(APPLE_KEYMGR) && ! defined(APPLE_KERNEL_EXTENSION) && ! defined(LIBCC_KEXT)
+ new_handler handler =
+ (new_handler) _keymgr_get_per_thread_data (KEYMGR_NEW_HANLDER_KEY);
+#else /* ! APPLE_KEYMGR */
new_handler handler = __new_handler;
+#endif /* APPLE_KEYMGR */
+ /* APPLE LOCAL end keymgr */
if (! handler)
return 0;
try
diff --git a/libstdc++-v3/libsupc++/pure.cc b/libstdc++-v3/libsupc++/pure.cc
index 2e75492e705..82011dbc1e8 100644
--- a/libstdc++-v3/libsupc++/pure.cc
+++ b/libstdc++-v3/libsupc++/pure.cc
@@ -27,9 +27,13 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+/* APPLE LOCAL begin libcc_kext */
+#ifndef LIBCC_KEXT /* Kludge: easier than identifying correct -Ipath, and unnecessary for kext */
#include <bits/c++config.h>
#include <cxxabi.h>
#include "unwind-cxx.h"
+#endif
+/* APPLE LOCAL end libcc_kext */
#if _GLIBCXX_HOSTED
#ifdef _GLIBCXX_HAVE_UNISTD_H
@@ -51,6 +55,14 @@
extern "C" void
__cxxabiv1::__cxa_pure_virtual (void)
{
+
+/* APPLE LOCAL begin libcc_kext */
+#ifndef LIBCC_KEXT
writestr ("pure virtual method called\n");
std::terminate ();
+#else
+ extern void panic (void);
+ panic ();
+#endif
+/* APPLE LOCAL end libcc_kext */
}
diff --git a/ltconfig b/ltconfig
index 01e64be2cff..78c71b71e42 100755
--- a/ltconfig
+++ b/ltconfig
@@ -625,7 +625,8 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts
+ old_postinstall_cmds="\$RANLIB \$oldlib@$old_postinstall_cmds"
fi
# Source the script associated with the $tagname tag configuration.
diff --git a/ltmain.sh b/ltmain.sh
index 90925cb2f6d..5925eebba57 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -495,11 +495,34 @@ if test -z "$show_help"; then
# Only attempt this if the compiler in the base compile
# command doesn't match the default compiler.
if test -n "$available_tags" && test -z "$tagname"; then
+ # APPLE LOCAL begin handle ~ in pathnames 2002-01-14 --sts
+ # Since CC may have args with shell metachars in them, add
+ # doublequotes to args so it looks the same as $base_compile.
+ qCC=
+ for argu in $CC; do
+ case $argu in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ argu="\"$argu\""
+ ;;
+ esac
+ # Add the previous argument to qCC.
+ if test -z "$qCC"; then
+ qCC="$argu"
+ else
+ qCC="$qCC $argu"
+ fi
+ done
+ # APPLE LOCAL end handle ~ in pathnames 2002-01-14 --sts
case $base_compile in
- "$CC "*) ;;
+ # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts
+ "$qCC "*) ;;
# Blanks in the command may have been stripped by the calling shell,
# but not from the CC environment variable when ltconfig was run.
- "`$echo $CC` "*) ;;
+ # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts
+ "`$echo $qCC` "*) ;;
*)
for z in $available_tags; do
if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
@@ -4923,7 +4946,8 @@ relink_command=\"$relink_command\""
# Do each command in the postinstall commands.
eval cmds=\"$old_postinstall_cmds\"
- IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
+ # APPLE LOCAL handle ~ in pathnames 2002-01-14 --sts
+ IFS="${IFS= }"; save_ifs="$IFS"; IFS='@'
for cmd in $cmds; do
IFS="$save_ifs"
$show "$cmd"
diff --git a/more-hdrs/assert.h b/more-hdrs/assert.h
new file mode 100644
index 00000000000..0bd55b020c8
--- /dev/null
+++ b/more-hdrs/assert.h
@@ -0,0 +1,71 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "/usr/include/assert.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+#ifndef FIXINC_BROKEN_ASSERT_STDLIB_CHECK
+#define FIXINC_BROKEN_ASSERT_STDLIB_CHECK 1
+
+#ifdef __cplusplus
+#include <stdlib.h>
+#endif
+/* Allow this file to be included multiple times
+ with different settings of NDEBUG. */
+#undef assert
+#undef __assert
+
+#ifdef NDEBUG
+#define assert(ignore) ((void) 0)
+#else
+
+#ifndef __GNUC__
+
+#define assert(expression) \
+ ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
+
+#define __assert(expression, file, lineno) \
+ (printf ("%s:%u: failed assertion\n", file, lineno), \
+ abort (), 0)
+
+#else
+
+#if defined(__STDC__) || defined (__cplusplus)
+
+/* Defined in libgcc.a */
+#ifdef __cplusplus
+extern "C" {
+extern void __eprintf (const char *, const char *, unsigned, const char *)
+ __attribute__ ((noreturn));
+}
+#else
+extern void __eprintf (const char *, const char *, unsigned, const char *)
+ __attribute__ ((noreturn));
+#endif
+
+#define assert(expression) \
+ ((void) ((expression) ? 0 : __assert (#expression, __FILE__, __LINE__)))
+
+#define __assert(expression, file, line) \
+ (__eprintf ("%s:%u: failed assertion `%s'\n", \
+ file, line, expression), 0)
+
+#else /* no __STDC__ and not C++; i.e. -traditional. */
+
+extern void __eprintf () __attribute__ ((noreturn)); /* Defined in libgcc.a */
+
+#define assert(expression) \
+ ((void) ((expression) ? 0 : __assert (expression, __FILE__, __LINE__)))
+
+#define __assert(expression, file, lineno) \
+ (__eprintf ("%s:%u: failed assertion `%s'\n", \
+ file, lineno, "expression"), 0)
+
+#endif /* no __STDC__ and not C++; i.e. -traditional. */
+#endif /* no __GNU__; i.e., /bin/cc. */
+#endif
+
+#endif /* FIXINC_BROKEN_ASSERT_STDLIB_CHECK */
diff --git a/more-hdrs/float.h b/more-hdrs/float.h
new file mode 100644
index 00000000000..048737fd83a
--- /dev/null
+++ b/more-hdrs/float.h
@@ -0,0 +1,9 @@
+/* This file is public domain. */
+/* This file exists soley to keep Metrowerks' compilers happy. The version
+ used by GCC 3.4 and later can be found in /usr/lib/gcc, although it's
+ not very informative. */
+#ifdef __MWERKS__
+#include "mw_float.h"
+#else
+#error "This header only supports __MWERKS__."
+#endif
diff --git a/more-hdrs/inttypes.h b/more-hdrs/inttypes.h
new file mode 100644
index 00000000000..697fb7b48ac
--- /dev/null
+++ b/more-hdrs/inttypes.h
@@ -0,0 +1,299 @@
+/*
+ * Copyright (c) 2000, 2001, 2002, 2003, 2004 Apple Computer, Inc.
+ * All rights reserved.
+ *
+ * @APPLE_LICENSE_HEADER_START@
+ *
+ * The contents of this file constitute Original Code as defined in and
+ * are subject to the Apple Public Source License Version 1.1 (the
+ * "License"). You may not use this file except in compliance with the
+ * License. Please obtain a copy of the License at
+ * http://www.apple.com/publicsource and read it before using this file.
+ *
+ * This Original Code and all software distributed under the License are
+ * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ *
+ * @APPLE_LICENSE_HEADER_END@
+ */
+
+/*
+ * <inttypes.h> -- Standard C header, defined in ISO/IEC 9899:1999
+ * (aka "C99"), section 7.8. This defines format string conversion
+ * specifiers suitable for use within arguments to fprintf and fscanf
+ * and their ilk.
+ */
+
+#if !defined(_INTTYPES_H_)
+#define _INTTYPES_H_
+
+#include <sys/cdefs.h> /* For __BEGIN_DECLS and __END_DECLS */
+#include <machine/ansi.h> /* For _BSD_WCHAR_T_ */
+#include <stdint.h>
+
+#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
+ /* Translator is not ISO/IEC 9899:1999-compliant. */
+# if !defined(restrict)
+# define restrict
+# define __RESTRICT_KEYWORD_DEFINED__
+# endif
+#endif
+
+/* "C++ implementations should define these macros only when
+ * __STDC_FORMAT_MACROS is defined before <inttypes.h> is included."
+ */
+#if (! defined(__cplusplus)) || defined(__STDC_FORMAT_MACROS)
+
+# undef __PRI_8_LENGTH_MODIFIER__
+# undef __PRI_64_LENGTH_MODIFIER__
+# undef __SCN_64_LENGTH_MODIFIER__
+
+/* These could be "hh", "ll", and "ll" respectively, but that doesn't work on
+ 10.2, and these do. Note that there's no way to use scanf to scan a
+ decimal into a 'char' argument on 10.2, so "hh" is used unconditionally
+ and programs that use it won't work on Jaguar. */
+# define __PRI_8_LENGTH_MODIFIER__ "" /* none */
+# define __PRI_64_LENGTH_MODIFIER__ "q"
+# define __SCN_64_LENGTH_MODIFIER__ "q"
+
+# define PRId8 __PRI_8_LENGTH_MODIFIER__ "d"
+# define PRIi8 __PRI_8_LENGTH_MODIFIER__ "i"
+# define PRIo8 __PRI_8_LENGTH_MODIFIER__ "o"
+# define PRIu8 __PRI_8_LENGTH_MODIFIER__ "u"
+# define PRIx8 __PRI_8_LENGTH_MODIFIER__ "x"
+# define PRIX8 __PRI_8_LENGTH_MODIFIER__ "X"
+
+# define PRId16 "hd"
+# define PRIi16 "hi"
+# define PRIo16 "ho"
+# define PRIu16 "hu"
+# define PRIx16 "hx"
+# define PRIX16 "hX"
+
+# define PRId32 "d"
+# define PRIi32 "i"
+# define PRIo32 "o"
+# define PRIu32 "u"
+# define PRIx32 "x"
+# define PRIX32 "X"
+
+# define PRId64 __PRI_64_LENGTH_MODIFIER__ "d"
+# define PRIi64 __PRI_64_LENGTH_MODIFIER__ "i"
+# define PRIo64 __PRI_64_LENGTH_MODIFIER__ "o"
+# define PRIu64 __PRI_64_LENGTH_MODIFIER__ "u"
+# define PRIx64 __PRI_64_LENGTH_MODIFIER__ "x"
+# define PRIX64 __PRI_64_LENGTH_MODIFIER__ "X"
+
+# define PRIdLEAST8 PRId8
+# define PRIiLEAST8 PRIi8
+# define PRIoLEAST8 PRIo8
+# define PRIuLEAST8 PRIu8
+# define PRIxLEAST8 PRIx8
+# define PRIXLEAST8 PRIX8
+
+# define PRIdLEAST16 PRId16
+# define PRIiLEAST16 PRIi16
+# define PRIoLEAST16 PRIo16
+# define PRIuLEAST16 PRIu16
+# define PRIxLEAST16 PRIx16
+# define PRIXLEAST16 PRIX16
+
+# define PRIdLEAST32 PRId32
+# define PRIiLEAST32 PRIi32
+# define PRIoLEAST32 PRIo32
+# define PRIuLEAST32 PRIu32
+# define PRIxLEAST32 PRIx32
+# define PRIXLEAST32 PRIX32
+
+# define PRIdLEAST64 PRId64
+# define PRIiLEAST64 PRIi64
+# define PRIoLEAST64 PRIo64
+# define PRIuLEAST64 PRIu64
+# define PRIxLEAST64 PRIx64
+# define PRIXLEAST64 PRIX64
+
+# define PRIdFAST8 PRId8
+# define PRIiFAST8 PRIi8
+# define PRIoFAST8 PRIo8
+# define PRIuFAST8 PRIu8
+# define PRIxFAST8 PRIx8
+# define PRIXFAST8 PRIX8
+
+# define PRIdFAST16 PRId16
+# define PRIiFAST16 PRIi16
+# define PRIoFAST16 PRIo16
+# define PRIuFAST16 PRIu16
+# define PRIxFAST16 PRIx16
+# define PRIXFAST16 PRIX16
+
+# define PRIdFAST32 PRId32
+# define PRIiFAST32 PRIi32
+# define PRIoFAST32 PRIo32
+# define PRIuFAST32 PRIu32
+# define PRIxFAST32 PRIx32
+# define PRIXFAST32 PRIX32
+
+# define PRIdFAST64 PRId64
+# define PRIiFAST64 PRIi64
+# define PRIoFAST64 PRIo64
+# define PRIuFAST64 PRIu64
+# define PRIxFAST64 PRIx64
+# define PRIXFAST64 PRIX64
+
+/* int32_t is 'int', but intptr_t is 'long'. */
+# define PRIdPTR "ld"
+# define PRIiPTR "li"
+# define PRIoPTR "lo"
+# define PRIuPTR "lu"
+# define PRIxPTR "lx"
+# define PRIXPTR "lX"
+
+# define PRIdMAX PRId64
+# define PRIiMAX PRIi64
+# define PRIoMAX PRIo64
+# define PRIuMAX PRIu64
+# define PRIxMAX PRIx64
+# define PRIXMAX PRIX64
+
+# define SCNd8 "hhd"
+# define SCNi8 "hhi"
+# define SCNo8 "hho"
+# define SCNu8 "hhu"
+# define SCNx8 "hhx"
+
+# define SCNd16 "hd"
+# define SCNi16 "hi"
+# define SCNo16 "ho"
+# define SCNu16 "hu"
+# define SCNx16 "hx"
+
+# define SCNd32 "d"
+# define SCNi32 "i"
+# define SCNo32 "o"
+# define SCNu32 "u"
+# define SCNx32 "x"
+
+# define SCNd64 __SCN_64_LENGTH_MODIFIER__ "d"
+# define SCNi64 __SCN_64_LENGTH_MODIFIER__ "i"
+# define SCNo64 __SCN_64_LENGTH_MODIFIER__ "o"
+# define SCNu64 __SCN_64_LENGTH_MODIFIER__ "u"
+# define SCNx64 __SCN_64_LENGTH_MODIFIER__ "x"
+
+# define SCNdLEAST8 SCNd8
+# define SCNiLEAST8 SCNi8
+# define SCNoLEAST8 SCNo8
+# define SCNuLEAST8 SCNu8
+# define SCNxLEAST8 SCNx8
+
+# define SCNdLEAST16 SCNd16
+# define SCNiLEAST16 SCNi16
+# define SCNoLEAST16 SCNo16
+# define SCNuLEAST16 SCNu16
+# define SCNxLEAST16 SCNx16
+
+# define SCNdLEAST32 SCNd32
+# define SCNiLEAST32 SCNi32
+# define SCNoLEAST32 SCNo32
+# define SCNuLEAST32 SCNu32
+# define SCNxLEAST32 SCNx32
+
+# define SCNdLEAST64 SCNd64
+# define SCNiLEAST64 SCNi64
+# define SCNoLEAST64 SCNo64
+# define SCNuLEAST64 SCNu64
+# define SCNxLEAST64 SCNx64
+
+# define SCNdFAST8 SCNd8
+# define SCNiFAST8 SCNi8
+# define SCNoFAST8 SCNo8
+# define SCNuFAST8 SCNu8
+# define SCNxFAST8 SCNx8
+
+# define SCNdFAST16 SCNd16
+# define SCNiFAST16 SCNi16
+# define SCNoFAST16 SCNo16
+# define SCNuFAST16 SCNu16
+# define SCNxFAST16 SCNx16
+
+# define SCNdFAST32 SCNd32
+# define SCNiFAST32 SCNi32
+# define SCNoFAST32 SCNo32
+# define SCNuFAST32 SCNu32
+# define SCNxFAST32 SCNx32
+
+# define SCNdFAST64 SCNd64
+# define SCNiFAST64 SCNi64
+# define SCNoFAST64 SCNo64
+# define SCNuFAST64 SCNu64
+# define SCNxFAST64 SCNx64
+
+# define SCNdPTR "ld"
+# define SCNiPTR "li"
+# define SCNoPTR "lo"
+# define SCNuPTR "lu"
+# define SCNxPTR "lx"
+
+# define SCNdMAX SCNd64
+# define SCNiMAX SCNi64
+# define SCNoMAX SCNo64
+# define SCNuMAX SCNu64
+# define SCNxMAX SCNx64
+
+#endif /* if C++, then __STDC_FORMAT_MACROS enables the above macros */
+
+__BEGIN_DECLS
+
+ /* 7.8.2.1 */
+ extern intmax_t imaxabs(intmax_t j);
+
+ /* 7.8.2.2 */
+ typedef struct {
+ intmax_t quot;
+ intmax_t rem;
+ } imaxdiv_t;
+
+ extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
+
+ /* 7.8.2.3 */
+ extern intmax_t strtoimax(const char * restrict nptr, char ** restrict endptr, int base);
+ extern uintmax_t strtoumax(const char * restrict nptr, char ** restrict endptr, int base);
+
+#ifndef __cplusplus /* wchar_t is a built-in type in C++ */
+# ifndef _BSD_WCHAR_T_DEFINED_
+# define _BSD_WCHAR_T_DEFINED_
+# ifdef __WCHAR_TYPE__
+ typedef __WCHAR_TYPE__ wchar_t;
+# else /* __WCHAR_TYPE__ */
+ typedef _BSD_WCHAR_T_ wchar_t;
+# endif /* __WCHAR_TYPE__ */
+# endif /* _BSD_WCHAR_T_DEFINED_ */
+#endif /* __cplusplus */
+
+ /* 7.8.2.4 */
+ extern intmax_t wcstoimax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base);
+ extern uintmax_t wcstoumax(const wchar_t * restrict nptr, wchar_t ** restrict endptr, int base);
+
+__END_DECLS
+
+/*
+ No need to #undef the __*_{8,64}_LENGTH_MODIFIER__ macros;
+ in fact, you can't #undef them, because later uses of any of
+ their dependents will *not* then do the intended substitution.
+ Expansion of a #define like this one:
+
+ #define x IDENT y
+
+ uses the cpp value of IDENT at the location where x is *expanded*,
+ not where it is #defined.
+*/
+
+#if defined(__RESTRICT_KEYWORD_DEFINED__)
+# undef restrict
+# undef __RESTRICT_KEYWORD_DEFINED__
+#endif
+
+#endif /* !_INTTYPES_H_ */
diff --git a/more-hdrs/machine/limits.h b/more-hdrs/machine/limits.h
new file mode 100644
index 00000000000..a669a7465f5
--- /dev/null
+++ b/more-hdrs/machine/limits.h
@@ -0,0 +1,11 @@
+/* This is the `system' limits.h, independent of any particular
+ compiler. GCC provides its own limits.h which can be found in
+ /usr/lib/gcc, although it is not very informative.
+ This file is public domain. */
+#if defined (__ppc__) || defined (__ppc64__)
+#include <ppc/limits.h>
+#elif defined (__i386__)
+#include <i386/limits.h>
+#else
+#error architecture not supported
+#endif
diff --git a/more-hdrs/ppc_intrinsics.h b/more-hdrs/ppc_intrinsics.h
new file mode 100644
index 00000000000..f13a9718572
--- /dev/null
+++ b/more-hdrs/ppc_intrinsics.h
@@ -0,0 +1,1026 @@
+/* APPLE LOCAL file PPC_INTRINSICS */
+
+/* Definitions for PowerPC intrinsic instructions
+ Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+
+This file is part of GCC.
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING. If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA. */
+
+/* As a special exception, if you include this header file into source
+ files compiled by GCC, this header file does not by itself cause
+ the resulting executable to be covered by the GNU General Public
+ License. This exception does not however invalidate any other
+ reasons why the executable file might be covered by the GNU General
+ Public License. */
+
+/*
+ * The following PowerPC intrinsics are provided by this header:
+ *
+ * Low-Level Processor Synchronization
+ * __eieio - Enforce In-Order Execution of I/O
+ * __isync - Instruction Synchronize
+ * __sync - Synchronize
+ * __lwsync - Lightweight Synchronize
+ *
+ * Manipulating the Contents of a Variable or Register
+ * __cntlzw - Count Leading Zeros Word
+ * __cntlzd - Count Leading Zeros Double Word
+ * __rlwimi - Rotate Left Word Immediate then Mask Insert
+ * __rlwinm - Rotate Left Word Immediate then AND with Mask
+ * __rlwnm - Rotate Left Word then AND with Mask
+ *
+ * Byte-Reversing Functions
+ * __lhbrx - Load Half Word Byte-Reverse Indexed
+ * __lwbrx - Load Word Byte-Reverse Indexed
+ * __sthbrx - Store Half Word Byte-Reverse Indexed
+ * __stwbrx - Store Word Byte-Reverse Indexed
+ *
+ * Data Cache Manipulation
+ * __dcba - Data Cache Block Allocate
+ * __dcbf - Data Cache Block Flush
+ * __dcbst - Data Cache Block Store
+ * __dcbt - Data Cache Block Touch
+ * __dcbtst - Data Cache Block Touch for Store
+ * __dcbzl - Data Cache Block Set to Zero
+ * __dcbz - Data Cache Block Set to Zero (32-bytes only)
+ *
+ * Setting the Floating-Point Environment
+ * __setflm - Set Floating-point Mode
+ *
+ * Math Functions
+ * __fabs - Floating-Point Absolute Value
+ * __fnabs - Floating Negative Absolute Value
+ * __fctiw - Floating Convert to Integer Word
+ * __fctiwz - Floating Convert to Integer Word with Round toward Zero
+ * __fctidz - Floating Convert to Integer Doubleword with Round toward Zero
+ * __fctid - Floating Convert to Integer Doubleword
+ * __fcfid - Floating Convert From Integer Doubleword
+ * __fmadd - Floating Multiply-Add (Double-Precision)
+ * __fmadds - Floating Multiply-Add Single
+ * __fmsub - Floating Multiply-Subract (Double-Precision)
+ * __fmsubs - Floating Multiply-Subract Single
+ * __fmul - Floating Multiply (Double-Precision)
+ * __fmuls - Floating Multiply Single
+ * __fnmadd - Floating Negative Multiply-Add (Double-Precision)
+ * __fnmadds - Floating Negative Multiply-Add Single
+ * __fnmsub - Floating Negative Multiply-Subtract (Double-Precision)
+ * __fnmsubs - Floating Negative Multiply-Subtract Single
+ * __fres - Floating Reciprocal Estimate
+ * __frsp - Floating Round to Single-Precision
+ * __frsqrte - Floating Reciprocal Square Root Estimate
+ * __frsqrtes - Floating Reciprocal Square Root Estimate Single
+ * __fsel - Floating Select
+ * __fsels - Floating Select (Single-Precision variant)
+ * __fsqrt - Floating-Point Square Root (Double-Precision)
+ * __fsqrts - Floating-Point Square Root Single-Precision
+ * __mulhw - Multiply High Word
+ * __mulhwu - Multiply High Word Unsigned
+ * __stfiwx - Store Floating-Point as Integer Word Indexed
+ *
+ * Miscellaneous Functions
+ * __nop - PPC preferred form of no operation
+ * __astrcmp - assembly strcmp
+ * __icbi - Instruction Cache Block Invalidate
+ * __mffs - Move from FPSCR
+ * __mfspr - Move from Special Purpose Register
+ * __mtfsf - Move to SPSCR Fields
+ * __mtspr - Move to Special Purpose Register
+ * __OSReadSwapSInt16 - lhbrx for signed shorts
+ * __OSReadSwapUInt16 - lhbrx for unsigned shorts
+ *
+ * TO DO:
+ * - Desired:
+ * mullw
+ * - Available in CodeWarrior, not yet implemented here:
+ * abs, labs, fabsf, fnabsf
+ *
+ * NOTES:
+ * - Some of the intrinsics need to be macros because certain
+ * parameters MUST be integer constants and not values in registers.
+ * - The declarations use __asm__ instead of asm and __inline__ instead
+ * of inline to prevent errors when -ansi is specified.
+ * - Some of the intrinsic definitions use the "volatile" specifier on
+ * the "asm" statements in order to work around what appears to be
+ * a bug in the compiler/optimizer. In general we have avoided the
+ * use of "volatile" because it suppresses optimization on the
+ * generated instructions. The instructions to which "volatile"
+ * has been added where it appears that it should not be needed are
+ * lhbrx and lwbrx.
+ *
+ * Contributors: Fred Forsman (editor), Turly O'Connor, Ian Ollmann, Sanjay Patel
+ * Last modified: October 6, 2004
+ */
+
+#ifndef _PPC_INTRINSICS_H_
+#define _PPC_INTRINSICS_H_
+
+#if (defined(__ppc__) || defined(__ppc64__)) && ! defined(__MWERKS__)
+
+/*******************************************************************
+ * Special Purpose Registers (SPRs) *
+ *******************************************************************/
+
+#define __SPR_MQR 0 /* PPC 601 only */
+#define __SPR_XER 1
+#define __SPR_RTCU 4 /* Real time clock upper. PPC 601 only.*/
+#define __SPR_RTCL 5 /* Real time clock lower. PPC 601 only.*/
+#define __SPR_LR 8
+#define __SPR_CTR 9
+#define __SPR_VRSAVE 256 /* AltiVec */
+#define __SPR_TBL 268 /* Time-base Lower. Not on PPC 601 */
+#define __SPR_TBU 269 /* Time-base Upper. Not on PPC 601 */
+#define __SPR_UMMCR2 928 /* PPC 74xx */
+#define __SPR_UPMC5 929 /* PPC 745x */
+#define __SPR_UPMC6 930 /* PPC 745x */
+#define __SPR_UBAMR 935 /* PPC 7400 and 7410 */
+#define __SPR_UMMCR0 936 /* PPC 74xx and 750 */
+#define __SPR_UPMC1 937 /* PPC 74xx and 750 */
+#define __SPR_UPMC2 938 /* PPC 74xx and 750 */
+#define __SPR_USIAR 939 /* PPC 74xx and 750 */
+#define __SPR_UMMCR1 940 /* PPC 74xx and 750 */
+#define __SPR_UPMC3 941 /* PPC 74xx and 750 */
+#define __SPR_UPMC4 942 /* PPC 74xx and 750 */
+#define __SPR_PIR 1023 /* supervisor level only! */
+
+/*
+ * Shorthand macros for some commonly used SPR's.
+ */
+#define __mfxer() __mfspr(__SPR_XER)
+#define __mflr() __mfspr(__SPR_LR)
+#define __mfctr() __mfspr(__SPR_CTR)
+#define __mfvrsave() __mfspr(__SPR_VRSAVE)
+#define __mftb() __mfspr(__SPR_TBL)
+#define __mftbu() __mfspr(__SPR_TBU)
+
+#define __mtlr(value) __mtspr(__SPR_LR, value)
+#define __mtxer(value) __mtspr(__SPR_XER, value)
+#define __mtctr(value) __mtspr(__SPR_CTR, value)
+#define __mtvrsave(value) __mtspr(__SPR_VRSAVE, value)
+
+
+/*******************************************************************
+ * Low-Level Processor Synchronization *
+ *******************************************************************/
+
+/*
+ * __eieio - Enforce In-Order Execution of I/O
+ *
+ * void __eieio (void);
+ */
+#define __eieio() __asm__ ("eieio" : : : "memory")
+
+/*
+ * __isync - Instruction Synchronize
+ *
+ * void __isync (void);
+ */
+#define __isync() \
+ __asm__ volatile ("isync")
+
+/*
+ * __sync - Synchronize
+ *
+ * void __sync (void);
+ */
+#define __sync() __asm__ volatile ("sync")
+
+/*
+ * __lwsync - Lightweight Synchronize, see PPC2.01, Book 2
+ *
+ * void __lwsync (void);
+ */
+#define __lwsync() __asm__ volatile ("sync 1")
+
+
+/*******************************************************************
+ * Byte-Reversing Functions *
+ *******************************************************************/
+
+/*
+ * __lhbrx - Load Half Word Byte-Reverse Indexed
+ *
+ * int __lhbrx(void *, int);
+ */
+#define __lhbrx(base, index) \
+ ({ unsigned short lhbrxResult; \
+ __asm__ volatile ("lhbrx %0, %1, %2" : "=r" (lhbrxResult) : "b%" (index), "r" (base) : "memory"); \
+ /*return*/ lhbrxResult; })
+
+/*
+ * __lwbrx - Load Word Byte-Reverse Indexed
+ *
+ * int __lwbrx(void *, int);
+ */
+#define __lwbrx(base, index) \
+ ({ unsigned int lwbrxResult; \
+ __asm__ volatile ("lwbrx %0, %1, %2" : "=r" (lwbrxResult) : "b%" (index), "r" (base) : "memory"); \
+ /*return*/ lwbrxResult; })
+
+/*
+ * __sthbrx - Store Half Word Byte-Reverse Indexed
+ *
+ * int __sthbrx(unsigned short, void *, int);
+ */
+#define __sthbrx(value, base, index) \
+ __asm__ ("sthbrx %0, %1, %2" : : "r" (value), "b%" (index), "r" (base) : "memory")
+
+/*
+ * __stwbrx - Store Word Byte-Reverse Indexed
+ *
+ * int __sthbrx(unsigned int, void *, int);
+ */
+#define __stwbrx(value, base, index) \
+ __asm__ ("stwbrx %0, %1, %2" : : "r" (value), "b%" (index), "r" (base) : "memory")
+
+
+/*******************************************************************
+ * Manipulating the Contents of a Variable or Register *
+ *******************************************************************/
+
+/*
+ * __cntlzw - Count Leading Zeros Word
+ * __cntlzd - Count Leading Zeros Double Word
+ */
+
+#define __cntlzw(a) __builtin_clz(a)
+#define __cntlzd(a) __builtin_clzll(a)
+
+/*
+ * __rlwimi - Rotate Left Word Immediate then Mask Insert
+ *
+ * int __rlwimi(int, long, int, int, int);
+ *
+ * We don't mention "%1" below: operand[1] needs to be skipped as
+ * it's just a placeholder to let the compiler know that rA is read
+ * from as well as written to.
+ */
+#define __rlwimi(rA, rS, cnt, mb, me) \
+ ({ __asm__ ("rlwimi %0,%2,%3,%4,%5" : "=r" (rA) \
+ : "0" (rA), "r" (rS), "n" (cnt), "n" (mb), "n" (me)); \
+ /*return*/ rA;})
+
+/*
+ * __rlwinm - Rotate Left Word Immediate then AND with Mask
+ *
+ * int __rlwinm(long, int, int, int);
+ */
+#define __rlwinm(rS, cnt, mb, me) \
+ ({ unsigned int val; \
+ __asm__ ("rlwinm %0,%1,%2,%3,%4" : "=r" (val) \
+ : "r" (rS), "n" (cnt), "n" (mb), "n" (me)); \
+ /*return*/ val;})
+
+/*
+ * __rlwnm - Rotate Left Word then AND with Mask
+ *
+ * int __rlwnm(long, int, int, int);
+ */
+#define __rlwnm(value, leftRotateBits, maskStart, maskEnd) \
+ ({ unsigned int result; \
+ __asm__ ("rlwnm %0, %1, %2, %3, %4" : "=r" (result) : \
+ "r" (value), "r" (leftRotateBits), "n" (maskStart), "n" (maskEnd)); \
+ /*return */ result; })
+
+
+/*******************************************************************
+ * Data Cache Manipulation *
+ *******************************************************************/
+
+/*
+ * --- Data Cache Block instructions ---
+ *
+ * Please see Motorola's "The Programming Environments for 32-Bit
+ * Microprocessors" for a description of what these do.
+ *
+ * Parameter descriptions:
+ *
+ * base starting address for figuring out where the
+ * cacheline is
+ *
+ * index byte count to be added to the base address for
+ * purposes of calculating the effective address
+ * of the cacheline to be operated on.
+ *
+ * Effective Address of cacheline to be manipulated =
+ * (char*) base + index
+ *
+ * WARNING: The size and alignment of cachelines are subject to
+ * change on future processors! Cachelines are 32 bytes in
+ * size and are aligned to 32 bytes on PowerPC 601, 603, 604,
+ * 750, 7400, 7410, 7450, and 7455.
+ *
+ */
+
+/*
+ * __dcba - Data Cache Block Allocate
+ *
+ * void __dcba(void *, int)
+ *
+ * WARNING: dcba is a valid instruction only on PowerPC 7400, 7410,
+ * 7450 and 7455.
+ */
+#define __dcba(base, index) \
+ __asm__ ("dcba %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+
+/*
+ * __dcbf - Data Cache Block Flush
+ *
+ * void __dcbf(void *, int);
+ */
+#define __dcbf(base, index) \
+ __asm__ ("dcbf %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+
+/*
+ * __dcbst - Data Cache Block Store
+ *
+ * void __dcbst(void *, int);
+ */
+#define __dcbst(base, index) \
+ __asm__ ("dcbst %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+
+/*
+ * __dcbt - Data Cache Block Touch
+ *
+ * void __dcbt(void *, int);
+ */
+#define __dcbt(base, index) \
+ __asm__ ("dcbt %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+
+/*
+ * __dcbtst - Data Cache Block Touch for Store
+ *
+ * void __dcbtst(void *, int);
+ */
+#define __dcbtst(base, index) \
+ __asm__ ("dcbtst %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+
+/*
+ * __dcbzl - Data Cache Block Set to Zero
+ *
+ * void __dcbzl(void *, int);
+ */
+#define __dcbzl(base, index) \
+ __asm__ ("dcbzl %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+
+/*
+ * __dcbz - Data Cache Block Set to Zero (32-bytes only)
+ *
+ * WARNING: this is for legacy purposes only
+ *
+ * void __dcbz(void *, int);
+ */
+#define __dcbz(base, index) \
+ __asm__ ("dcbz %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+
+
+/*******************************************************************
+ * Setting the Floating-Point Environment *
+ *******************************************************************/
+
+/*
+ * __setflm - Set Floating-point Mode
+ *
+ * Sets the FPSCR (floating-point status and control register),
+ * returning the original value.
+ *
+ * ??? CW: float __setflm(float);
+ */
+static inline double __setflm (double newflm) __attribute__((always_inline));
+static inline double
+__setflm(double newflm)
+{
+ double original;
+
+ __asm__ ("mffs %0"
+ /* outputs: */ : "=f" (original));
+ __asm__ ("mtfsf 255,%0"
+ /* outputs: */ : /* none */
+ /* inputs: */ : "f" (newflm));
+ return original;
+}
+
+
+/*******************************************************************
+ * Math Functions *
+ *******************************************************************/
+
+/*
+ * __fabs - Floating-Point Absolute Value
+ */
+static inline double __fabs (double value) __attribute__((always_inline));
+static inline double
+__fabs (double value)
+{
+ double result;
+ __asm__ ("fabs %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (value));
+ return result;
+}
+
+/*
+ * __fnabs - Floating Negative Absolute Value
+ */
+static inline double __fnabs (double b) __attribute__((always_inline));
+static inline double
+__fnabs (double b)
+{
+ double result;
+ __asm__ ("fnabs %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (b));
+ return result;
+}
+
+/*
+ * fctiw - Floating Convert to Integer Word
+ *
+ * Convert the input value to a signed long and place in the low 32
+ * bits of the FP register. Clip to LONG_MIN or LONG_MAX if the FP
+ * value exceeds the range representable by a long. Use the rounding
+ * mode indicated in the FPSCR.
+ */
+static inline double __fctiw (double b) __attribute__((always_inline));
+static inline double
+__fctiw (double b)
+{
+ double result;
+ __asm__ ("fctiw %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (b));
+ return result;
+}
+
+/*
+ * fctiwz - Floating Convert to Integer Word with Round toward Zero
+ *
+ * Convert the input value to a signed long and place in the low 32
+ * bits of the FP register. Clip to LONG_MIN or LONG_MAX if the FP
+ * value exceeds the range representable by a long.
+ */
+static inline double __fctiwz (double b) __attribute__((always_inline));
+static inline double
+__fctiwz (double b)
+{
+ double result;
+ __asm__ ("fctiwz %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (b));
+ return result;
+}
+
+/*
+ * fctidz - Floating Convert to Integer Double Word with Round toward Zero
+ *
+ * Convert the input value to a signed 64-bit int and place in the FP
+ * destination register. Clip to LLONG_MIN (-2**63) or LLONG_MAX (2**63-1)
+ * if the FP value exceeds the range representable by a int64_t.
+ *
+ * WARNING: fctidz is a valid instruction only on 64-bit PowerPC
+ */
+static inline double __fctidz (double b) __attribute__((always_inline));
+static inline double
+__fctidz (double b)
+{
+ double result;
+ __asm__ ("fctidz %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (b));
+ return result;
+}
+
+/*
+ * fctid - Floating Convert to Integer Double Word
+ *
+ * Convert the input value to a signed 64-bit int and place in the FP
+ * destination register. Clip to LLONG_MIN (-2**63) or LLONG_MAX (2**63-1)
+ * if the FP value exceeds the range representable by a int64_t. Use the
+ * rounding mode indicated in the FPSCR.
+ *
+ * WARNING: fctid is a valid instruction only on 64-bit PowerPC
+ */
+static inline double __fctid (double b) __attribute__((always_inline));
+static inline double
+__fctid (double b)
+{
+ double result;
+ __asm__ ("fctid %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (b));
+ return result;
+}
+
+/*
+ * fcfid - Floating Convert From Integer Double Word
+ *
+ * Convert the 64-bit signed integer input value to a 64-bit FP value.
+ * Use the rounding mode indicated in the FPSCR if the integer is out of
+ * double precision range.
+ *
+ * WARNING: fcfid is a valid instruction only on 64-bit PowerPC
+ */
+static inline double __fcfid (double b) __attribute__((always_inline));
+static inline double
+__fcfid (double b)
+{
+ double result;
+ __asm__ ("fcfid %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (b));
+ return result;
+}
+
+/*
+ * fmadd - Floating Multiply-Add (Double-Precision)
+ *
+ * (a * c + b) double precision
+ */
+static inline double __fmadd (double a, double c, double b) __attribute__((always_inline));
+static inline double
+__fmadd (double a, double c, double b)
+{
+ double result;
+ __asm__ ("fmadd %0, %1, %2, %3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c), "f" (b));
+ return result;
+}
+
+/*
+ * fmadds - Floating Multiply-Add Single
+ *
+ * (a * c + b) single precision
+ *
+ * Double precision arguments are used to prevent the compiler from
+ * issuing frsp instructions upstream.
+ */
+static inline float __fmadds (double a, double c, double b) __attribute__((always_inline));
+static inline float
+__fmadds (double a, double c, double b)
+{
+ float result;
+ __asm__ ("fmadds %0, %1, %2, %3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c), "f" (b));
+ return result;
+}
+
+/*
+ * fmsub - Floating Multiply-Subract (Double-Precision)
+ *
+ * (a * c - b) double precision
+ */
+static inline double __fmsub (double a, double c, double b) __attribute__((always_inline));
+static inline double
+__fmsub (double a, double c, double b)
+{
+ double result;
+ __asm__ ("fmsub %0, %1, %2, %3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c), "f" (b));
+ return result;
+}
+
+/*
+ * fmsubs - Floating Multiply-Subract Single
+ *
+ * (a * c - b) single precision
+ *
+ * Double precision arguments are used to prevent the compiler from
+ * issuing frsp instructions upstream.
+ */
+static inline float __fmsubs (double a, double c, double b) __attribute__((always_inline));
+static inline float
+__fmsubs (double a, double c, double b)
+{
+ float result;
+ __asm__ ("fmsubs %0, %1, %2, %3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c), "f" (b));
+ return result;
+}
+
+/*
+ * fmul - Floating Multiply (Double-Precision)
+ *
+ * (a * c) double precision
+ */
+static inline double __fmul (double a, double c) __attribute__((always_inline));
+static inline double
+__fmul (double a, double c)
+{
+ double result;
+ __asm__ ("fmul %0, %1, %2"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c));
+ return result;
+}
+
+/*
+ * fmuls - Floating Multiply Single
+ *
+ * (a * c) single precision
+ *
+ * Double precision arguments are used to prevent the compiler from
+ * issuing frsp instructions upstream.
+ */
+static inline float __fmuls (double a, double c) __attribute__((always_inline));
+static inline float
+__fmuls (double a, double c)
+{
+ float result;
+ __asm__ ("fmuls %0, %1, %2"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c));
+ return result;
+}
+
+/*
+ * __fnmadd - Floating Negative Multiply-Add (Double-Precision)
+ *
+ * -(a * c + b) double precision
+ */
+static inline double __fnmadd (double a, double c, double b) __attribute__((always_inline));
+static inline double
+__fnmadd (double a, double c, double b)
+{
+ double result;
+ __asm__ ("fnmadd %0, %1, %2, %3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c), "f" (b));
+ return result;
+}
+
+/*
+ * __fnmadds - Floating Negative Multiply-Add Single
+ *
+ * -(a * c + b) single precision
+ *
+ * Double precision arguments are used to prevent the compiler from
+ * issuing frsp instructions upstream.
+ */
+static inline float __fnmadds (double a, double c, double b) __attribute__((always_inline));
+static inline float
+__fnmadds (double a, double c, double b)
+{
+ float result;
+ __asm__ ("fnmadds %0, %1, %2, %3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c), "f" (b));
+ return result;
+}
+
+/*
+ * __fnmsub - Floating Negative Multiply-Subtract (Double-Precision)
+ *
+ * -(a * c - B) double precision
+ */
+static inline double __fnmsub (double a, double c, double b) __attribute__((always_inline));
+static inline double
+__fnmsub (double a, double c, double b)
+{
+ double result;
+ __asm__ ("fnmsub %0, %1, %2, %3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c), "f" (b));
+ return result;
+}
+
+/*
+ * __fnmsubs - Floating Negative Multiply-Subtract Single
+ *
+ * -(a * c - b) single precision
+ *
+ * Double precision arguments are used to prevent the compiler from
+ * issuing frsp instructions upstream.
+ */
+static inline float __fnmsubs (double a, double c, double b) __attribute__((always_inline));
+static inline float
+__fnmsubs (double a, double c, double b)
+{
+ float result;
+ __asm__ ("fnmsubs %0, %1, %2, %3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (a), "f" (c), "f" (b));
+ return result;
+}
+
+/*
+ * __fres - Floating Reciprocal Estimate
+ *
+ * Produces a double precision result with 5 bits of accuracy.
+ * Note: not valid on the PowerPC 601.
+ *
+ * ??? CW: float __fres(float)
+ */
+static inline float __fres (float val) __attribute__((always_inline));
+static inline float
+__fres (float val)
+{
+ float estimate;
+ __asm__ ("fres %0,%1"
+ /* outputs: */ : "=f" (estimate)
+ /* inputs: */ : "f" (val));
+ return estimate;
+}
+
+/*
+ * __frsp - Floating Round to Single-Precision
+ */
+static inline float __frsp (double d) __attribute__((always_inline));
+static inline float
+__frsp (double d)
+{
+ float result;
+ __asm__ ("frsp %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (d));
+ return result;
+}
+
+/*
+ * __frsqrte - Floating Reciprocal Square Root Estimate
+ *
+ * Note: not valid on the PowerPC 601.
+ */
+static inline double __frsqrte (double val) __attribute__((always_inline));
+static inline double
+__frsqrte (double val)
+{
+ double estimate;
+
+ __asm__ ("frsqrte %0,%1"
+ /* outputs: */ : "=f" (estimate)
+ /* inputs: */ : "f" (val));
+ return estimate;
+}
+
+/*
+ * __frsqrtes - Floating Reciprocal Square Root Estimate Single
+ */
+static inline float __frsqrtes (double f) __attribute__((always_inline));
+static inline float
+__frsqrtes (double f)
+{
+ float result;
+ __asm__ ("frsqrte %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (f));
+ return result;
+}
+
+/*
+ * __fsel - Floating Select
+ *
+ * if (test >= 0) return a; else return b;
+ *
+ * Note: not valid on the PowerPC 601.
+ */
+static inline double __fsel (double test, double a, double b) __attribute__((always_inline));
+static inline double
+__fsel (double test, double a, double b)
+{
+ double result;
+ __asm__ ("fsel %0,%1,%2,%3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (test), "f" (a), "f" (b));
+ return result;
+}
+
+/*
+ * __fsels - Floating Select (Single-Precision variant)
+ *
+ * An artificial single precision variant of fsel. This produces the
+ * same results as fsel, but is useful because the result is cast as
+ * a float, discouraging the compiler from issuing a frsp instruction
+ * afterward.
+ */
+static inline float __fsels (double test, double a, double b) __attribute__((always_inline));
+static inline float
+__fsels (double test, double a, double b)
+{
+ float result;
+ __asm__ ("fsel %0,%1,%2,%3"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (test), "f" (a), "f" (b));
+ return result;
+}
+
+/*
+ * __fsqrt - Floating-Point Square Root (Double-Precision)
+ *
+ * WARNING: Illegal instruction for PowerPC 603, 604, 750, 7400, 7410,
+ * 7450, and 7455
+ */
+static inline double __fsqrt (double b) __attribute__((always_inline));
+static inline double
+__fsqrt(double d)
+{
+ double result;
+ __asm__ ("fsqrt %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (d));
+ return result;
+}
+
+/*
+ * __fsqrts - Floating-Point Square Root Single-Precision
+ *
+ * WARNING: Illegal instruction for PowerPC 603, 604, 750, 7400, 7410,
+ * 7450, and 7455
+ */
+static inline float __fsqrts (float f) __attribute__((always_inline));
+static inline float
+__fsqrts (float f)
+{
+ float result;
+ __asm__ ("fsqrts %0, %1"
+ /* outputs: */ : "=f" (result)
+ /* inputs: */ : "f" (f));
+ return result;
+}
+
+/*
+ * __mulhw - Multiply High Word
+ */
+static inline int __mulhw (int a, int b) __attribute__((always_inline));
+static inline int
+__mulhw (int a, int b)
+{
+ int result;
+ __asm__ ("mulhw %0, %1, %2"
+ /* outputs: */ : "=r" (result)
+ /* inputs: */ : "r" (a), "r"(b));
+ return result;
+}
+
+/*
+ * __mulhwu - Multiply High Word Unsigned
+ */
+static inline unsigned int __mulhwu (unsigned int a, unsigned int b) __attribute__((always_inline));
+static inline unsigned int
+__mulhwu (unsigned int a, unsigned int b)
+{
+ unsigned int result;
+ __asm__ ("mulhwu %0, %1, %2"
+ /* outputs: */ : "=r" (result)
+ /* inputs: */ : "r" (a), "r"(b));
+ return result;
+}
+
+/*
+ * __stfiwx - Store Floating-Point as Integer Word Indexed
+ *
+ * void x(int, void *, int);
+ */
+#define __stfiwx(value, base, index) \
+ __asm__ ("stfiwx %0, %1, %2" : /*no result*/ \
+ : "f" (value), "b%" (index), "r" (base) : "memory")
+
+
+/*******************************************************************
+ * Miscellaneous Functions *
+ *******************************************************************/
+
+/*
+ * __nop - no operation (PowerPC preferred form)
+ *
+ * void __nop();
+ */
+#define __nop() \
+ __asm__ ("ori 0,0,0")
+
+/*
+ * __icbi - Instruction Cache Block Invalidate
+ *
+ * void __icbi(void *, int);
+ */
+#define __icbi(base, index) \
+ __asm__ ("icbi %0, %1" : /*no result*/ : "b%" (index), "r" (base) : "memory")
+
+/*
+ * __mffs - Move from FPSCR
+ */
+static inline double __mffs (void) __attribute__((always_inline));
+static inline double
+__mffs (void)
+{
+ double result;
+ __asm__ volatile ("mffs %0"
+ /* outputs: */ : "=f" (result));
+ return result;
+}
+
+/*
+ * __mfspr - Move from Special Purpose Register
+ *
+ * int __mfspr(int);
+ */
+#define __mfspr(spr) \
+ __extension__ ({ long mfsprResult; \
+ __asm__ volatile ("mfspr %0, %1" : "=r" (mfsprResult) : "n" (spr)); \
+ /*return*/ mfsprResult; })
+
+/*
+ * __mtfsf - Move to SPSCR Fields
+ *
+ * void __mtfsf(int, int);
+ */
+#define __mtfsf(mask, newValue) \
+ __asm__ volatile ("mtfsf %0, %1" : : "n" (mask), "f" (newValue))
+
+/*
+ * __mtspr - Move to Special Purpose Register
+ *
+ * __mtspr x(int, int);
+ */
+#define __mtspr(spr, value) \
+ __asm__ volatile ("mtspr %0, %1" : : "n" (spr), "r" (value))
+
+/*
+ * __OSReadSwapSInt16
+ *
+ * lhbrx for signed shorts. This will do the required sign
+ * extension after load and byteswap.
+ */
+static inline signed short __OSReadSwapSInt16 (signed short *base, int index) __attribute__((always_inline));
+static inline signed short
+__OSReadSwapSInt16 (signed short *base, int index)
+{
+ signed long result;
+ __asm__ volatile ("lhbrx %0, %1, %2"
+ /* outputs: */ : "=r" (result)
+ /* inputs: */ : "b%" (index), "r" (base)
+ /* clobbers: */ : "memory");
+ return result;
+}
+
+/*
+ * __OSReadSwapUInt16
+ */
+static inline unsigned short __OSReadSwapUInt16 (volatile void *base, int inex) __attribute__((always_inline));
+static inline unsigned short
+__OSReadSwapUInt16 (volatile void *base, int index)
+{
+ unsigned long result;
+ __asm__ volatile ("lhbrx %0, %1, %2"
+ /* outputs: */ : "=r" (result)
+ /* inputs: */ : "b" (index), "r" (base)
+ /* clobbers: */ : "memory");
+ return result;
+}
+
+/*
+ * __astrcmp - assembly strcmp
+ */
+static inline int astrcmp (const char *in_s1, const char *in_s2) __attribute__((always_inline));
+static inline int
+astrcmp (const char *in_s1, const char *in_s2)
+{
+ int result, temp;
+ register const char *s1 = in_s1 - 1;
+ register const char *s2 = in_s2 - 1;
+
+ __asm__ ("1:lbzu %0,1(%1)\n"
+ "\tcmpwi cr1,%0,0\n"
+ "\tlbzu %3,1(%2)\n"
+ "\tsubf. %0,%3,%0\n"
+ "\tbeq- cr1,2f\n"
+ "\tbeq+ 1b\n2:"
+ /* outputs: */ : "=&r" (result), "+b" (s1), "+b" (s2), "=r" (temp)
+ /* inputs: */ :
+ /* clobbers: */ : "cr0", "cr1", "memory");
+
+ return result;
+
+ /*
+ * "=&r" (result) means: 'result' is written on (the '='), it's any GP
+ * register (the 'r'), and it must not be the same as
+ * any of the input registers (the '&').
+ * "+b" (s1) means: 's1' is read from and written to (the '+'),
+ * and it must be a base GP register (i.e., not R0.)
+ * "=r" (temp) means: 'temp' is any GP reg and it's only written to.
+ *
+ * "memory" in the 'clobbers' section means that gcc will make
+ * sure that anything that should be in memory IS there
+ * before calling this routine.
+ */
+}
+
+#endif /* (defined(__ppc__) || defined(__ppc64__)) && ! defined(__MWERKS__) */
+
+#endif /* _PPC_INTRINSICS_H_ */
diff --git a/more-hdrs/stdarg.h b/more-hdrs/stdarg.h
new file mode 100644
index 00000000000..e12e16383c6
--- /dev/null
+++ b/more-hdrs/stdarg.h
@@ -0,0 +1,6 @@
+/* This file is public domain. */
+#ifdef __MWERKS__
+#include "mw_stdarg.h"
+#else
+#error "This header only supports __MWERKS__."
+#endif
diff --git a/more-hdrs/stdbool.h b/more-hdrs/stdbool.h
new file mode 100644
index 00000000000..de5287ef12b
--- /dev/null
+++ b/more-hdrs/stdbool.h
@@ -0,0 +1,10 @@
+/* This file is public domain. */
+/* stdbool.h has moved to avoid accidental use with a non-GCC
+ compiler. Only GCC should have used stdbool.h due to licensing
+ restrictions. */
+#ifdef __MWERKS__
+#include "mw_stdbool.h"
+#else
+#error "This header only supports __MWERKS__."
+#endif
+
diff --git a/more-hdrs/stdint.h b/more-hdrs/stdint.h
new file mode 100644
index 00000000000..d7f97e332be
--- /dev/null
+++ b/more-hdrs/stdint.h
@@ -0,0 +1,245 @@
+/*
+ * Copyright (c) 2000, 2001, 2003, 2004 Apple Computer, Inc.
+ * All rights reserved.
+ */
+
+#ifndef _STDINT_H_
+#define _STDINT_H_
+
+/* from ISO/IEC 988:1999 spec */
+
+/* 7.18.1.1 Exact-width integer types */
+#ifndef _INT8_T
+#define _INT8_T
+typedef signed char int8_t;
+#endif /*_INT8_T */
+
+#ifndef _INT16_T
+#define _INT16_T
+typedef short int16_t;
+#endif /* _INT16_T */
+
+#ifndef _INT32_T
+#define _INT32_T
+typedef int int32_t;
+#endif /* _INT32_T */
+
+#ifndef _INT64_T
+#define _INT64_T
+typedef long long int64_t;
+#endif /* _INT64_T */
+
+#ifndef _UINT8_T
+#define _UINT8_T
+typedef unsigned char uint8_t;
+#endif /*_UINT8_T */
+
+#ifndef _UINT16_T
+#define _UINT16_T
+typedef unsigned short uint16_t;
+#endif /* _UINT16_T */
+
+#ifndef _UINT32_T
+#define _UINT32_T
+typedef unsigned int uint32_t;
+#endif /* _UINT32_T */
+
+#ifndef _UINT64_T
+#define _UINT64_T
+typedef unsigned long long uint64_t;
+#endif /* _UINT64_T */
+
+/* 7.18.1.2 Minimum-width integer types */
+typedef int8_t int_least8_t;
+typedef int16_t int_least16_t;
+typedef int32_t int_least32_t;
+typedef int64_t int_least64_t;
+typedef uint8_t uint_least8_t;
+typedef uint16_t uint_least16_t;
+typedef uint32_t uint_least32_t;
+typedef uint64_t uint_least64_t;
+
+
+/* 7.18.1.3 Fastest-width integer types */
+typedef int8_t int_fast8_t;
+typedef int16_t int_fast16_t;
+typedef int32_t int_fast32_t;
+typedef int64_t int_fast64_t;
+typedef uint8_t uint_fast8_t;
+typedef uint16_t uint_fast16_t;
+typedef uint32_t uint_fast32_t;
+typedef uint64_t uint_fast64_t;
+
+
+/* 7.18.1.4 Integer types capable of holding object pointers */
+
+#ifndef _INTPTR_T
+#define _INTPTR_T
+typedef long intptr_t;
+#endif /* _INTPTR_T */
+
+#ifndef _UINTPTR_T
+#define _UINTPTR_T
+typedef unsigned long uintptr_t;
+#endif /* _UINTPTR_T */
+
+
+/* 7.18.1.5 Greatest-width integer types */
+#ifndef _INTMAX_T
+#define _INTMAX_T
+#ifdef __INTMAX_TYPE__
+typedef __INTMAX_TYPE__ intmax_t;
+#else /* __INTMAX_TYPE__ */
+typedef long long intmax_t;
+#endif /* __INTMAX_TYPE__ */
+#endif /* _INTMAX_T */
+
+#ifndef _UINTMAX_T
+#define _UINTMAX_T
+#ifdef __UINTMAX_TYPE__
+typedef __UINTMAX_TYPE__ uintmax_t;
+#else /* __UINTMAX_TYPE__ */
+typedef unsigned long long uintmax_t;
+#endif /* __UINTMAX_TYPE__ */
+#endif /* _UINTMAX_T */
+
+/* "C++ implementations should define these macros only when
+ * __STDC_LIMIT_MACROS is defined before <stdint.h> is included."
+ * In other words, if C++, then __STDC_LIMIT_MACROS enables the
+ * macros below. (Note that there also exists a different enabling
+ * macro (__STDC_CONSTANT_MACROS) for the last few, below.)
+ */
+#if (! defined(__cplusplus)) || defined(__STDC_LIMIT_MACROS)
+
+
+/* 7.18.2 Limits of specified-width integer types:
+ * These #defines specify the minimum and maximum limits
+ * of each of the types declared above.
+ */
+
+
+/* 7.18.2.1 Limits of exact-width integer types */
+#define INT8_MAX 127
+#define INT16_MAX 32767
+#define INT32_MAX 2147483647
+#define INT64_MAX 9223372036854775807LL
+
+#define INT8_MIN -128
+#define INT16_MIN -32768
+ /*
+ Note: the literal "most negative int" cannot be written in C --
+ the rules in the standard (section 6.4.4.1 in C99) will give it
+ an unsigned type, so INT32_MIN (and the most negative member of
+ any larger signed type) must be written via a constant expression.
+ */
+#define INT32_MIN (-INT32_MAX-1)
+#define INT64_MIN (-INT64_MAX-1)
+
+#define UINT8_MAX 255
+#define UINT16_MAX 65535
+#define UINT32_MAX 4294967295U
+#define UINT64_MAX 18446744073709551615ULL
+
+/* 7.18.2.2 Limits of minimum-width integer types */
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST64_MIN INT64_MIN
+
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MAX INT64_MAX
+
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+/* 7.18.2.3 Limits of fastest minimum-width integer types */
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST64_MIN INT64_MIN
+
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MAX INT64_MAX
+
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+/* 7.18.2.4 Limits of integer types capable of holding object pointers */
+
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+
+#define UINTPTR_MAX UINT32_MAX
+
+/* 7.18.2.5 Limits of greatest-width integer types */
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+
+#define UINTMAX_MAX UINT64_MAX
+
+/* 7.18.3 "Other" */
+#define PTRDIFF_MIN INT32_MIN
+#define PTRDIFF_MAX INT32_MAX
+
+/* We have no sig_atomic_t yet, so no SIG_ATOMIC_{MIN,MAX}.
+ Should end up being {-127,127} or {0,255} ... or bigger.
+ My bet would be on one of {U}INT32_{MIN,MAX}. */
+
+#define SIZE_MAX UINT32_MAX
+
+#ifndef WCHAR_MAX
+# ifdef __WCHAR_MAX__
+# define WCHAR_MAX __WCHAR_MAX__
+# else
+# define WCHAR_MAX 0x7fffffff
+# endif
+#endif
+
+/* WCHAR_MIN should be 0 if wchar_t is an unsigned type and
+ (-WCHAR_MAX-1) if wchar_t is a signed type. Unfortunately,
+ it turns out that -fshort-wchar changes the signedness of
+ the type. */
+#if WCHAR_MAX == 0xffff
+# define WCHAR_MIN 0
+#else
+# define WCHAR_MIN (-WCHAR_MAX-1)
+#endif
+
+#define WINT_MIN INT32_MIN
+#define WINT_MAX INT32_MAX
+
+#define SIG_ATOMIC_MIN INT32_MIN
+#define SIG_ATOMIC_MAX INT32_MAX
+
+#endif /* if C++, then __STDC_LIMIT_MACROS enables the above macros */
+
+/* "C++ implementations should define these macros only when
+ * __STDC_CONSTANT_MACROS is defined before <stdint.h> is included."
+ */
+#if (! defined(__cplusplus)) || defined(__STDC_CONSTANT_MACROS)
+
+/* 7.18.4 Macros for integer constants */
+#define INT8_C(v) (v)
+#define INT16_C(v) (v)
+#define INT32_C(v) (v ## L)
+#define INT64_C(v) (v ## LL)
+
+#define UINT8_C(v) (v ## U)
+#define UINT16_C(v) (v ## U)
+#define UINT32_C(v) (v ## UL)
+#define UINT64_C(v) (v ## ULL)
+
+#define INTMAX_C(v) (v ## LL)
+#define UINTMAX_C(v) (v ## ULL)
+
+#endif /* if C++, then __STDC_CONSTANT_MACROS enables the above macros */
+
+#endif /* _STDINT_H_ */
diff --git a/more-hdrs/varargs.h b/more-hdrs/varargs.h
new file mode 100644
index 00000000000..83188caef34
--- /dev/null
+++ b/more-hdrs/varargs.h
@@ -0,0 +1,6 @@
+/* This file is public domain. */
+#ifdef __MWERKS__
+#include "mw_varargs.h"
+#else
+#error "This header only supports __MWERKS__."
+#endif
diff --git a/order-files/HOW TO BUILD b/order-files/HOW TO BUILD
new file mode 100644
index 00000000000..7cca046f37a
--- /dev/null
+++ b/order-files/HOW TO BUILD
@@ -0,0 +1,170 @@
+ Creating Order files, i.e., Scatter Loading the Compiler
+ --------------------------------------------------------
+
+This is a brief description on how to generate the cc1*.order files.
+The order files are intended to minimize the number of page-ins of
+the compiler as it is loaded. If there is enough memory this
+benifits only the first load of the compiler since it will stay
+resident after that.
+
+Unfortunately it's a manual process since one of the tools requires
+an explicit interrupt from the terminal. You should only need to
+(re)do the order files if there's any major reorganizations or
+additions to the compilers.
+
+There are five steps involved to genrrate the order files.
+
+1. Select test cases.
+
+ These should be "average" compilations to exercise each of the
+ cc1* compilers. They should be large enough to take enough time
+ to generate acceptible results. As of this writing the
+ following cases were chosen:
+
+ For cc1 - gcc/c-decl.c (from the compiler sources)
+ For cc1plus - Finder_FE/AboutWindow/AboutWindow.cp
+ For cc1obj - MailViewer/Compose.subproj/MessageEditor.m
+ For cc1objplus - devkit/cpp.subproj/Cpp-precomp.mm
+
+ Of these four the cc1objplus test case is not very good.
+ Unfortunately there are few .mm files of any significant size.
+ If a better one can be found it probably should be used.
+
+2. Capture the command lines needed to build the chosen files.
+
+ For the selected projects built with with PB set PB's building
+ preferences for detailed build logs. That way you can the
+ full command lines you need. In non-PB projects like gcc the
+ command lines are of course echoed on the terminal.
+
+3. Run selected command lines with -### to get the cc1* lines.
+
+ From the full command lines you need the cc1* lines generated
+ by the driver. The easiest way to get these is to add -###
+ to the full command lines captured in step 2.
+
+4. Prepare to generate the order files
+
+ If you don't already have it you should build a set of cc1*
+ compilers with -O2 with symbols. The easiest way to do this
+ is FSF-style but using buildit with build_gcc probably will
+ also work.
+
+ In the gcc objects directory you will of course have the cc1*
+ compilers. You need to substitute these in each of the cc1*
+ command lines captured in step 3. You also need to run these
+ with ~perf/bin/pcsample to generate the order files. Thus,
+ for each cc1* command line it should have the following in
+ the beginning in place of the original cc1* of the step 3
+ lines.
+
+ sudo ~perf/bin/pcsample -O -E $gcc3-obj/cc1* ... rest of line...
+
+ Where $gcc3-obj represents whatever the path is to the gcc3
+ objects directory and cc1* is one of the cc1* compilers (is
+ -B necessary here?).
+
+ Note, you need sudo because pcsample will only run as root.
+ Also, if you have a dual processor you need to reboot as in
+ single processor mode. If you don't pcscample will tell you
+ to do that by executing the command,
+
+ nvram boot-args="cpus=1"
+
+5. Generate the order files
+
+ Run the lines created in step 4. The order files (cc1*.order)
+ will be left in /tmp in the direectory indicated by the summary
+ that pcsample displays when you hit cmd-c to stop the pcsample
+ execution. Be sure to run pcsample long enough to compile the
+ entire program.
+
+ At this point you now have the order files created. You place
+ them in the order-files directory at the top level of the gcc
+ source directory.
+
+ You can also use them to measure he effects of these order files
+ on compiler page-ins. If you do this go to the next step (6).
+ Otherwisw you are ready to go.
+
+6. Creating the compilers with ther order files
+
+ You will need two versions of the cc1* files; the ones from above
+ and a set linked with their respective order file.
+
+ From a gcc compiler build extract the command lines that link
+ the cc1* files. Change the -o file to something else, for
+ example, cc1 to cc1X. Then add the following options to the
+ link line. Note, if you build using buildit and build_gcc the
+ lines will already be there referencing the order-files
+ directory. Otherwise you need to add,
+
+ -sectorder __TEXT __text $order/cc1*.order -e start
+
+ where $order is the directory containing the order file being
+ used and cc1* is of course a reference to a specific order
+ file.
+
+ 7. Measuring the performance improvement
+
+ You need to have two terminbal windows open; T1 and T2. The
+ execute the follwoing commands on the indicated terminals:
+
+ T2: sudo fs_usage -w > /tmp/fs.out1 (do NOT execute yet)
+ T1: ~perf/bin/flushmem (note this can take a while)
+ T2: fs_usage
+ T1: use cc1* line originally used to build order file
+ T2: ctl-c when cc1* compilation done
+
+ T2: sudo fs_usage -w > /tmp/fs.out2 (do not execute yet)
+ T1: ~perf/bin/flushmem
+ T2: fs_usage
+ T1: use cc1*X line originally used to build order file
+ T2: ctl-c when cc1XXX compilation done
+
+ In the first group of commands you use the original cc1* line
+ with the command line used to build the order file. You also
+ run fs_usage at the same time to measure the paging behavior.
+
+ The second group of commands is similar but you use the cc1*
+ linked with its order file (with the -sectorder stuff mentioned
+ in step 6). For this discussion call this compiler cc1*X.
+
+ In both cases you need to run ~perf/bin/flushmem to make sure
+ compiler is flused from the cached. That way you are
+ measuring the initial page-in bechavor as thee compiler is
+ loaded. Warning, the flushmem's sometimes take quite a
+ while.
+
+ At this point you should have /tmp/fs.out1 and /tmp/fs.out2.
+ You need to extract the page-ins times for the compilers in
+ order to sum them up. The easies way to do this is make the
+ data tab delimited for importing into Excel.
+
+ T1: fgrep cc1* /tmp/fs.out1 | fgrep PAGE_IN | \
+ tr -s "[:blank:]" '\t' >/tmp/cc1*.pageins-1
+ T1: fgrep cc1*X /tmp/fs.out2 | fgrep PAGE_IN | \
+ tr -s "[:blank:]" '\t' >/tmp/cc1*.pageins-2
+
+ Load each of these into Excel and sum the pagin times to
+ determine the percent change.
+
+ Remember that the '*'s in the above illustrations are not really
+ a '*'. It is just a short way to show the general command lines
+ where in reality you explicitly specify cc1, cc1plus, cc1obj, or
+ cc1objplus.
+
+ Also remember that you are measuring the page-in performance
+ improvement on the test cases used to generate the order files
+ in the first place. Thus you should expect that these would
+ probably show the greatest improvement. That is why it is
+ important to try to choose representative test cases in the
+ first place. You can try the measurements on other tests.
+ But that requires you again extracting the cc1* lines using
+ -###. The above procedure only uses the orignal files since
+ the command lines are already handy.
+
+
+
+
+
diff --git a/order-files/cc1.order b/order-files/cc1.order
new file mode 100644
index 00000000000..a3bd7b04a39
--- /dev/null
+++ b/order-files/cc1.order
@@ -0,0 +1,1188 @@
+start
+__start
+__dyld_init_check
+dyld_stub_binding_helper
+___darwin_gcc3_preregister_frame_info
+__call_mod_init_funcs
+__dyld_func_lookup
+_main
+_toplev_main
+_hex_init
+_general_init
+_xmalloc_set_program_name
+_diagnostic_initialize
+__obstack_begin
+_xmalloc
+_parse_options_and_default_flags
+_init_reg_sets
+_add_params
+_xrealloc
+_pfe_init
+_override_O_option
+_extract_override_options
+_lang_init_options
+_c_common_init_options
+_cpp_create_reader
+_init_library
+_init_trigraph_map
+_xcalloc
+_set_lang
+_deps_init
+_init_line_maps
+__cpp_init_tokenrun
+__cpp_get_buff
+_new_buff
+_pfe_s_malloc
+_pfe_malloc
+_gcc_obstack_init
+_pfe_obstack_chuck_alloc
+__cpp_init_includes
+_splay_tree_new
+_splay_tree_new_with_allocator
+_splay_tree_xmalloc_allocate
+_set_index_lang
+_set_target_switch
+_optimization_options
+_override_option
+_c_decode_option
+_cpp_handle_option
+_parse_option
+_independent_decode_option
+_xstrdup
+_append_include_chain
+__cpp_simplify_pathname
+_remove_component_p
+_new_pending_directive
+_dump_switch_p
+_decode_f_option
+_decode_g_option
+_set_Wunused
+_set_Wformat
+_decode_W_option
+_add_env_options
+_c_common_post_options
+_cpp_post_options
+_init_dependency_output
+_do_compile
+_process_options
+_rs6000_override_options
+_rs6000_parse_abi_options
+_rs6000_add_gc_roots
+_ggc_add_rtx_root
+_ggc_add_root
+_htab_create
+_higher_prime_number
+_machopic_add_gc_roots
+_ggc_add_tree_root
+_new_alias_set
+_floor_log2_wide
+_init_timevar
+_timevar_start
+_lang_independent_init
+_init_ggc
+_exact_log2_wide
+_pfe_s_calloc
+_pfe_calloc
+_init_stringpool
+_ht_create
+_init_obstacks
+_ggc_add_deletable_htab
+_init_emit_once
+_mode_for_size
+_gen_rtx
+_rtx_alloc
+_ggc_alloc
+_alloc_page
+_pfe_free
+_set_page_table_entry
+_gen_raw_REG
+_gen_rtx_fmt_i0
+_gen_rtx_fmt_w
+_ereal_atof
+_asctoe53
+_asctoeg
+_ecleaz
+_enormlz
+_eshup6
+_toe53
+_eiisnan
+_eshift
+_eshup1
+_e53toe
+_eshdn1
+_ecleazs
+_emovo
+_emovz
+_eaddm
+_eshup8
+_emdnorm
+_gen_rtx_CONST_INT
+_gen_const_vector_0
+_rtvec_alloc
+_gen_rtx_fmt_E0
+_gen_rtx_REG
+_init_regs
+_init_reg_sets_1
+_reg_class_subset_p
+_init_reg_modes
+_choose_hard_reg_mode
+_init_alias_once
+_init_stmt
+_init_loop
+_address_cost
+_memory_address_p
+_rs6000_legitimate_address
+_init_reload
+_gen_rtx_fmt_ee
+_gen_rtx_MEM
+_gen_rtx_fmt_e0
+_gen_rtx_fmt_s
+_pfe_savestring
+_plus_constant_wide
+_find_constant_term_loc
+_bitmap_initialize
+_init_function_once
+_varray_init
+_init_stor_layout_once
+_init_varasm_once
+_init_EXPR_INSN_LIST_cache
+_init_dummy_function_start
+_prepare_function_start
+_ggc_alloc_cleared
+_init_stmt_for_function
+_init_eh_for_function
+_init_emit
+_clear_emit_caches
+_init_virtual_regs
+_init_expr
+_init_varasm_status
+_init_temp_slots
+_init_pending_stack_adjust
+_rs6000_init_machine_status
+_init_expmed
+_start_sequence
+_rtx_cost
+_emit_insn
+_make_insn_raw
+_add_insn
+_init_recog
+_recog
+_recog_13
+_gpc_reg_operand
+_register_operand
+_recog_4
+_reg_or_cint_operand
+_recog_5
+_nonimmediate_operand
+_general_operand
+_input_operand
+_memory_operand
+_toc_relative_expr_p
+_constant_pool_expr_1
+_reg_or_short_operand
+_short_cint_operand
+_htab_find_slot_with_hash
+_const_int_htab_eq
+_init_expr_once
+_boolean_or_operator
+_boolean_operator
+_recog_1
+_reg_or_mem_operand
+_recog_7
+_recog_10
+_recog_9
+_altivec_register_operand
+_zero_constant
+_extract_insn
+_init_caller_save
+_constrain_operands
+_reg_fits_class_p
+_insn_extract
+_recog_memoized_1
+_cc_reg_operand
+_recog_6
+_record_builtin_type
+_build_decl
+_make_node
+_tree_size
+_pushdecl
+_lookup_name_current_level
+_c_common_nodes_and_builtins
+_get_identifier
+_ht_lookup
+_calc_hash
+_alloc_node
+_make_signed_type
+_default_set_default_type_attributes
+_fixup_signed_type
+_build_int_2_wide
+_layout_type
+_tree_int_cst_sgn
+_smallest_mode_for_size
+_size_int_wide
+_size_int_type_wide
+_force_fit_type
+_htab_find_slot
+_size_htab_hash
+_size_htab_eq
+_finalize_type_size
+_get_mode_alignment
+_round_type_align
+_round_up
+_size_binop
+_int_const_binop
+_integer_onep
+_tree_cons
+_make_unsigned_type
+_fixup_unsigned_type
+_identifier_global_value
+_signed_type
+_set_sizetype
+_copy_node
+_build_common_tree_nodes_2
+_build_pointer_type
+_build_qualified_type
+_get_qualified_type
+_build_type_copy
+_set_type_quals
+_mul_double
+_encode
+_decode
+_rs6000_build_va_list
+_make_vector
+_finish_vector_type
+_build_index_type
+_convert
+_convert_to_integer
+_build1
+_first_rtl_op
+_fold
+_fold_convert
+_compare_tree_int
+_host_integerp
+_tree_low_cst
+_type_hash_canon
+_type_hash_lookup
+_htab_find_with_hash
+_type_hash_add
+_build_array_type
+_build
+_integer_zerop
+_non_lvalue
+_add_double
+_simple_cst_equal
+_mode_for_size_tree
+_start_record_layout
+_place_field
+_layout_decl
+_default_ms_bitfield_layout_p
+_normalize_rli
+_normalize_offset
+_finish_record_layout
+_finalize_record_size
+_get_inner_array_type
+_rli_size_so_far
+_bit_from_pos
+_rli_size_unit_so_far
+_byte_from_pos
+_compute_record_mode
+_type_hash_eq
+_attribute_list_equal
+_attribute_list_contained
+_bit_position
+_int_bit_position
+_builtin_function
+_make_decl_rtl
+_decode_reg_name
+_darwin_encode_section_info
+_ggc_alloc_string
+_update_stubs
+_decl_attributes
+_default_insert_attributes
+_insert_default_attributes
+_c_common_insert_default_attributes
+_builtin_function_2
+_builtin_function_disabled_p
+_set_decl_assembler_name
+_is_attribute_p
+_c_init_decl_processing
+_build_function_type
+_type_hash_list
+_type_list_equal
+_start_fname_decls
+_set_dump_tree_p
+_c_objc_common_init
+_c_common_init
+_init_c_lex
+_get_fileinfo
+_splay_tree_lookup
+_splay_tree_splay
+_splay_tree_insert
+_cpp_get_callbacks
+_cpp_read_main_file
+__cpp_init_hashtable
+__cpp_init_directives
+_cpp_lookup
+__obstack_newchunk
+__cpp_init_internal_pragmas
+_cpp_register_pragma
+_lookup_pragma_entry
+_insert_pragma_entry
+__cpp_aligned_alloc
+_init_standard_includes
+_update_path
+_concat
+_translate_name
+_get_key_value
+_merge_include_chains
+_remove_dup_dirs
+_remove_dup_dir
+__cpp_read_file
+_open_file
+_find_or_create_entry
+_splay_tree_foreach
+_splay_tree_foreach_helper
+_inode_finder
+_stack_include_file
+_read_include_file
+_cpp_push_buffer
+__cpp_do_file_change
+_add_line_map
+_cb_file_change
+_update_header_times
+_extract_interface_info
+_init_pragma
+_add_c_tree_codes
+_ggc_add_tree_varray_root
+_lang_dependent_init
+_init_asm_output
+_init_eh
+_init_optabs
+_new_optab
+_init_all_optabs
+_init_integral_libfuncs
+_init_libfuncs
+_init_floating_libfuncs
+_init_one_libfunc
+_init_traps
+_push_srcloc
+_timevar_push
+_dwarf2out_do_frame
+_dbxout_init
+_getdecls
+_getpwd
+_output_quoted_string
+_assemble_name
+_maybe_get_identifier
+_text_section
+_dbxout_typedefs
+_dbxout_symbol
+_timevar_pop
+_compile_file
+_init_final
+_init_branch_prob
+_yyparse
+_dbxout_start_source_file
+_cpp_finish_options
+_init_builtins
+__cpp_define_builtin
+_run_directive
+_start_directive
+_do_define
+_lex_macro_node
+__cpp_lex_token
+__cpp_lex_direct
+_parse_identifier
+__cpp_create_definition
+_skip_whitespace
+_parse_string
+_unescaped_terminator_p
+_alloc_expansion_token
+_lex_expansion_token
+_handle_newline
+_pfe_is_cmd_ln_processing
+_end_directive
+_skip_rest_of_line
+__cpp_pop_buffer
+_parse_number
+_pfe_set_cmd_ln_processing
+_cpp_define
+_warn_of_redefinition
+__cpp_equiv_tokens
+__cpp_free_definition
+_pfe_reset_cmd_ln_processing
+_free_chain
+__cpp_push_next_buffer
+_yyparse_1
+_yylex
+__yylex
+_c_lex
+_cpp_get_token
+_get_effective_char
+_skip_block_comment
+_skip_escaped_newlines
+_trigraph_p
+__cpp_handle_directive
+_directive_diagnostics
+_do_include
+_do_include_common
+_parse_include
+_check_eol
+__cpp_execute_include
+_find_include_file
+_search_from
+_lbasename
+_splay_tree_splay_helper
+_adjust_column
+__cpp_extend_buff
+_parse_params
+_save_parameter
+_cb_line_change
+_yylexname
+_altivec_treat_as_keyword
+_ggc_collect
+_lookup_name
+_start_enum
+_lookup_tag
+_pushtag
+_build_enumerator
+_int_fits_type_p
+_build_binary_op
+_common_type
+_tree_int_cst_lt
+_type_for_size
+_const_binop
+_chainon
+_nreverse
+_finish_enum
+_in_parm_level_p
+_min_precision
+_tree_floor_log2
+_rest_of_type_compilation
+_shadow_tag
+_shadow_tag_warned
+_split_specs_attrs
+_lookup_tag_reverse
+_check_trad_stringification
+_xref_tag
+_pending_xref_error
+_build_tree_list
+_grokdeclarator
+_c_apply_type_quals_to_decl
+_grokfield
+_finish_decl
+_maybe_apply_renaming_pragma
+_get_pending_sizes
+_finish_struct
+_start_decl
+_maybe_apply_pragma_weak
+_rest_of_decl_compilation
+_start_struct
+_do_ifdef
+_push_conditional
+_do_else
+_do_endif
+_constant_expression_warning
+__cpp_pop_file_buffer
+_pop_srcloc
+_dbxout_end_source_file
+_make_pointer_declarator
+_pushlevel
+_make_binding_level
+_clear_parm_order
+_declare_parm_level
+_push_parm_decl
+_simple_type_promotes_to
+_c_promoting_integer_type_p
+_get_parm_info
+_gettags
+_storedecls
+_parmlist_tags_warning
+_poplevel
+_warn_about_unused_variables
+_build_nt
+_grokparms
+_unsigned_type
+_lex_number
+_build_compound_expr
+_internal_build_compound_expr
+_build_array_declarator
+_set_array_declarator_type
+_signed_or_unsigned_type
+_operand_equal_p
+_tree_int_cst_equal
+_neg_double
+_do_undef
+_warn_if_shadowing
+_build_decl_attribute_variant
+_gen_aux_info_record
+_collect_args
+_enter_macro_context
+_replace_args
+_expand_arg
+_push_ptoken_context
+_next_context
+__cpp_pop_context
+__cpp_release_buff
+_padding_token
+__cpp_temp_token
+_c_build_qualified_type
+_push_token_context
+_list_length
+_handle_noreturn_attribute
+_lookup_attribute
+_purge_cache
+_do_ifndef
+_do_if
+__cpp_parse_expr
+_lex
+_parse_number
+___udivdi3
+___udivmoddi4
+_funlike_invocation_p
+_parse_defined
+_cpp_warning
+__cpp_begin_message
+_do_elif
+_groktypename
+_c_sizeof
+_parser_build_binary_op
+_default_conversion
+_merge_type_attributes
+_merge_attributes
+_build_type_attribute_variant
+_extract_muldiv
+_unsigned_conversion_warning
+_overflow_warning
+_get_narrower
+_attribute_hash_list
+_duplicate_decls
+_comptypes
+_default_comp_type_attributes
+_function_types_compatible_p
+_self_promoting_args_p
+_merge_decl_attributes
+_handle_format_attribute
+_decode_format_attr
+_decode_format_type
+_start_function
+_announce_function
+_store_parm_decls
+_decl_function_context
+_storetags
+_init_function_start
+_decl_name
+_emit_line_note
+_set_file_and_line_for_stmt
+_emit_note
+_aggregate_value_p
+_hard_function_value
+_begin_stmt_tree
+_current_stmt_tree
+_c_begin_compound_stmt
+_build_stmt
+_add_stmt
+_stmts_are_full_exprs_p
+_clear_last_expr
+_add_scope_stmt
+_current_scope_stmt_stack
+_c_begin_if_stmt
+_build_external_ref
+_lookup_objc_ivar
+_assemble_external
+_build_indirect_ref
+_build_component_ref
+_lookup_field
+_build_unary_op
+_unary_complex_lvalue
+_get_unwidened
+_lvalue_or_else
+_lvalue_p
+_shorten_compare
+_twoval_comparison_p
+_invert_tree_comparison
+_truthvalue_conversion
+_build_c_cast
+_default_function_array_conversion
+_lex_charconst
+_cpp_interpret_charconst
+_cpp_parse_escape
+_truth_value_p
+_fold_range_test
+_make_range
+_fold_truthop
+_c_expand_start_cond
+_c_size_in_bytes
+_convert_to_pointer
+_build_modify_expr
+_require_complete_type
+_convert_for_assignment
+_convert_and_check
+_c_expand_return
+_build_return_stmt
+_c_finish_then
+_c_expand_start_else
+_build_function_call
+_decl_target_overloaded_intrinsic_p
+_convert_arguments
+_check_function_format
+_c_finish_else
+_c_expand_end_cond
+_kept_level_p
+_finish_function
+_clear_limbo_values
+_finish_fname_decls
+_finish_stmt_tree
+_free_after_parsing
+_free_stmt_status
+_free_after_compilation
+_free_eh_status
+_free_expr_status
+_free_emit_status
+_free_varasm_status
+_rs6000_free_machine_status
+_c_expand_body
+_tree_inlinable_function_p
+_inlinable_function_p
+_c_disregard_inline_limits
+_c_cannot_inline_tree_fn
+_function_attribute_inlinable_p
+_put_pending_sizes
+_walk_tree
+_inline_forbidden_p
+_statement_code_p
+_lhd_tree_inlining_walk_subtrees
+_get_callee_fndecl
+_setjmp_call_p
+_special_function_p
+_defer_fn
+_debug_nothing_tree
+_integer_all_onesp
+_distribute_bit_expr
+_place_union_field
+_cpp_pedwarn
+_do_include_next
+___divdi3
+___udivmoddi4
+_handle_malloc_attribute
+_type_lists_compatible_p
+_redeclaration_error_message
+_pedwarn
+_set_diagnostic_context
+_report_diagnostic
+_count_error
+_build_range_type
+_complete_array_type
+_start_init
+_push_string
+_really_start_incremental_init
+_process_init_element
+_push_member_name
+_output_init_element
+_initializer_constant_valid_p
+_lhd_return_tree
+_digest_init
+_output_pending_init_elements
+_pop_init_level
+_finish_init
+_store_init_value
+_assemble_variable
+_set_mem_attributes
+_get_alias_set
+_maybe_set_unchanging
+_can_address_p
+_handled_component_p
+_get_mem_attrs
+_mem_attrs_htab_hash
+_update_non_lazy_ptrs
+_app_disable
+_set_mem_align
+_mem_attrs_htab_eq
+_output_addressed_constants
+_resolve_unique_section
+_variable_section
+_darwin_set_section_for_var_p
+_data_section
+_try_section_alias
+_in_text_section
+_machopic_define_name
+_machopic_define_ident
+_machopic_ident_defined_p
+_machopic_classify_ident
+_name_needs_quotes
+_output_constant
+_int_size_in_bytes
+_output_constructor
+_int_byte_position
+_byte_position
+_expand_expr
+_get_subtarget
+_immed_double_const
+_assemble_integer
+_rs6000_assemble_integer
+_find_weak_imports
+_default_assemble_integer
+_integer_asm_op
+_assemble_integer_with_op
+_output_addr_const
+_global_bindings_p
+_handle_unused_attribute
+_add_decl_stmt
+_build_array_ref
+_pointer_int_sum
+_size_in_bytes
+_omit_one_operand
+_decl_constant_value_for_broken_optimization
+_comp_target_types
+_c_expand_expr_stmt
+_verify_sequence_points
+_verify_tree
+_warning_candidate_p
+_split_tree
+_lex_string
+_build_string
+_combine_strings
+_choose_string_type
+_mark_addressable
+_staticp
+_expand_tree_builtin
+_fold_builtin
+_invert_truthvalue
+_define_label
+_lookup_label
+_new_tlist
+_add_tlist
+_warn_for_collisions
+_warn_for_collisions_1
+_merge_tlist
+_decode_field_reference
+_get_inner_reference
+_hash_pointer
+_htab_find
+_eq_pointer
+_expand_call_inline
+_lhd_tree_inlining_tree_chain_matters_p
+_htab_expand
+_find_empty_slot_for_expand
+_expand_call
+_precompute_register_parameters
+_push_temp_slots
+_preserve_temp_slots
+_find_temp_slot_from_address
+_pop_temp_slots
+_combine_temp_slots
+_emit_queue
+_protect_from_queue
+_mark_temp_addr_taken
+_force_operand
+_save_fixed_argument_area
+_prepare_call_address
+_lookup_static_chain
+_load_register_parameters
+_emit_move_insn
+_emit_move_insn_1
+_gen_movsi
+_rs6000_emit_move
+_gen_sequence
+_end_sequence
+_use_reg
+_gen_rtx_fmt_e
+_easy_fp_constant
+_rs6000_machopic_legitimize_pic_address
+_machopic_legitimize_pic_address
+_machopic_indirect_data_reference
+_machopic_data_defined_p
+_machopic_function_base_name
+_gen_rtx_fmt_E
+_trunc_int_for_mode
+_num_insns_constant
+_num_insns_constant_wide
+_get_last_insn
+_function_arg
+_emit_call_1
+_gen_call_value
+_machopic_indirect_call_target
+_machopic_name_defined_p
+_machopic_stub_list_entry
+_gen_rtx_fmt_0
+_gen_rtvec
+_gen_rtvec_v
+_emit_call_insn
+_make_call_insn_raw
+_any_pending_cleanups
+_get_insns
+_gen_rtx_fmt_uuuu
+_expand_builtin
+_do_jump
+_do_pending_stack_adjust
+_can_compare_p
+_do_compare_rtx_and_jump
+_reverse_condition
+_swap_commutative_operands_p
+_commutative_operand_precedence
+_force_not_mem
+_emit_cmp_and_jump_insns
+_prepare_cmp_insn
+_preserve_subexpressions_p
+_emit_cmp_and_jump_insn_1
+_prepare_operand
+_gen_cmpsi
+_gen_beq
+_rs6000_emit_cbranch
+_rs6000_generate_compare
+_gen_reg_rtx
+_validate_condition_mode
+_gen_rtx_fmt_u00
+_gen_rtx_fmt_eee
+_emit_jump_insn
+_make_jump_insn_raw
+_start_cleanup_deferral
+_expand_builtin_strcmp
+_validate_arglist
+_c_getstr
+_string_constant
+_c_strlen
+_build_function_call_expr
+_expand_builtin_memcmp
+_flags_from_decl_or_type
+_init_cumulative_args
+_tree_last
+_rearrange_arg_list
+_initialize_argument_information
+_function_arg_pass_by_reference
+_promote_mode
+_no_reg_parm_stack_space
+_function_arg_partial_nregs
+_function_arg_skip
+_function_arg_boundary
+_locate_and_pad_parm
+_function_arg_padding
+_function_arg_mod_boundary
+_pad_to_arg_alignment
+_function_arg_advance
+_finalize_must_preallocate
+_function_ok_for_sibcall
+_unsafe_for_reeval
+_c_unsafe_for_reeval
+_expand_start_target_temps
+_expand_start_bindings_and_block
+_compute_argument_block_size
+_sbitmap_alloc
+_sbitmap_zero
+_compute_argument_addresses
+_rtx_for_function_call
+_output_constant_def
+_const_hash
+_record_constant
+_record_constant_1
+_set_mem_alias_set
+_copy_constant
+_gen_sibcall_value
+_gen_rtx_fmt_
+_emit_barrier_after
+_add_insn_after
+_copy_to_reg
+_expand_end_target_temps
+_expand_end_bindings
+_precompute_arguments
+_calls_function
+_calls_function_1
+_end_cleanup_deferral
+_gen_bne
+_emit_jump
+_gen_jump
+_emit_barrier
+_emit_label
+_genrtl_if_stmt
+_expand_stmt
+_prep_stmt
+_genrtl_compound_stmt
+_genrtl_scope_stmt
+_genrtl_expr_stmt_value
+_expand_expr_stmt_value
+_warn_if_unused_value
+_expand_assignment
+_copy_rtx
+_replace_equiv_address
+_update_temp_slot_address
+_rtx_equal_p
+_change_address_1
+_memory_address
+_force_reg
+_machopic_non_lazy_ptr_list_entry
+_set_unique_reg_note
+_find_reg_note
+_mark_reg_pointer
+_store_expr
+_queued_subexp_p
+_free_temp_slots
+_pfe_s_realloc
+_pfe_realloc
+_expand_start_else
+_gen_label_rtx
+_gen_rtx_fmt_iuu00iss
+_genrtl_do_pushlevel
+_expand_cond
+_expand_start_cond
+_gen_sibcall
+_gen_call
+_expand_end_cond
+_compare_constant
+_compare_constant_1
+_safe_from_p
+_expand_binop
+_convert_modes
+_reg_or_arith_cint_operand
+_gen_addsi3
+_add_operand
+_do_compare_and_jump
+_gen_movqi
+_convert_move
+_can_extend_p
+_emit_unop_insn
+_gen_extendqisi2
+_gen_extendqisi2_ppc
+_simplify_binary_operation
+_avoid_constant_pool_reference
+_break_out_memory_refs
+_genrtl_goto_stmt
+_label_rtx
+_expand_goto
+_expand_goto_internal
+_const_str_htab_eq
+_expand_fixup
+_expand_value_return
+_expand_return
+_genrtl_return_stmt
+_obstack_free
+_assign_temp
+_expand_null_return_1
+_clear_pending_stack_adjust
+_expand_function_end
+_finish_expr_for_function
+_in_sequence_p
+_emit_line_note_force
+_expand_eh_return
+_clobber_return_register
+_diddle_return_value
+_do_clobber_return_reg
+_emit_insn_after
+_use_return_register
+_do_use_return_reg
+_expand_fixups
+_fixup_gotos
+_rest_of_compilation
+_reorder_blocks
+_reorder_blocks_0
+_reorder_blocks_1
+_blocks_nreverse
+_purge_hard_subreg_sets
+_open_dump_file
+_optimize_sibling_and_tail_recursive_calls
+_find_exception_handler_labels
+_rebuild_jump_labels
+_init_label_info
+_mark_all_labels
+_mark_jump_label
+_find_unreachable_blocks
+_delete_unreachable_blocks
+_flow_delete_block_noexpunge
+_never_reached_warning
+_next_nonnote_insn
+_delete_insn_chain
+_can_delete_note_p
+_delete_insn
+_remove_insn
+_remove_edge
+_free_edge
+_expunge_block_nocompact
+_tidy_fallthru_edges
+_tidy_fallthru_edge
+_next_real_insn
+_forwarder_block_p
+_update_forwarder_flag
+_try_optimize_cfg
+_active_insn_p
+_simplejump_p
+_hook_void_bool_false
+_try_forward_edges
+_redirect_edge_and_branch
+_try_redirect_by_replacing_jump
+_redirect_edge_succ_nodup
+_redirect_edge_succ
+_flow_delete_block
+_expunge_block
+_onlyjump_p
+_side_effects_p
+_can_fallthru
+_next_active_insn
+_block_label
+_redirect_jump
+_redirect_exp
+_redirect_exp_1
+_validate_change
+_num_validated_changes
+_apply_change_group
+_insn_invalid_p
+_prev_nonnote_insn
+_computed_jump_p
+_computed_jump_p_1
+_returnjump_p
+_for_each_rtx
+_returnjump_p_1
+_branch_comparison_operator
+_merge_blocks
+_tail_recursion_label_p
+_merge_blocks_nomove
+_can_delete_label_p
+_in_expr_list_p
+_remove_node_from_expr_list
+_set_block_for_insn
+_label_is_jump_target_p
+_uses_addressof
+_sequence_uses_addressof
+_free_basic_block_vars
+_clear_edges
+_close_dump_file
+_htab_empty
+_doing_eh
+_emit_initial_value_sets
+_unshare_all_rtl
+_copy_rtx_if_shared
+_unshare_all_decls
+_unshare_all_rtl_1
+_max_reg_num
+_find_basic_blocks
+_count_basic_blocks
+_inside_basic_block_p
+_control_flow_insn_p
+_can_throw_internal
+_compute_bb_for_insn
+_make_edges
+_cached_make_edge
+_make_label_edge
+_try_simplify_condjump
+_any_uncondjump_p
+_pc_set
+_any_condjump_p
+_invert_jump
+_invert_exp
+_invert_exp_1
+_reversed_comparison_code
+_reversed_comparison_code_parts
+_invert_br_probabilities
+_update_br_prob_note
+_find_basic_blocks_1
+_create_basic_block_structure
+_reorder_insns
+_reorder_insns_nobb
+_thread_jump
+_comparison_dominates_p
+_find_if_header
+_find_if_block
+_find_cond_trap
+_block_has_only_trap
+_if_convert
+_process_if_block
+_noce_process_if_block
+_noce_get_condition
+_get_condition
+_canonicalize_condition
+_set_of
+_note_stores
+_set_of_1
+_first_active_insn
+_last_active_insn_p
+_clear_aux_for_blocks
+_free_bb_for_insn
+_delete_null_pointer_checks
+_get_bitmap_width
+_sbitmap_vector_alloc
+_reg_scan_mark_refs
+_reg_scan
+_cse_main
+_init_alias_analysis
+_record_set
+_find_base_value
+_rtx_varies_p
+_single_set_2
+_reg_overlap_mentioned_p
+_ggc_push_context
+_cse_end_of_basic_block
+_cse_basic_block
+_new_basic_block
+_cse_process_notes
+_cse_insn
+_canon_reg
+_fold_rtx
+_canon_hash
+_get_cse_reg_info
+_lookup
+_approx_reg_cost
+_approx_reg_cost_1
+_bitmap_set_bit
+_bitmap_element_allocate
+_bitmap_element_link
+_bitmap_clear
+_preferrable
+_insert_regs
+_make_new_qty
+_rehash_using_reg
+_insert
+_invalidate_from_clobbers
+_invalidate
+_delete_reg_equiv
+_lookup_for_remove
+_make_regs_eqv
+_check_for_label_ref
+_find_best_addr
+_notreg_cost
+_mention_regs
+_lookup_as_function
+_safe_hash
+_equiv_constant
+_asm_noperands
+_cancel_changes
+_exp_equiv_p
+_recog_33
+_mov_to_vrsave_operation
+_load_multiple_operation
+_store_multiple_operation
+_recog_25
+_current_file_function_operand
+_call_operand
+_immediate_operand
+_scratch_operand
+_remove_from_table
+_invalidate_memory
+_invalidate_for_call
+_remove_invalid_refs
+_refers_to_regno_p
+_gen_lowpart_if_possible
+_gen_lowpart_common
+_subreg_lowpart_offset
+_recog_3
+_invalidate_skipped_block
+_invalidate_skipped_set
+_canon_rtx
+_replace_equiv_address_nv
+_check_dependence
+_true_dependence
+_mems_in_disjoint_alias_sets_p
+_alias_sets_conflict_p
+_nonoverlapping_memrefs_p
+_simplify_relational_operation
+_simplify_ternary_operation
+_record_jump_equiv
+_find_comparison_args
+_record_jump_cond
+_get_addr
+_find_base_term
+_base_alias_check
+_memrefs_conflict_p
+_addr_side_effect_eval
+_rtx_equal_for_memref_p
+_aliases_everything_p
+_fixed_scalar_and_varying_struct_p
+_merge_equiv_classes
+_reg_mentioned_p
diff --git a/order-files/cc1obj.order b/order-files/cc1obj.order
new file mode 100644
index 00000000000..730010f4851
--- /dev/null
+++ b/order-files/cc1obj.order
@@ -0,0 +1,2163 @@
+start
+__start
+__dyld_init_check
+dyld_stub_binding_helper
+___darwin_gcc3_preregister_frame_info
+__call_mod_init_funcs
+__dyld_func_lookup
+_main
+_toplev_main
+_hex_init
+_general_init
+_xmalloc_set_program_name
+_diagnostic_initialize
+__obstack_begin
+_xmalloc
+_parse_options_and_default_flags
+_init_reg_sets
+_add_params
+_xrealloc
+_pfe_init
+_read_integral_parameter
+_override_O_option
+_extract_override_options
+_objc_init_options
+_c_common_init_options
+_cpp_create_reader
+_init_library
+_init_trigraph_map
+_xcalloc
+_set_lang
+_deps_init
+_init_line_maps
+__cpp_init_tokenrun
+__cpp_get_buff
+_new_buff
+_pfe_s_malloc
+_pfe_malloc
+_gcc_obstack_init
+_pfe_obstack_chuck_alloc
+__cpp_init_includes
+_splay_tree_new
+_splay_tree_new_with_allocator
+_splay_tree_xmalloc_allocate
+_set_index_lang
+_set_target_switch
+_optimization_options
+_override_option
+_objc_decode_option
+_c_decode_option
+_cpp_handle_option
+_parse_option
+_independent_decode_option
+_new_pending_directive
+_xstrdup
+_append_include_chain
+__cpp_simplify_pathname
+_hmap_load_header_map
+_dump_switch_p
+_decode_f_option
+_decode_g_option
+_set_Wunused
+_set_Wformat
+_decode_W_option
+_output_set_maximum_length
+_set_real_maximum_length
+_output_is_line_wrapping
+_add_env_options
+_objc_post_options
+_c_common_post_options
+_cpp_post_options
+_init_dependency_output
+_do_compile
+_process_options
+_rs6000_override_options
+_rs6000_parse_abi_options
+_rs6000_add_gc_roots
+_ggc_add_rtx_root
+_ggc_add_root
+_htab_create
+_higher_prime_number
+_machopic_add_gc_roots
+_ggc_add_tree_root
+_new_alias_set
+_floor_log2_wide
+_init_timevar
+_timevar_start
+_lang_independent_init
+_init_ggc
+_exact_log2_wide
+_pfe_s_calloc
+_pfe_calloc
+_init_stringpool
+_ht_create
+_init_obstacks
+_ggc_add_deletable_htab
+_init_emit_once
+_mode_for_size
+_gen_rtx
+_rtx_alloc
+_ggc_alloc
+_alloc_page
+_pfe_free
+_set_page_table_entry
+_gen_raw_REG
+_gen_rtx_fmt_i0
+_gen_rtx_fmt_w
+_ereal_atof
+_asctoe53
+_asctoeg
+_ecleaz
+_enormlz
+_eshup6
+_toe53
+_eiisnan
+_eshift
+_eshup1
+_e53toe
+_eshdn1
+_ecleazs
+_emovo
+_emovz
+_eaddm
+_eshup8
+_emdnorm
+_gen_rtx_CONST_INT
+_gen_const_vector_0
+_rtvec_alloc
+_gen_rtx_fmt_E0
+_gen_rtx_REG
+_init_regs
+_init_reg_sets_1
+_reg_class_subset_p
+_init_reg_modes
+_choose_hard_reg_mode
+_init_alias_once
+_init_stmt
+_init_loop
+_address_cost
+_memory_address_p
+_rs6000_legitimate_address
+_init_reload
+_gen_rtx_fmt_ee
+_gen_rtx_MEM
+_gen_rtx_fmt_e0
+_gen_rtx_fmt_s
+_pfe_savestring
+_plus_constant_wide
+_find_constant_term_loc
+_bitmap_initialize
+_init_function_once
+_varray_init
+_init_stor_layout_once
+_init_varasm_once
+_init_EXPR_INSN_LIST_cache
+_init_dummy_function_start
+_prepare_function_start
+_ggc_alloc_cleared
+_init_stmt_for_function
+_init_eh_for_function
+_init_emit
+_clear_emit_caches
+_init_virtual_regs
+_init_expr
+_init_varasm_status
+_init_temp_slots
+_init_pending_stack_adjust
+_rs6000_init_machine_status
+_init_expmed
+_start_sequence
+_rtx_cost
+_emit_insn
+_make_insn_raw
+_add_insn
+_init_recog
+_recog
+_recog_13
+_gpc_reg_operand
+_register_operand
+_recog_4
+_reg_or_cint_operand
+_recog_5
+_nonimmediate_operand
+_general_operand
+_input_operand
+_memory_operand
+_toc_relative_expr_p
+_constant_pool_expr_1
+_reg_or_short_operand
+_short_cint_operand
+_htab_find_slot_with_hash
+_const_int_htab_eq
+_init_expr_once
+_recog_6
+_recog_10
+_recog_9
+_altivec_register_operand
+_zero_constant
+_cc_reg_operand
+_end_sequence
+_init_caller_save
+_strict_memory_address_p
+_recog_memoized_1
+_extract_insn
+_insn_extract
+_constrain_operands
+_reg_fits_class_p
+_boolean_or_operator
+_boolean_operator
+_recog_1
+_reg_or_mem_operand
+_recog_7
+_make_node
+_build_decl
+_builtin_function
+_get_identifier
+_ht_lookup
+_calc_hash
+_alloc_node
+_tree_size
+_make_decl_rtl
+_decode_reg_name
+_darwin_encode_section_info
+_ggc_alloc_string
+_update_stubs
+_pushdecl
+_lookup_name_current_level
+_decl_attributes
+_default_insert_attributes
+_insert_default_attributes
+_c_common_insert_default_attributes
+_builtin_function_2
+_builtin_function_disabled_p
+_set_decl_assembler_name
+_c_common_nodes_and_builtins
+_is_attribute_p
+_list_length
+_handle_format_attribute
+_decode_format_attr
+_decode_format_type
+_chainon
+_lookup_attribute
+_tree_cons
+_build_type_attribute_variant
+_attribute_list_equal
+_attribute_list_contained
+_copy_node
+_set_type_quals
+_attribute_hash_list
+_type_hash_canon
+_type_hash_lookup
+_layout_type
+_htab_find_with_hash
+_type_hash_add
+_build_qualified_type
+_get_qualified_type
+_c_init_decl_processing
+_make_unsigned_type
+_default_set_default_type_attributes
+_fixup_unsigned_type
+_build_int_2_wide
+_tree_int_cst_sgn
+_smallest_mode_for_size
+_size_int_wide
+_size_int_type_wide
+_force_fit_type
+_htab_find_slot
+_size_htab_hash
+_size_htab_eq
+_finalize_type_size
+_get_mode_alignment
+_round_type_align
+_round_up
+_size_binop
+_int_const_binop
+_integer_onep
+_build_function_type
+_type_hash_list
+_type_hash_eq
+_type_list_equal
+__obstack_newchunk
+_start_fname_decls
+_set_dump_tree_p
+_c_objc_common_init
+_c_common_init
+_init_c_lex
+_get_fileinfo
+_splay_tree_lookup
+_splay_tree_splay
+_splay_tree_insert
+_cpp_get_callbacks
+_cpp_read_main_file
+__cpp_init_hashtable
+__cpp_init_directives
+_cpp_lookup
+__cpp_init_internal_pragmas
+_cpp_register_pragma
+_lookup_pragma_entry
+_insert_pragma_entry
+__cpp_aligned_alloc
+_init_standard_includes
+_update_path
+_remove_component_p
+_concat
+_translate_name
+_get_key_value
+_merge_include_chains
+_remove_dup_dirs
+_remove_dup_dir
+__cpp_read_file
+_open_file
+_find_or_create_entry
+_splay_tree_foreach
+_splay_tree_foreach_helper
+_inode_finder
+_stack_include_file
+_read_include_file
+_cpp_push_buffer
+__cpp_do_file_change
+_add_line_map
+_cb_file_change
+_update_header_times
+_extract_interface_info
+_init_pragma
+_add_c_tree_codes
+_ggc_add_tree_varray_root
+_objc_init
+_add_objc_tree_codes
+_init_objc
+_hash_init
+_synth_module_prologue
+_xref_tag
+_lookup_tag
+_pushtag
+_build_pointer_type
+_objc_declare_class
+_is_class_name
+_lookup_interface
+_lookup_name
+_generate_forward_declaration_to_string_table
+_build_nt
+_define_decl
+_start_decl
+_grokdeclarator
+_signed_type
+_signed_or_unsigned_type
+_build_array_type
+_layout_decl
+_c_apply_type_quals_to_decl
+_maybe_apply_pragma_weak
+_finish_decl
+_maybe_apply_renaming_pragma
+_complete_array_type
+_objc_check_decl
+_rest_of_decl_compilation
+_timevar_push
+_timevar_pop
+_get_pending_sizes
+_build_tree_list
+_objc_act_parse_init
+_lang_dependent_init
+_init_asm_output
+_init_eh
+_init_optabs
+_new_optab
+_init_all_optabs
+_init_integral_libfuncs
+_init_libfuncs
+_init_floating_libfuncs
+_init_one_libfunc
+_init_traps
+_push_srcloc
+_dwarf2out_do_frame
+_dbxout_init
+_getdecls
+_getpwd
+_output_quoted_string
+_assemble_name
+_maybe_get_identifier
+_text_section
+_dbxout_typedefs
+_dbxout_symbol
+_compile_file
+_init_final
+_init_branch_prob
+_yyparse
+_dbxout_start_source_file
+_cpp_finish_options
+_init_builtins
+__cpp_define_builtin
+_run_directive
+_start_directive
+_do_define
+_lex_macro_node
+__cpp_lex_token
+__cpp_lex_direct
+_parse_identifier
+__cpp_create_definition
+_skip_whitespace
+_parse_string
+_unescaped_terminator_p
+_alloc_expansion_token
+_lex_expansion_token
+_handle_newline
+_pfe_is_cmd_ln_processing
+_end_directive
+_skip_rest_of_line
+__cpp_pop_buffer
+_parse_number
+_pfe_set_cmd_ln_processing
+_cpp_define
+_warn_of_redefinition
+__cpp_equiv_tokens
+__cpp_free_definition
+_pfe_reset_cmd_ln_processing
+_free_chain
+__cpp_push_next_buffer
+_yyparse_1
+_yylex
+__yylex
+_c_lex
+_cpp_get_token
+_get_effective_char
+_skip_line_comment
+__cpp_handle_directive
+_directive_diagnostics
+_do_import
+_do_include_common
+_parse_include
+_check_eol
+__cpp_execute_include
+_find_include_file
+_hmap_lookup_path
+_splay_tree_splay_helper
+_find_framework_file
+__cpp_never_reread
+_skip_block_comment
+_adjust_column
+_do_ifndef
+_push_conditional
+_do_if
+__cpp_parse_expr
+_lex
+_parse_defined
+_do_else
+_do_endif
+__cpp_pop_file_buffer
+_purge_cache
+_pop_srcloc
+_dbxout_end_source_file
+_cb_line_change
+_yylexname
+_altivec_treat_as_keyword
+_pending_xref_error
+_split_specs_attrs
+_make_pointer_declarator
+_build1
+_first_rtl_op
+_build_type_copy
+_ggc_collect
+_start_struct
+_grokfield
+_finish_struct
+_in_parm_level_p
+_start_record_layout
+_place_field
+_integer_zerop
+_default_ms_bitfield_layout_p
+_normalize_rli
+_normalize_offset
+_compare_tree_int
+_finish_record_layout
+_finalize_record_size
+_convert
+_convert_to_integer
+_fold
+_fold_convert
+_mul_double
+_encode
+_decode
+_rli_size_so_far
+_bit_from_pos
+_rli_size_unit_so_far
+_byte_from_pos
+_compute_record_mode
+_host_integerp
+_bit_position
+_int_bit_position
+_tree_low_cst
+_simple_cst_equal
+_rest_of_type_compilation
+_get_object_reference
+_pushlevel
+_make_binding_level
+_clear_parm_order
+_declare_parm_level
+_push_parm_decl
+_simple_type_promotes_to
+_c_promoting_integer_type_p
+_warn_about_unused_variables
+_poplevel
+_grokparms
+_enter_macro_context
+_push_token_context
+_next_context
+_padding_token
+__cpp_temp_token
+__cpp_pop_context
+_warn_if_shadowing
+_get_parm_info
+_gettags
+_nreverse
+_storedecls
+_parmlist_tags_warning
+_build_decl_attribute_variant
+_gen_aux_info_record
+_c_build_qualified_type
+_parse_params
+_save_parameter
+_do_include
+_search_from
+_lbasename
+___udivmoddi4
+_parse_number
+_do_elif
+___udivdi3
+_skip_escaped_newlines
+_unsigned_type
+__cpp_extend_buff
+_build_index_type
+_build
+_non_lvalue
+_add_double
+_mode_for_size_tree
+_shadow_tag
+_shadow_tag_warned
+_lookup_tag_reverse
+_lex_number
+_build_compound_expr
+_internal_build_compound_expr
+_build_array_declarator
+_set_array_declarator_type
+_constant_expression_warning
+_operand_equal_p
+_tree_int_cst_equal
+_const_binop
+_neg_double
+_trigraph_p
+_build_enumerator
+_default_conversion
+_build_binary_op
+_common_type
+_tree_int_cst_lt
+_type_for_size
+_finish_enum
+_min_precision
+_tree_floor_log2
+_int_fits_type_p
+_start_enum
+_do_undef
+_do_ifdef
+_function_attribute_inlinable_p
+_c_cannot_inline_tree_fn
+_put_pending_sizes
+_walk_tree
+_inline_forbidden_p
+_statement_code_p
+_lhd_tree_inlining_walk_subtrees
+_get_callee_fndecl
+_setjmp_call_p
+_special_function_p
+_inlinable_function_p
+_c_expand_body
+_defer_fn
+_debug_nothing_tree
+_finish_function
+_start_function
+_announce_function
+_store_parm_decls
+_decl_function_context
+_storetags
+_init_function_start
+_objc_printable_name
+_objc_demangle
+_emit_line_note
+_set_file_and_line_for_stmt
+_emit_note
+_aggregate_value_p
+_hard_function_value
+_begin_stmt_tree
+_current_stmt_tree
+_c_begin_compound_stmt
+_build_stmt
+_add_stmt
+_stmts_are_full_exprs_p
+_clear_last_expr
+_add_scope_stmt
+_current_scope_stmt_stack
+_c_begin_if_stmt
+_build_external_ref
+_lookup_objc_ivar
+_assemble_external
+_build_indirect_ref
+_is_public
+_build_component_ref
+_lookup_field
+_truthvalue_conversion
+_convert_to_pointer
+_truth_value_p
+_twoval_comparison_p
+_optimize_bit_field_compare
+_get_inner_reference
+_c_expand_start_cond
+_parser_build_binary_op
+_split_tree
+_unsigned_conversion_warning
+_overflow_warning
+_build_array_ref
+_pointer_int_sum
+_size_in_bytes
+_extract_muldiv
+_c_expand_return
+_convert_for_assignment
+_objc_comptypes
+_build_return_stmt
+_c_finish_then
+_c_expand_end_cond
+_shorten_compare
+_get_narrower
+_invert_tree_comparison
+_fold_range_test
+_make_range
+_fold_truthop
+_merge_type_attributes
+_merge_attributes
+_swap_tree_comparison
+_convert_and_check
+_build_modify_expr
+_c_expand_expr_stmt
+_verify_sequence_points
+_verify_tree
+_warning_candidate_p
+_new_tlist
+_merge_tlist
+_add_tlist
+_warn_for_collisions
+_warn_for_collisions_1
+_require_complete_type
+_lvalue_or_else
+_lvalue_p
+_get_unwidened
+_negate_expr
+_build_function_call
+_decl_target_overloaded_intrinsic_p
+_convert_arguments
+_default_function_array_conversion
+_check_function_format
+_build_unary_op
+_unary_complex_lvalue
+_mark_addressable
+_byte_position
+_staticp
+_kept_level_p
+_lshift_double
+_place_union_field
+_get_inner_array_type
+__cpp_release_buff
+_funlike_invocation_p
+_collect_args
+_replace_args
+_expand_arg
+_push_ptoken_context
+_clear_limbo_values
+_finish_fname_decls
+_finish_stmt_tree
+_free_after_parsing
+_free_stmt_status
+_free_after_compilation
+_free_eh_status
+_free_expr_status
+_free_emit_status
+_free_varasm_status
+_rs6000_free_machine_status
+_tree_inlinable_function_p
+_c_disregard_inline_limits
+_merge_ranges
+_range_binop
+_build_range_check
+_invert_truthvalue
+_put_var_into_stack
+_integer_all_onesp
+_distribute_bit_expr
+_integer_pow2p
+_build_conditional_expr
+_operand_equal_for_comparison_p
+_decl_constant_value_for_broken_optimization
+_decl_constant_value
+_warn_about_long_double
+_duplicate_decls
+_comptypes
+_merge_decl_attributes
+_groktypename
+_c_sizeof
+_default_comp_type_attributes
+_function_types_compatible_p
+_self_promoting_args_p
+_type_lists_compatible_p
+_start_init
+_push_string
+_finish_init
+_store_init_value
+_digest_init
+_add_decl_stmt
+_build_c_cast
+_is_id
+_lex_string
+_build_string
+_combine_strings
+_choose_string_type
+_global_bindings_p
+_htab_expand
+_type_hash_hash
+_find_empty_slot_for_expand
+_get_static_reference
+_start_protocol
+_build_protocol_template
+_lookup_protocol
+_make_tree_vec
+_lookup_and_install_protocols
+_add_protocol
+_check_protocol_recursively
+_build_keyword_decl
+_adjust_type_for_id_default
+_is_objc_type_qualifier
+_build_method_decl
+_build_keyword_selector
+_add_instance_method
+_lookup_method
+_hash_lookup
+_hash_func
+_hash_enter
+_finish_protocol
+_start_class
+_add_class
+_add_class_method
+_finish_class
+_continue_class
+_build_ivar_chain
+_objc_copy_list
+_add_category
+_decode_field_reference
+_get_best_mode
+_comp_proto_with_proto
+_get_arg_type_list
+_groktypename_in_parm_context
+_hash_add_attr
+_add_instance_variable
+_type_for_mode
+_rshift_double
+_constant_boolean_node
+_omit_one_operand
+_unextend
+_make_bit_field_ref
+_all_ones_mask_p
+_do_float_handler
+_set_float_handler
+_parse_float
+_target_isinf
+_eisinf
+_eisnan
+restFP
+_build_real
+_convert_to_real
+_real_onep
+_ereal_cmp
+_ecmp
+_emovi
+_exact_real_inverse
+_ediv
+_eisneg
+_edivm
+_m16m
+_ecmpm
+_esubm
+_real_value_truncate
+_eclear
+_etoe53
+_real_twop
+saveFP
+_lex_charconst
+_cpp_interpret_charconst
+_do_pragma
+_darwin_pragma_options
+_push_field_alignment
+_pop_field_alignment
+_ht_expand
+_redeclaration_error_message
+_build_range_type
+_release_pages
+_ggc_mark_roots
+_ggc_mark_rtx_ptr
+_ggc_set_mark
+_ggc_mark_rtx_children
+_mark_optab
+_mark_ehl_map
+_ggc_mark_hash_table
+_zap_lists
+_ggc_mark_tree_ptr
+_mark_const_str_htab
+_htab_traverse
+_mark_const_hash_entry
+_maybe_mark_struct_function
+_ggc_mark_rtvec_children
+_mark_ident_hash
+_ht_forall
+_mark_ident
+_varray_grow
+_ggc_mark_trees
+_lang_mark_tree
+_c_mark_lang_decl
+_ggc_htab_delete
+_type_hash_marked_p
+_ggc_marked_p
+_type_hash_mark
+_htab_clear_slot
+_sweep_pages
+_c_expand_start_else
+_c_finish_else
+_stabilize_reference
+_stabilize_reference_1
+_c_begin_while_stmt
+_c_finish_while_stmt_cond
+_c_size_in_bytes
+_pedantic_non_lvalue
+_pop_label_level
+_build_message_expr
+_finish_message_expr
+_save_expr
+_contains_placeholder_p
+_lookup_instance_method_static
+_build_selector_reference
+_build_objc_method_call
+_build_selector_reference_decl
+_set_mem_attributes
+_get_alias_set
+_maybe_set_unchanging
+_can_address_p
+_handled_component_p
+_get_mem_attrs
+_mem_attrs_htab_hash
+_update_non_lazy_ptrs
+_pushdecl_top_level
+_comp_target_types
+_get_class_reference
+_build_class_reference_decl
+_receiver_is_class_object
+_lookup_class_method_static
+_initializer_constant_valid_p
+_lhd_return_tree
+_assemble_variable
+_app_disable
+_set_mem_align
+_mem_attrs_htab_eq
+_output_addressed_constants
+_output_constant_def
+_const_hash
+_record_constant
+_record_constant_1
+_set_mem_alias_set
+_output_constant_def_contents
+_cstring_section
+_data_section
+_try_section_alias
+_int_size_in_bytes
+_output_constant
+_assemble_string
+_decode_addr_const
+_objc_constant_string_object_section
+_objc_section_init
+_objc_cat_cls_meth_section
+_objc_cat_inst_meth_section
+_objc_string_object_section
+_cfstring_constant_object_section
+_objc_selector_refs_section
+_objc_selector_fixup_section
+_objc_cls_refs_section
+_objc_class_section
+_objc_meta_class_section
+_objc_cls_meth_section
+_objc_inst_meth_section
+_objc_protocol_section
+_objc_class_names_section
+_objc_meth_var_types_section
+_objc_meth_var_names_section
+_objc_category_section
+_objc_class_vars_section
+_objc_instance_vars_section
+_objc_module_info_section
+_objc_symbols_section
+_output_constructor
+_int_byte_position
+_expand_expr
+_get_subtarget
+_protect_from_queue
+_mark_temp_addr_taken
+_assemble_integer
+_rs6000_assemble_integer
+_find_weak_imports
+_default_assemble_integer
+_integer_asm_op
+_assemble_integer_with_op
+_output_addr_const
+_name_needs_quotes
+_immed_double_const
+_resolve_unique_section
+_variable_section
+_darwin_set_section_for_var_p
+_const_data_section
+_in_text_section
+_machopic_define_name
+_machopic_define_ident
+_machopic_ident_defined_p
+_machopic_classify_ident
+__cpp_backup_tokens
+_build_objc_string_object
+_add_class_reference
+_setup_string_decl
+_build_constructor
+_build_super_template
+_build_private_template
+_build_class_template
+_is_ivar
+_check_duplicates
+_locate_and_pad_parm
+_function_arg_padding
+_function_arg_boundary
+_function_arg_mod_boundary
+_pad_to_arg_alignment
+_assign_parms
+_function_arg_partial_nregs
+_function_arg_skip
+_no_reg_parm_stack_space
+_function_arg_advance
+_promote_mode
+_gen_reg_rtx
+_mark_user_reg
+_validize_mem
+_emit_move_insn
+_emit_move_insn_1
+_gen_movsi
+_rs6000_emit_move
+_gen_sequence
+_pfe_s_realloc
+_pfe_realloc
+_reg_mentioned_p
+_get_last_insn
+_mark_reg_pointer
+_function_arg_pass_by_reference
+_function_arg
+_emit_insns
+_expand_function_start
+_expand_pending_sizes
+_force_next_line_note
+_expand_stmt
+_prep_stmt
+_genrtl_compound_stmt
+_genrtl_scope_stmt
+_expand_start_bindings_and_block
+_push_temp_slots
+_genrtl_decl_stmt
+_anon_aggr_type_p
+_emit_local_var
+_expand_decl
+_expand_decl_init
+_expand_assignment
+_store_expr
+_queued_subexp_p
+_preserve_subexpressions_p
+_expand_call
+_flags_from_decl_or_type
+_init_cumulative_args
+_tree_last
+_rearrange_arg_list
+_initialize_argument_information
+_finalize_must_preallocate
+_any_pending_cleanups
+_function_ok_for_sibcall
+_unsafe_for_reeval
+_c_unsafe_for_reeval
+_assign_temp
+_precompute_arguments
+_calls_function
+_calls_function_1
+_value_member
+_compute_argument_block_size
+_compute_argument_addresses
+_rtx_for_function_call
+_precompute_register_parameters
+_rtx_equal_p
+_preserve_temp_slots
+_pop_temp_slots
+_combine_temp_slots
+_emit_queue
+_copy_rtx
+_replace_equiv_address
+_update_temp_slot_address
+_change_address_1
+_memory_address
+_force_reg
+_easy_fp_constant
+_gen_rtx_fmt_e
+_rs6000_machopic_legitimize_pic_address
+_machopic_legitimize_pic_address
+_machopic_indirect_data_reference
+_machopic_data_defined_p
+_machopic_function_base_name
+_gen_rtx_fmt_E
+_set_unique_reg_note
+_find_reg_note
+_find_temp_slot_from_address
+_copy_to_mode_reg
+_save_fixed_argument_area
+_prepare_call_address
+_lookup_static_chain
+_load_register_parameters
+_use_reg
+_trunc_int_for_mode
+_num_insns_constant
+_num_insns_constant_wide
+_emit_call_1
+_gen_call_value
+_machopic_indirect_call_target
+_machopic_name_defined_p
+_machopic_stub_list_entry
+_gen_rtx_fmt_0
+_gen_rtvec
+_gen_rtvec_v
+_emit_call_insn
+_make_call_insn_raw
+_get_insns
+_expand_start_target_temps
+_do_pending_stack_adjust
+_sbitmap_alloc
+_sbitmap_zero
+_gen_lowpart_SUBREG
+_subreg_lowpart_offset
+_gen_rtx_SUBREG
+_gen_rtx_fmt_ei
+_convert_modes
+_gen_lowpart
+_gen_lowpart_common
+_simplify_gen_subreg
+_simplify_subreg
+_gen_sibcall_value
+_gen_rtx_fmt_
+_emit_barrier_after
+_add_insn_after
+_expand_end_target_temps
+_expand_end_bindings
+_do_jump
+_can_compare_p
+_do_compare_and_jump
+_copy_to_reg
+_gen_rtx_fmt_uuuu
+_do_compare_rtx_and_jump
+_reverse_condition
+_swap_commutative_operands_p
+_commutative_operand_precedence
+_force_not_mem
+_emit_cmp_and_jump_insns
+_unsigned_condition
+_prepare_cmp_insn
+_emit_cmp_and_jump_insn_1
+_prepare_operand
+_gen_cmpsi
+_gen_bne
+_rs6000_emit_cbranch
+_rs6000_generate_compare
+_validate_condition_mode
+_gen_rtx_fmt_u00
+_gen_rtx_fmt_eee
+_emit_jump_insn
+_make_jump_insn_raw
+_genrtl_if_stmt
+_genrtl_expr_stmt_value
+_expand_expr_stmt_value
+_warn_if_unused_value
+_gen_call
+_free_temp_slots
+_expand_end_cond
+_emit_label
+_gen_sibcall
+_genrtl_return_stmt
+_expand_return
+_expand_value_return
+_expand_null_return_1
+_clear_pending_stack_adjust
+_expand_goto_internal
+_expand_fixup
+_emit_jump
+_gen_jump
+_emit_barrier
+_objc_expand_function_end
+_encode_method_prototype
+_encode_type_qualifiers
+_encode_type
+_encode_pointer
+_forwarding_offset
+_apply_args_register_offset
+_apply_args_size
+_encode_aggregate
+_expand_function_end
+_finish_expr_for_function
+_in_sequence_p
+_emit_line_note_force
+_expand_eh_return
+_clobber_return_register
+_diddle_return_value
+_do_clobber_return_reg
+_emit_insn_after
+_use_return_register
+_do_use_return_reg
+_expand_fixups
+_fixup_gotos
+_rest_of_compilation
+_reorder_blocks
+_reorder_blocks_0
+_reorder_blocks_1
+_blocks_nreverse
+_reorder_fix_fragments
+_pfe_varray_free
+_init_flow
+_open_dump_file
+_convert_from_eh_region_ranges
+_collect_eh_region_array
+_resolve_fixup_regions
+_convert_from_eh_region_ranges_1
+_remove_fixup_regions
+_remove_unreachable_regions
+_get_max_uid
+_remove_unnecessary_notes
+_remove_insn
+_alloc_INSN_LIST
+_gen_rtx_fmt_ue
+_free_INSN_LIST_node
+_init_function_for_compilation
+_purge_hard_subreg_sets
+_optimize_sibling_and_tail_recursive_calls
+_find_exception_handler_labels
+_rebuild_jump_labels
+_init_label_info
+_mark_all_labels
+_mark_jump_label
+_cse_basic_block
+_new_basic_block
+_any_uncondjump_p
+_pc_set
+_cse_process_notes
+_cse_insn
+_canon_reg
+_apply_change_group
+_fold_rtx
+_canon_hash
+_get_cse_reg_info
+_lookup
+_approx_reg_cost
+_for_each_rtx
+_approx_reg_cost_1
+_bitmap_set_bit
+_bitmap_element_allocate
+_bitmap_element_link
+_bitmap_clear
+_preferrable
+_validate_change
+_insert_regs
+_make_new_qty
+_rehash_using_reg
+_insert
+_invalidate_from_clobbers
+_invalidate
+_delete_reg_equiv
+_lookup_for_remove
+_make_regs_eqv
+_check_for_label_ref
+_lookup_as_function
+_safe_hash
+_exp_equiv_p
+_equiv_constant
+_simplify_binary_operation
+_avoid_constant_pool_reference
+_notreg_cost
+_insn_invalid_p
+_asm_noperands
+_cancel_changes
+_mention_regs
+_remove_invalid_refs
+_refers_to_regno_p
+_remove_from_table
+_gen_lowpart_if_possible
+_find_best_addr
+_recog_33
+_mov_to_vrsave_operation
+_load_multiple_operation
+_store_multiple_operation
+_recog_25
+_current_file_function_operand
+_call_operand
+_immediate_operand
+_scratch_operand
+_invalidate_memory
+_invalidate_for_call
+_recog_3
+_invalidate_skipped_block
+_note_stores
+_invalidate_skipped_set
+_cse_main
+_cse_end_of_basic_block
+_next_real_insn
+_prev_nonnote_insn
+_ggc_pop_context
+_end_alias_analysis
+_ggc_del_root
+_max_reg_num
+_find_basic_blocks
+_clear_edges
+_free_edge
+_count_basic_blocks
+_inside_basic_block_p
+_control_flow_insn_p
+_can_throw_internal
+_find_basic_blocks_1
+_create_basic_block_structure
+_compute_bb_for_insn
+_make_edges
+_cached_make_edge
+_computed_jump_p
+_computed_jump_p_1
+_returnjump_p
+_returnjump_p_1
+_make_label_edge
+_next_nonnote_insn
+_make_eh_edge
+_reachable_handlers
+_free_INSN_LIST_list
+_tidy_fallthru_edges
+_tidy_fallthru_edge
+_cleanup_cfg
+_delete_unreachable_blocks
+_find_unreachable_blocks
+_try_optimize_cfg
+_update_forwarder_flag
+_forwarder_block_p
+_active_insn_p
+_hook_void_bool_false
+_try_simplify_condjump
+_any_condjump_p
+_try_forward_edges
+_onlyjump_p
+_free_EXPR_LIST_list
+_free_bb_for_insn
+_delete_trivially_dead_insns
+_count_reg_usage
+_side_effects_p
+_canonicalize_condition
+_set_of
+_set_of_1
+_delete_null_pointer_checks
+_delete_null_pointer_checks_1
+_sbitmap_vector_zero
+_invalidate_nonnull_info
+_single_set_2
+_compute_available
+_sbitmap_vector_ones
+_sbitmap_ones
+_sbitmap_union_of_diff
+_sbitmap_intersection_of_preds
+_sbitmap_copy
+_clear_aux_for_edges
+_clear_aux_for_blocks
+_renumber_insns
+_close_dump_file
+_purge_addressof
+_hash_table_init
+_hash_table_init_n
+_compute_insns_for_mem
+_insns_for_mem_walk
+_hash_lookup
+_insns_for_mem_hash
+_compute_hash_table
+_record_last_reg_set_info
+_mark_call
+_record_last_mem_set_info
+_record_last_set_info
+_hash_scan_insn
+_hash_scan_set
+_find_reg_equal_equiv_note
+_oprs_available_p
+_oprs_unchanged_p
+_insert_set_in_table
+_hash_set
+_gcse_alloc
+_hash_scan_call
+_hash_scan_clobber
+_expr_equiv_p
+_one_cprop_pass
+_alloc_cprop_mem
+_sbitmap_vector_alloc
+_compute_cprop_data
+_compute_local_properties
+_compute_transp
+_cprop
+_reset_opr_set_tables
+_clear_modify_mem_tables
+_free_list
+_cprop_insn
+_note_uses
+_find_used_regs
+_mark_oprs_set
+_oprs_not_set_p
+_bitmap_bit_p
+_find_avail_set
+_lookup_set
+_mark_set
+_mark_clobber
+_free_cprop_mem
+_free_set_hash_table
+_gcse_main
+_free_gcse_mem
+_free_modify_mem_tables
+_alloc_gcse_mem
+_gmalloc
+_one_classic_gcse_pass
+_alloc_expr_hash_table
+_alloc_rd_mem
+_compute_expr_hash_table
+_want_to_gcse_p
+_set_noop_p
+_oprs_anticipatable_p
+_insert_expr_in_table
+_hash_expr
+_hash_expr_1
+_load_killed_in_block_p
+_find_comparison_args
+_comparison_dominates_p
+_simplify_relational_operation
+_simplify_ternary_operation
+_record_jump_equiv
+_reversed_comparison_code_parts
+_record_jump_cond
+_merge_equiv_classes
+_check_function_return_warnings
+_mark_constant_function
+_mark_dfs_back_edges
+_init_alias_analysis
+_record_set
+_find_base_value
+_rtx_varies_p
+_nonlocal_mentioned_p
+_flow_loops_find
+_calculate_dominance_info
+_init_dom_info
+_calc_dfs_tree
+_calc_dfs_tree_nonrec
+_calc_idoms
+_link_roots
+_idoms_to_doms
+_free_dom_info
+_flow_loops_tree_build
+_flow_loops_level_compute
+_estimate_probability
+_predict_edge_def
+_predict_edge
+_predict_insn
+_get_condition
+_predict_insn_def
+_combine_predictions_for_insn
+_dump_prediction
+_estimate_bb_frequencies
+_alloc_aux_for_blocks
+_alloc_aux_for_block
+_alloc_aux_for_edges
+_alloc_aux_for_edge
+_estimate_loops_at_level
+_propagate_freq
+_free_aux_for_blocks
+_free_aux_for_edges
+_flow_loops_free
+_life_analysis
+_allocate_reg_life_data
+_allocate_reg_info
+_allocate_bb_life_data
+_mark_regs_live_at_end
+_mark_reg
+_update_life_info
+_clear_log_links
+_calculate_global_regs_live
+_bitmap_operation
+_bitmap_copy
+_propagate_block
+_init_propagate_block_info
+_propagate_one_insn
+_insn_dead_p
+_mark_set_regs
+_mark_used_regs
+_mark_used_reg
+_volatile_refs_p
+_mark_set_1
+_invalidate_mems_from_set
+_bitmap_clear_bit
+_invalidate_mems_from_autoinc
+_free_propagate_block_info
+_bitmap_equal_p
+_sched_analyze
+_add_dependence_list_and_free
+_add_dependence
+_sched_analyze_insn
+_sched_analyze_1
+_sched_analyze_2
+_read_dependence
+_add_insn_mem_dependence
+_alloc_EXPR_LIST
+_add_dependence_list
+_flush_pending_lists
+_compute_jump_reg_dependencies
+_get_condition
+_compute_block_backward_dependences
+_add_branch_dependences
+_sets_likely_spilled
+_sets_likely_spilled_1
+_free_deps
+_schedule_region
+_get_block_head_tail
+_compute_forward_dependences
+_group_leader
+_set_priorities
+_priority
+_insn_cost
+_result_ready_cost
+_contributes_to_priority
+_rs6000_adjust_cost
+_get_attr_type
+_extract_constrain_insn_cached
+_extract_insn_cached
+_regclass
+_secondary_reload_class
+_scan_one_insn
+_record_operand_costs
+_record_reg_classes
+_find_regno_note
+_copy_cost
+_local_alloc
+_update_equiv_regs
+_reg_preferred_class
+_equiv_init_movable_p
+_equiv_init_varies_p
+_no_equiv
+_block_alloc
+_requires_inout
+_get_hard_reg_initial_reg
+_combine_regs
+_reg_is_born
+_alloc_qty
+_reg_alternate_class
+_wipe_dead_reg
+_mark_life
+_reg_is_set
+_multiple_sets
+_qty_sugg_compare_1
+_find_free_reg
+_post_mark_life
+_qty_compare_1
+_reg_set_to_hard_reg_set
+_qty_sugg_compare
+_qty_compare
+_global_alloc
+_global_conflicts
+_record_conflicts
+_mark_reg_clobber
+_mark_reg_death
+_mark_reg_store
+_set_preference
+_record_one_conflict
+_expand_preferences
+_allocno_compare
+_prune_preferences
+_find_reg
+_build_insn_chain
+_new_insn_chain
+_reg_dies
+_reg_becomes_live
+_reload
+_clear_secondary_mem
+_init_save_areas
+_mark_home_live
+_scan_paradoxical_subregs
+_function_invariant_p
+_init_elim_table
+_max_label_num
+_get_first_label_num
+_alter_reg
+_mark_not_eliminable
+_maybe_fix_stack_asms
+_finish_spills
+_rs6000_stack_info
+_first_reg_to_save
+_first_fp_reg_to_save
+_first_altivec_reg_to_save
+_rs6000_ra_ever_killed
+_push_topmost_sequence
+_pop_topmost_sequence
+_reg_overlap_mentioned_p
+_get_frame_size
+_get_func_frame_size
+_set_initial_elim_offsets
+_set_initial_label_offsets
+_calculate_needs_all_insns
+_set_label_offsets
+_eliminate_regs_in_insn
+_elimination_effects
+_eliminate_regs
+_check_eliminable_occurrences
+_find_reloads
+_update_eliminable_offsets
+_combine_reloads
+_operands_match_p
+_emit_reload_insns
+_emit_insns_before
+_emit_insns_after
+_reload_reg_reaches_end_p
+_reload_as_needed
+_subst_reloads
+_forget_old_reloads_1
+_push_reload
+_reload_inner_reg_of_subreg
+_find_reusable_reload
+_earlyclobber_operand_p
+_choose_reload_regs
+_choose_reload_regs_init
+_compute_use_by_pseudos
+_allocate_reload_reg
+_reload_reg_free_p
+_set_reload_reg
+_true_regnum
+_mark_reload_reg_in_use
+_do_input_reload
+_do_output_reload
+_set_offsets_for_label
+_verify_initial_elim_offsets
+_cleanup_subreg_operands
+_add_auto_inc_notes
+_auto_inc_p
+_replace_pseudos_in_call_usage
+_obstack_free
+_fixup_abnormal_edges
+_unshare_all_rtl_again
+_reset_used_flags
+_reset_used_decls
+_unshare_all_rtl
+_copy_rtx_if_shared
+_unshare_all_decls
+_unshare_all_rtl_1
+_reload_cse_regs
+_reload_cse_regs_1
+_cselib_init
+_clear_table
+_htab_empty
+_prologue_epilogue_contains
+_contains
+_cselib_process_insn
+_reload_cse_simplify
+_reload_cse_simplify_set
+_reload_cse_noop_set_p
+_rtx_equal_for_cselib_p
+_cselib_lookup
+_reload_cse_simplify_operands
+_cselib_record_sets
+_new_cselib_val
+_new_elt_loc_list
+_new_elt_list
+_cselib_invalidate_rtx
+_cselib_invalidate_regno
+_push_operand
+_cselib_record_set
+_hash_rtx
+_wrap_constant
+_cselib_subst_to_values
+_shallow_copy_rtx
+_cselib_lookup_mem
+_add_mem_for_addr
+_replace_equiv_address_nv
+_unchain_one_elt_list
+_unchain_one_elt_loc_list
+_entry_and_rtx_equal_p
+_cselib_invalidate_mem
+_cselib_invalidate_mem_1
+_cselib_mem_conflict_p
+_cselib_finish
+_htab_delete
+_reload_combine
+_reload_combine_note_use
+_reload_combine_note_store
+_get_value_hash
+_if_convert
+_find_if_header
+_find_if_block
+_process_if_block
+_find_cond_trap
+_block_has_only_trap
+_find_if_case_1
+_find_if_case_2
+_split_all_insns
+_split_insn
+_try_split
+_split_insns
+_const_int_operand
+_non_add_cint_operand
+_split_11
+_split_7
+_equality_operator
+_vector_comparison_operator
+_schedule_insns
+_scope_to_insns_initialize
+_delete_insn
+_sched_init
+_rs6000_issue_rate
+_init_dependency_caches
+_rtx_equal_for_memref_p
+_memrefs_conflict_p
+_canon_rtx
+_addr_side_effect_eval
+_write_dependence_p
+_output_dependence
+_mems_in_disjoint_alias_sets_p
+_alias_sets_conflict_p
+_nonoverlapping_memrefs_p
+_get_addr
+_base_alias_check
+_find_base_term
+_true_dependence
+_lsu_unit_blockage
+_actual_hazard
+_schedule_block
+_schedule_more_p
+_iu2_unit_blockage
+_can_schedule_ready_p
+_move_insn
+_move_insn1
+_reemit_notes
+_schedule_insn
+_new_ready
+_rs6000_adjust_priority
+_queue_to_ready
+_rank_for_schedule
+_function_units_used
+_rgn_rank
+_find_insn_list
+_no_real_insns_p
+_save_line_notes
+_rm_line_notes
+_rm_other_notes
+_clear_units
+_init_ready_list
+_ready_add
+_verify_local_live_at_start
+_reposition_prologue_and_epilogue_notes
+_reorder_insns
+_reorder_insns_nobb
+_set_block_for_insn
+_rm_redundant_line_notes
+_scope_to_insns_finalize
+_set_block_levels
+_change_scope
+_emit_note_before
+_add_insn_before
+_sched_finish
+_free_dependency_caches
+_add_noreturn_fake_exit_edges
+_try_crossjump_bb
+_try_crossjump_to_edge
+_outgoing_edges_match
+_remove_fake_edges
+_remove_fake_successors
+_compute_alignments
+_purge_line_number_notes
+_cleanup_barriers
+_split_all_insns_noflow
+_convert_to_eh_region_ranges
+_shorten_branches
+_insn_default_length
+_insn_variable_length_p
+_dwarf2out_begin_prologue
+_final_start_function
+_number_blocks
+_get_block_vector
+_all_blocks
+_rs6000_output_function_prologue
+_final
+_final_scan_insn
+_debug_nothing_int
+_peephole
+_scc_comparison_operator
+_constrain_operands_cached
+_get_insn_template
+_output_asm_insn
+_output_operand
+_print_operand
+_notice_source_line
+_dbxout_source_line
+_dbxout_source_file
+_dbxout_begin_block
+_simplify_subtraction
+_decode_rtx_const
+_walk_alter_subreg
+_output_address
+_print_operand_address
+_no_asm_to_stream
+_profile_after_prologue
+_output_406
+_machopic_validate_stub_or_non_lazy_ptr
+_output_405
+_output_541
+_output_cbranch
+_get_attr_length
+_output_asm_label
+_dbxout_end_block
+_final_end_function
+_rs6000_output_function_epilogue
+_output_compiler_stub
+_debug_nothing_void
+_assemble_end_function
+_output_after_function_constants
+_output_function_exception_table
+_free_basic_block_vars
+_regset_release_memory
+_bitmap_release_memory
+_dbxout_function_decl
+_dbxout_begin_function
+_dbxout_prepare_symbol
+_dbxout_type
+_dbxout_type_index
+_dbxout_queue_symbol
+_dbxout_type_name
+_dbxout_finish_symbol
+_dbxout_flush_symbol_queue
+_print_wide_int
+_dbxout_type_fields
+_print_int_cst_octal
+_print_octal
+_finish_method_def
+_optimize_inline_calls
+_lhd_tree_inlining_add_pending_fn_decls
+_expand_calls_inline
+_htab_find
+_hash_pointer
+_expand_call_inline
+_lhd_tree_inlining_tree_chain_matters_p
+_eq_pointer
+_init_recog_no_volatile
+_gen_label_rtx
+_gen_rtx_fmt_iuu00iss
+_genrtl_for_stmt
+_emit_nop
+_expand_start_loop_continue_elsewhere
+_expand_start_loop
+_genrtl_do_pushlevel
+_expand_cond
+_expand_exit_loop_top_cond
+_expand_exit_loop_if_false
+_gen_blt
+_expand_start_cond
+_gen_beq
+_expand_binop
+_reg_or_arith_cint_operand
+_gen_addsi3
+_add_operand
+_expand_increment
+_expand_end_loop
+_emit_label_before
+_emit_jump_insn_before
+_emit_barrier_before
+_maybe_remove_eh_handler
+_flow_delete_block_noexpunge
+_delete_insn_chain
+_can_delete_label_p
+_in_expr_list_p
+_remove_node_from_expr_list
+_can_delete_note_p
+_remove_edge
+_flow_delete_block
+_expunge_block
+_expunge_block_nocompact
+_redirect_edge_and_branch
+_try_redirect_by_replacing_jump
+_can_fallthru
+_next_active_insn
+_simplejump_p
+_never_reached_warning
+_ehl_hash
+_block_label
+_redirect_jump
+_redirect_exp
+_redirect_exp_1
+_num_validated_changes
+_branch_comparison_operator
+_redirect_edge_succ_nodup
+_redirect_edge_succ
+_merge_blocks
+_tail_recursion_label_p
+_sequence_uses_addressof
+_uses_addressof
+_replace_call_placeholder
+_call_ends_block_p
+_skip_copy_to_return_value
+_identify_call_return_value
+_skip_stack_adjustment
+_skip_pic_restore
+_reg_set_between_p
+_purge_reg_equiv_notes
+_remove_note
+_purge_mem_unchanging_flag
+_purge_addressof_1
+_hash_table_free
+_alloc_reg_set_mem
+_compute_sets
+_record_set_info
+_record_one_set
+_alloc_set_hash_table
+_compute_set_hash_table
+_compute_kill_rd
+_compute_rd
+_sbitmap_union_of_preds
+_alloc_avail_expr_mem
+_compute_ae_gen
+_compute_ae_kill
+_expr_killed_p
+_classic_gcse
+_lookup_expr
+_free_avail_expr_mem
+_free_rd_mem
+_free_expr_hash_table
+_one_code_hoisting_pass
+_cse_around_loop
+_cse_set_around_loop
+_addr_affects_sp_p
+_find_and_verify_loops
+_compute_luids
+_for_each_eh_label
+_mark_loop_jump
+_loop_optimize
+_reg_scan
+_reg_scan_mark_refs
+_find_single_use_in_loop
+_loop_regs_scan
+_count_one_set
+_reg_used_between_p
+_find_reg_fusage
+_find_regno_fusage
+_scan_loop
+_count_insns_in_loop
+_next_insn_in_loop
+_reg_in_basic_block_p
+_loop_invariant_p
+_consec_sets_invariant_p
+_loop_movables_add
+_skip_consec_insns
+_modified_between_p
+_reg_set_p
+_no_labels_between_p
+_may_trap_p
+_rtx_addr_can_trap_p
+_loop_reg_used_before_p
+_ignore_some_movables
+_force_movables
+_combine_movables
+_load_mems
+_reg_scan_update
+_strength_reduce
+_loop_bivs_find
+_for_each_insn_in_loop
+_check_insn_for_bivs
+_basic_induction_var
+_record_biv
+_loop_bivs_init_find
+_record_initial
+_get_condition_for_loop
+_valid_initial_value_p
+_loop_bivs_check
+_loop_givs_find
+_check_insn_for_givs
+_find_mem_givs
+_update_giv_derive
+_general_induction_var
+_simplify_giv_expr
+_loop_iterations
+_biv_total_increment
+_fold_rtx_mult_add
+_loop_find_equiv_value
+_find_common_reg_term
+_loop_givs_check
+_check_dbra_loop
+_count_nonfixed_reads
+_loop_biv_eliminable_p
+_maybe_eliminate_biv
+_maybe_eliminate_biv_1
+_check_ext_dependent_givs
+_combine_givs
+_loop_givs_dead_check
+_loop_givs_reduce
+_loop_givs_rescan
+_replace_regs
+_loop_ivs_free
+_loop_movables_free
+_ggc_push_context
+_regclass_init
+_thread_jump
+_reversed_comparison_code
+_compress
+_flow_depth_first_order_compute
+_flow_loop_nodes_find
+_sbitmap_first_set_bit
+_sbitmap_last_set_bit
+_flow_loop_scan
+_flow_loop_level_compute
+_flow_loop_exit_edges_find
+_find_auto_inc
+_delete_dead_jumptables
+_uninitialized_vars_warning
+_regno_uninitialized
+_initialize_uninitialized_subregs
+_combine_instructions
+_init_reg_last_arrays
+_setup_incoming_promotions
+_promoted_input_arg
+_record_value_for_reg
+_update_table_tick
+_get_last_value_validate
+_nonzero_bits
+_num_sign_bit_copies
+_set_nonzero_bits_and_sign_copies
+_expand_field_assignment
+_get_last_value
+_record_dead_and_set_regs
+_record_dead_and_set_regs_1
+_replace_rtx
+_recog_15
+_recog_21
+_recog_16
+_recog_17
+_recog_19
+_recog_31
+_recog_28
+_recog_26
+_stmw_operation
+_mtcrf_operation
+_lmw_operation
+_vrsave_operation
+_recog_for_combine
+_check_asm_operands
+_do_SUBST_INT
+_try_combine
+_undo_all
+_cant_combine_insn_p
+_can_combine_p
+_combinable_i3pat
+_do_SUBST
+_reg_referenced_p
+_dead_or_set_p
+_dead_or_set_regno_p
+_subst
+_combine_simplify_rtx
+_simplify_set
+_find_single_use
+_find_single_use_1
+_simplify_comparison
+_swap_condition
+_make_compound_operation
+_make_field_assignment
+_mark_used_regs_combine
+_use_crosses_set_p
+_volatile_insn_p
+_force_to_mode
+_recog_22
+_recog_23
+_any_operand
+_check_promoted_subreg
+_if_then_else_cond
+_simplify_if_then_else
+_combine_reversed_comparison_code
+_recog_30
+_contains_muldiv
+_apply_distributive_law
+_have_insn_for
+_move_deaths
+_restore_line_notes
+_free_pending_lists
+_finish_deps_global
+_init_deps_global
+_init_deps
+_unlink_line_notes
+_unlink_other_notes
+_leaf_function_p
+_allocate_initial_values
+_record_address_regs
+_assign_stack_local
+_assign_stack_local_1
+_find_reloads_address
+_regno_clobbered_p
+_copy_reloads
+_condjump_p
+_thread_prologue_and_epilogue_insns
+_gen_prologue
+_rs6000_emit_prologue
+_try_leaf_pic_optimization
+_name_encodes_objc_method_p
+_rs6000_frame_related
+_simplify_rtx
+_rs6000_maybe_dead
+_rs6000_emit_allocate_stack
+_gen_movsi_update
+_record_insns
+_insert_insn_on_edge
+_direct_return
+_gen_epilogue
+_rs6000_emit_epilogue
+_commit_edge_insertions
+_commit_one_edge_insertion
+_find_sub_basic_blocks
+_find_bb_boundaries
+_purge_dead_edges
+_compute_outgoing_frequencies
+___divdi3
+___udivmoddi4
+_gen_sibcall_epilogue
+_emit_insn_before
+_insns_match_p
+_copyprop_hardreg_forward
+_init_value_data
+_copyprop_hardreg_forward_1
+_preprocess_constraints
+_kill_clobbered_value
+_kill_autoinc_value
+_replace_oldest_value_reg
+_find_oldest_value_reg
+_kill_set_value
+_kill_value
+_kill_value_regno
+_set_value_regno
+_copy_value
+_replace_oldest_value_mem
+_replace_oldest_value_addr
+_recog_20
+_delete_noop_moves
+_noop_move_p
+_find_insn_reg_weight
+_init_regions
+_find_single_block_region
+_count_or_remove_death_notes
+_free_EXPR_LIST_node
+_assemble_start_function
+_output_408
+_purge_all_dead_edges
+_notice_stack_pointer_modification
+_notice_stack_pointer_modification_1
+_distribute_notes
+_reg_bitfield_target_p
+_distribute_links
+_undo_commit
+_remove_death
+_emit_note_after
+_reload_cse_delete_noop_set
+_references_value_p
+_reload_cse_move2add
+_move2add_note_store
+_sext_for_mode
+_start_method_def
+_synth_self_and_ucmd_args
+_handle_unused_attribute
+_expr_last
+_continue_method_def
+_really_start_method
+_lookup_method_in_protocol_list
+_find_label_refs
+_alloc_block
+_merge_blocks_nomove
+_skip_use_of_return_value
+_skip_unreturned_value
+_skip_jump_insn
+_doing_eh
+_emit_initial_value_sets
+_instantiate_virtual_regs
+_instantiate_decls
+_instantiate_decl
+_instantiate_decls_1
+_instantiate_virtual_regs_1
+_instantiate_new_reg
+_output_407
+_dbxout_parms
+_dbxout_block
+_dbxout_syms
+_dbxout_reg_parms
+_dbxout_symbol_location
+_dbxout_function_end
+_init_insn_lengths
+_clear_const_double_mem
+_expected_value_to_br_prob
+_prev_real_insn
+_insn_live_p
+_set_live_p
+_regmove_optimize
+_discover_flags_reg
+_gen_add3_insn
+_mark_flags_life_zones
+_find_matches
+_validate_replace_rtx
+_validate_replace_rtx_1
+_mirror_conflicts
+_nothrow_function_p
+_output_constant_pool
+_mark_constant_pool
+_htab_elements
+_function_section
+_unsave_expr
+_expand_start_else
+_machopic_non_lazy_ptr_list_entry
+_start_cleanup_deferral
+_end_cleanup_deferral
+_expand_loop_continue_here
+_genrtl_expr_stmt
+_delete_related_insns
+_canon_list_insert
+_mems_conflict_for_gcse_p
+_try_replace_reg
+_validate_replace_src
+_validate_replace_src_1
+_simplify_replace_rtx
+_try_pre_increment_1
+_try_pre_increment
+_find_use_as_address
+_split_2
+_cc_reg_not_cr0_operand
+_split_3
+_split_4
+_split_6
+_non_short_cint_operand
+_add_to_mem_set_list
+_comp_method_with_proto
+_force_operand
+_unsave_expr_now
+_unsave_expr_now_r
+_unsave_expr_1
+_duplicate_loop_exit_test
+_copy_loop_headers
+_invert_jump
+_invert_exp
+_invert_exp_1
+_invert_br_probabilities
+_update_br_prob_note
+_label_is_jump_target_p
+_get_bitmap_width
+_indirect_jump_in_function_p
+_prescan_loop
+_note_addr_stored
+_set_sched_group_p
+_remove_dependence
diff --git a/order-files/cc1objplus.order b/order-files/cc1objplus.order
new file mode 100644
index 00000000000..380a0e211c1
--- /dev/null
+++ b/order-files/cc1objplus.order
@@ -0,0 +1,952 @@
+start
+__start
+__dyld_init_check
+dyld_stub_binding_helper
+___darwin_gcc3_preregister_frame_info
+__call_mod_init_funcs
+__dyld_func_lookup
+_main
+_toplev_main
+_hex_init
+_general_init
+_xmalloc_set_program_name
+_diagnostic_initialize
+__obstack_begin
+_xmalloc
+_parse_options_and_default_flags
+_init_reg_sets
+_add_params
+_xrealloc
+_pfe_init
+_read_integral_parameter
+_override_O_option
+_extract_override_options
+_objc_init_options
+_cxx_init_options
+_c_common_init_options
+_cpp_create_reader
+_init_library
+_init_trigraph_map
+_xcalloc
+_set_lang
+_deps_init
+_init_line_maps
+__cpp_init_tokenrun
+__cpp_get_buff
+_new_buff
+_pfe_s_malloc
+_pfe_malloc
+_gcc_obstack_init
+_pfe_obstack_chuck_alloc
+__cpp_init_includes
+_splay_tree_new
+_splay_tree_new_with_allocator
+_splay_tree_xmalloc_allocate
+_set_index_lang
+_set_target_switch
+_optimization_options
+_override_option
+_objc_decode_option
+_cxx_decode_option
+_cpp_handle_option
+_parse_option
+_xstrdup
+_append_include_chain
+__cpp_simplify_pathname
+_independent_decode_option
+_new_pending_directive
+_hmap_load_header_map
+_decode_W_option
+_set_Wunused
+_compare_options
+_dump_switch_p
+_decode_f_option
+_output_set_maximum_length
+_set_real_maximum_length
+_output_is_line_wrapping
+_add_env_options
+_objc_post_options
+_c_common_post_options
+_cpp_post_options
+_init_dependency_output
+_do_compile
+_process_options
+_rs6000_override_options
+_rs6000_parse_abi_options
+_rs6000_add_gc_roots
+_ggc_add_rtx_root
+_ggc_add_root
+_htab_create
+_higher_prime_number
+_machopic_add_gc_roots
+_ggc_add_tree_root
+_new_alias_set
+_floor_log2_wide
+_init_timevar
+_timevar_start
+_lang_independent_init
+_init_ggc
+_exact_log2_wide
+_pfe_s_calloc
+_pfe_calloc
+_init_stringpool
+_ht_create
+_init_obstacks
+_ggc_add_deletable_htab
+_init_emit_once
+_mode_for_size
+_gen_rtx
+_rtx_alloc
+_ggc_alloc
+_alloc_page
+_pfe_free
+_set_page_table_entry
+_gen_raw_REG
+_gen_rtx_fmt_i0
+_gen_rtx_fmt_w
+_ereal_atof
+_asctoe53
+_asctoeg
+_ecleaz
+_enormlz
+_eshup6
+_toe53
+_eiisnan
+_eshift
+_eshup1
+_e53toe
+_eshdn1
+_ecleazs
+_emovo
+_emovz
+_eaddm
+_eshup8
+_emdnorm
+_init_reg_sets_1
+_reg_class_subset_p
+_init_regs
+_init_reg_modes
+_choose_hard_reg_mode
+_recog_13
+_nonimmediate_operand
+_general_operand
+_input_operand
+_memory_operand
+_register_operand
+_toc_relative_expr_p
+_constant_pool_expr_1
+_init_expmed
+_gen_rtx_CONST_INT
+_recog
+_gpc_reg_operand
+_recog_4
+_reg_or_cint_operand
+_rtx_cost
+_recog_5
+_reg_or_short_operand
+_short_cint_operand
+_htab_find_slot_with_hash
+_const_int_htab_eq
+_init_expr_once
+_gen_rtx_REG
+_recog_10
+_recog_9
+_altivec_register_operand
+_rs6000_legitimate_address
+_zero_constant
+_cc_reg_operand
+_constrain_operands
+_reg_fits_class_p
+_init_caller_save
+_extract_insn
+_insn_extract
+_gen_rtx_MEM
+_gen_rtx_fmt_e0
+_gen_rtx_fmt_ee
+_emit_insn
+_make_insn_raw
+_add_insn
+_recog_memoized_1
+_reg_or_mem_operand
+_recog_7
+_recog_6
+_boolean_or_operator
+_boolean_operator
+_recog_1
+_builtin_function_2
+_builtin_function
+_builtin_function_1
+_get_identifier
+_ht_lookup
+_calc_hash
+_alloc_node
+_make_node
+_tree_size
+_build_library_fn_1
+_build_lang_decl
+_build_decl
+_pfe_savestring
+_retrofit_lang_decl
+_ggc_alloc_cleared
+_pushdecl
+_lookup_name_current_level
+_namespace_binding
+_check_template_shadow
+_push_overloaded_decl
+_namespace_bindings_p
+_innermost_nonclass_level
+_set_namespace_binding
+_decls_match
+_warn_extern_redeclared_static
+_check_default_args
+_add_decl_to_level
+_make_decl_rtl
+_decode_reg_name
+_gen_rtx_fmt_s
+_darwin_encode_section_info
+_ggc_alloc_string
+_update_stubs
+_decl_attributes
+_init_attributes
+_default_insert_attributes
+_insert_default_attributes
+_c_common_insert_default_attributes
+_c_init_attributes
+_build_int_2_wide
+_tree_cons
+_builtin_function_disabled_p
+_mangle_decl
+_mangle_decl_string
+_c_common_nodes_and_builtins
+_init_standard_includes
+_update_path
+_cpp_read_main_file
+_merge_include_chains
+_remove_dup_dirs
+_remove_dup_dir
+__cpp_read_file
+_open_file
+_find_or_create_entry
+_splay_tree_lookup
+_splay_tree_splay
+_splay_tree_insert
+_splay_tree_foreach
+_splay_tree_foreach_helper
+_inode_finder
+_stack_include_file
+_read_include_file
+_cpp_push_buffer
+__cpp_do_file_change
+_add_line_map
+_cb_file_change
+_update_header_times
+_extract_interface_info
+_get_fileinfo
+_splay_tree_splay_helper
+_c_common_init
+_init_pragma
+_cpp_register_pragma
+_cpp_lookup
+_lookup_pragma_entry
+_insert_pragma_entry
+__cpp_aligned_alloc
+_cxx_init
+_init_cp_pragma
+_init_repo
+_objc_init
+_add_objc_tree_codes
+_set_dump_tree_p
+_init_objc
+_hash_init
+_synth_module_prologue
+_push_lang_context
+_objcp_xref_tag
+_xref_tag
+_tree_low_cst
+_host_integerp
+_identifier_type_value
+_lookup_tag
+_binding_for_name
+_lookup_name
+_lookup_name_real
+_lookup_flags
+_unqualified_namespace_lookup
+_current_decl_namespace
+_find_binding
+_lookup_using_namespace
+_select_decl
+_make_aggr_type
+_cp_make_lang_type
+_default_set_default_type_attributes
+_build_pointer_type
+_layout_type
+_size_int_wide
+_size_int_type_wide
+_force_fit_type
+_htab_find_slot
+_size_htab_hash
+_size_htab_eq
+_finalize_type_size
+_get_mode_alignment
+_round_type_align
+_round_up
+_size_binop
+_int_const_binop
+_integer_onep
+_make_binfo
+_make_tree_vec
+_pushtag
+_current_scope
+_create_implicit_typedef
+_set_identifier_type_value_with_scope
+_maybe_process_template_type_declaration
+_maybe_check_template_type
+_pushdecl_with_scope
+_objc_declare_class
+_is_class_name
+_lookup_interface
+_objcp_lookup_name
+_follow_tag_typedef
+_original_type
+_build_function_type
+_type_hash_list
+_type_hash_canon
+_type_hash_lookup
+_htab_find_with_hash
+_type_hash_add
+_objcp_builtin_function
+_type_hash_eq
+_attribute_list_equal
+_attribute_list_contained
+_type_list_equal
+_generate_forward_declaration_to_string_table
+_build_nt
+_define_decl
+_objcp_start_decl
+_start_decl
+_chainon
+_grokdeclarator
+_toplevel_bindings_p
+_cp_type_quals
+_strip_array_types
+_cp_build_qualified_type_real
+_create_array_type_for_decl
+_build_cplus_array_type
+_build_cplus_array_type_1
+_uses_template_parms
+_is_id
+_for_each_template_parm
+_walk_tree
+_for_each_template_parm_r
+_cp_walk_subtrees
+_build_array_type
+_grokvardecl
+_layout_decl
+_set_decl_namespace
+_is_namespace_ancestor
+_no_linkage_check
+_walk_tree_without_duplicates
+_htab_find
+_hash_pointer
+_no_linkage_helper
+_htab_delete
+_bad_specifiers
+_c_apply_type_quals_to_decl
+_cplus_decl_attributes
+_maybe_apply_pragma_weak
+_maybe_push_decl
+_maybe_register_incomplete_var
+_start_decl_1
+_maybe_push_cleanup_level
+_objcp_finish_decl
+_cp_finish_decl
+_maybe_apply_renaming_pragma
+_cp_has_mutable_p
+_target_type
+_check_initializer
+_maybe_deduce_size_from_array_init
+_complete_array_type
+_current_stmt_tree
+_layout_var_decl
+_maybe_commonize_var
+_make_rtl_for_nonlocal_decl
+_rest_of_decl_compilation
+_timevar_push
+_assemble_variable
+_timevar_pop
+_abstract_virtuals_error
+_pop_lang_context
+_objc_act_parse_init
+_lang_dependent_init
+_init_asm_output
+_strip_off_ending
+_init_eh
+_init_optabs
+_c_lex
+_read_token
+_read_process_identifier
+_altivec_treat_as_keyword
+_yylex
+_yyparse_1
+_do_pending_lang_change
+_cpp_get_token
+__cpp_lex_token
+__cpp_lex_direct
+_skip_whitespace
+_parse_identifier
+_enter_macro_context
+_push_token_context
+_next_context
+_padding_token
+__cpp_temp_token
+_hash_tree_cons
+_list_hash_pieces
+__cpp_pop_context
+_scan_tokens
+_frob_id
+_parse_decl0
+_frob_specs
+_save_type_access_control
+_split_specs_attrs
+_parse_decl
+_build_type_copy
+_copy_node
+_parse_end_decl
+_decl_type_access_control
+_deferred_type_access_control
+_note_list_got_semicolon
+_clear_anon_tags
+_do_pending_inlines
+_ggc_collect
+_handle_newline
+_get_effective_char
+__cpp_handle_directive
+_start_directive
+_directive_diagnostics
+_do_endif
+_check_eol
+_skip_block_comment
+_end_directive
+_skip_rest_of_line
+_do_undef
+_lex_macro_node
+_adjust_column
+_do_if
+__cpp_parse_expr
+_lex
+_parse_defined
+_push_conditional
+_do_ifndef
+__obstack_newchunk
+_do_define
+__cpp_create_definition
+_alloc_expansion_token
+_pfe_is_cmd_ln_processing
+_cb_line_change
+_list_hash_eq
+_build_tree_list
+_do_ifdef
+_find_include_file
+__cpp_execute_include
+_push_srcloc
+_debug_nothing_int_charstar
+__cpp_never_reread
+_do_import
+_do_include_common
+_parse_include
+_parse_string
+_unescaped_terminator_p
+_hmap_lookup_path
+_maybe_note_name_used_in_class
+_note_got_semicolon
+_parse_params
+_save_parameter
+_lex_expansion_token
+_parse_number
+_parse_number
+___udivdi3
+___udivmoddi4
+_do_else
+_identifier_type
+_do_include
+_search_from
+_lbasename
+__cpp_pop_buffer
+__cpp_pop_file_buffer
+_purge_cache
+_pop_srcloc
+_debug_nothing_int
+_do_elif
+_comptypes
+_compparms
+_add_method
+_build_overload
+_ovl_cons
+_clone_function_decl
+_clone_constructors_and_destructors
+_check_bases_and_members
+_finish_struct_methods
+_maybe_warn_about_overly_private_class
+_method_name_cmp
+_type_requires_array_cookie
+_lookup_fnfields
+_lookup_member
+_complete_type
+_bfs_walk
+_varray_init
+_lookup_field_r
+_lookup_fnfields_1
+_lookup_field_1
+_finish_struct_1
+_layout_class_type
+_start_record_layout
+_determine_primary_base
+_create_vtable_ptr
+_build_base_fields
+_layout_nonempty_base_or_field
+_place_field
+_integer_zerop
+_default_ms_bitfield_layout_p
+_normalize_rli
+_normalize_offset
+_compare_tree_int
+_tree_int_cst_sgn
+_byte_position
+_byte_from_pos
+_convert
+_ocp_convert
+_decl_constant_value
+_convert_to_integer
+_build1
+_first_rtl_op
+_fold
+_fold_convert
+_layout_conflict_p
+_splay_tree_max
+_add_double
+_end_of_class
+_rli_size_unit_so_far
+_finish_record_layout
+_finalize_record_size
+_mul_double
+_encode
+_decode
+_rli_size_so_far
+_bit_from_pos
+_compute_record_mode
+_bit_position
+_int_bit_position
+_simple_cst_equal
+_mode_for_size_tree
+_remove_zero_width_bit_fields
+_layout_virtual_bases
+_warn_about_ambiguous_direct_bases
+_splay_tree_delete
+_splay_tree_delete_helper
+_splay_tree_xmalloc_deallocate
+_nreverse
+_modify_all_vtables
+_dfs_walk
+_dfs_walk_real
+_dfs_modify_vtables
+_dfs_unmark
+_finish_struct_bits
+_aggregate_value_p
+_count_fields
+_add_fields_to_vec
+_field_decl_cmp
+_finish_vtbls
+_accumulate_vtbl_inits
+_build_vtt
+_build_vtt_inits
+_complete_vars
+_maybe_suppress_debug_info
+_dump_class_hierarchy
+_dump_begin
+_decl_function_context
+_rest_of_type_compilation
+_finish_struct
+_popclass
+_poplevel_class
+_pop_binding
+_pop_binding_level
+_find_class_binding_level
+_pop_class_decls
+_pop_search_level
+_pop_stack_level
+_finish_class_definition
+_check_for_missing_semicolon
+_do_pending_defargs
+_done_pending_defargs
+_begin_inline_definitions
+_finish_inline_definitions
+_clear_inline_text_obstack
+_set_identifier_type_value
+_build_self_reference
+_finish_member_declaration
+_pushdecl_class_level
+_push_class_level_binding
+_push_class_binding
+_note_name_declared_in_class
+_push_binding
+_context_for_name_lookup
+_is_properly_derived_from
+_begin_class_definition
+_check_class_key
+_decl_namespace
+_parse_field0
+_parse_field
+_grokfield
+_constructor_name
+_constructor_name_full
+_objc_check_decl
+_template_class_depth
+_template_class_depth_real
+_splay_tree_compare_pointers
+_reset_type_access_control
+_unreverse_member_declarations
+_fixup_inline_methods
+_check_bases
+_check_field_decls
+_delete_duplicate_fields
+_delete_duplicate_fields_1
+_pod_type_p
+_check_field_decl
+_finish_struct_anon
+_check_methods
+_add_implicitly_declared_members
+_implicitly_declare_fn
+_synthesize_exception_spec
+_make_call_declarator
+_parmlist_is_exprlist
+_check_special_function_return_type
+_member_function_or_else
+_grokparms
+_build_cplus_method_type
+_grokfndecl
+_build_exception_variant
+_comp_except_specs
+_eq_pointer
+_get_containing_scope
+_grokclassfn
+_build_qualified_type
+_get_qualified_type
+_set_type_quals
+_build_artificial_parm
+_maybe_retrofit_in_chrg
+_statement_code_p
+_cp_statement_code_p
+_cp_is_overload_p
+_check_explicit_specialization
+_current_tmpl_spec_kind
+_grok_ctor_properties
+_copy_fn_p
+_skip_artificial_parms_for
+_grok_special_member_properties
+_sufficient_parms_p
+_defer_fn
+_build_reference_type
+_hash_tree_chain
+_type_promotes_to
+_c_promoting_integer_type_p
+_grok_op_properties
+_ambi_op_p
+_unary_op_p
+_build_clone
+_copy_decl
+_copy_lang_decl
+_copy_list
+_parse_bitfield0
+_parse_bitfield
+_grokbitfield
+_constant_expression_warning
+_lex_number
+_int_fits_type_p
+_check_bitfield_decl
+_do_aggr
+_yyungetc
+_handle_class_head
+_maybe_process_partial_specialization
+_pushclass
+_invalidate_class_lookup_cache
+_pushlevel_class
+_push_binding_level
+_push_class_decls
+_push_search_level
+_push_stack_level
+_dfs_push_type_decls
+_dfs_push_decls
+_storetags
+_reset_specialization
+_make_pointer_declarator
+_get_type_decl
+_finish_decl_parsing
+_check_for_new_type
+_finish_parmlist
+_varray_grow
+_pfe_s_realloc
+_pfe_realloc
+_do_warning
+__cpp_extend_buff
+_nothrow_libfn_p
+_libc_name_p
+_lex_string
+_build_string
+_lookup_tag_reverse
+_skip_escaped_newlines
+_begin_function_definition
+_start_function
+_lookup_attribute
+_check_function_type
+_require_complete_types_for_parms
+_complete_type_or_else
+_init_function_start
+_prepare_function_start
+_init_stmt_for_function
+_init_eh_for_function
+_init_emit
+_clear_emit_caches
+_init_virtual_regs
+_init_expr
+_init_varasm_status
+_init_temp_slots
+_init_pending_stack_adjust
+_push_cp_function_context
+_rs6000_init_machine_status
+_objc_printable_name
+_objc_demangle
+_emit_line_note
+_set_file_and_line_for_stmt
+_emit_note
+_hard_function_value
+_begin_stmt_tree
+_announce_function
+_pushlevel
+_start_fname_decls
+_store_parm_decls
+_storedecls
+_push_local_binding
+_getdecls
+_gettags
+_begin_function_body
+_keep_next_level
+_begin_compound_stmt
+_build_stmt
+_add_stmt
+_stmts_are_full_exprs_p
+_do_pushlevel
+_make_binding_level
+_add_scope_stmt
+_current_scope_stmt_stack
+_at_function_scope_p
+_compute_array_index_type
+_cp_convert
+_build_binary_op
+_really_overloaded_fn
+_default_conversion
+_decay_conversion
+_type_unknown_p
+_is_overloaded_fn
+_common_type
+_type_after_usual_arithmetic_conversions
+_merge_type_attributes
+_merge_attributes
+_build_type_attribute_variant
+_build
+_operand_equal_p
+_tree_int_cst_equal
+_const_binop
+_neg_double
+_build_index_type
+_non_lvalue
+_place_union_field
+_qualify_lookup
+_finish_id_expr
+_do_identifier
+_objcp_lookup_identifier
+_lookup_objc_ivar
+_hack_identifier
+_mark_used
+_assemble_external
+_convert_from_reference
+_build_x_unary_op
+_build_new_op
+_build_unary_op
+_lvalue_type
+_unary_complex_lvalue
+_lvalue_or_else
+_lvalue_p
+_lvalue_p_1
+_mark_addressable
+_staticp
+_reparse_absdcl_as_casts
+_altivec_is_vector_constant_element
+_groktypename
+_build_c_cast
+_convert_force
+_convert_to_pointer_force
+_cp_convert_to_pointer
+_build_x_modify_expr
+_build_modify_expr
+_require_complete_type
+_convert_for_assignment
+_dubious_conversion_warnings
+_overflow_warning
+_can_convert_arg_bad
+_implicit_conversion
+_standard_conversion
+_strip_top_quals
+_perform_implicit_conversion
+_convert_like_real
+_finish_expr_stmt
+_convert_to_void
+_finish_stmt
+_dependent_base_p
+_currently_open_class
+_type_access_control
+_build_x_component_ref
+_build_component_ref
+_lookup_field
+_enforce_access
+_accessible_p
+_friend_accessible_p
+_access_in_type
+_dfs_access_in_type
+_assert_canonical_unmarked
+_dfs_assert_unmarked_p
+_dfs_accessible_p
+_grok_array_decl
+_build_expr_type_conversion
+_build_array_ref
+_build_x_arrow
+_build_indirect_ref
+_canonical_type_variant
+_build_conv
+_finish_call_expr
+_is_global
+_lookup_arg_dependent
+_arg_assoc_args
+_arg_assoc
+_arg_assoc_type
+_build_x_function_call
+_build_function_call
+_build_function_call_real
+_decl_target_overloaded_intrinsic_p
+_inline_conversion
+_convert_arguments
+_convert_for_initialization
+_build_call
+_build_addr_func
+_is_empty_class
+_finish_return_stmt
+_check_return_expr
+_maybe_warn_about_returning_address_of_local
+_finish_compound_stmt
+_finish_function_body
+_do_poplevel
+_kept_level_p
+_poplevel
+_warn_about_unused_variables
+_finish_function
+_finish_fname_decls
+_finish_stmt_tree
+_pop_labels
+_save_function_data
+_calls_setjmp_p
+_calls_setjmp_r
+_setjmp_call_p
+_special_function_p
+_free_after_parsing
+_pop_cp_function_context
+_free_stmt_status
+_free_after_compilation
+_free_eh_status
+_free_expr_status
+_free_emit_status
+_free_varasm_status
+_rs6000_free_machine_status
+_expand_body
+_simplify_aggr_init_exprs_r
+_maybe_clone_body
+_debug_nothing_tree
+_start_enum
+_build_enumerator
+_tree_int_cst_lt
+_finish_enum
+_min_precision
+_tree_floor_log2
+_fixup_unsigned_type
+_smallest_mode_for_size
+_shadow_tag
+_check_tag_decl
+_add_builtin_candidates
+_non_reference
+_type_decays_to
+_type_for_size
+_add_builtin_candidate
+_build_builtin_candidate
+_add_candidate
+_any_viable
+_splice_viable
+_tourney
+_lshift_double
+_finish_parenthesized_expr
+_build_x_binary_op
+_lookup_function_nonclass
+_lookup_name_nonclass
+_arg_assoc_namespace
+_purpose_member
+_get_narrower
+_truth_value_p
+_integer_all_onesp
+_distribute_bit_expr
+_default_comp_type_attributes
+_build_x_indirect_ref
+_build_opfncall
+_reparse_decl_as_expr
+_build_expr_from_tree
+_warn_of_redefinition
+_cpp_pedwarn_with_line
+__cpp_begin_message
+__cpp_free_definition
+_funlike_invocation_p
+_collect_args
+_replace_args
+_expand_arg
+_push_ptoken_context
+__cpp_release_buff
+_finish_sizeof
+_c_sizeof
+_extract_muldiv
+_get_inner_array_type
+_duplicate_decls
+_redeclaration_error_message
+_locate_copy
+_merge_exception_specifiers
+_add_binding
+_locate_ctor
+_make_anon_name
+_clear_identifier_class_values
+_merge_decl_attributes
+_merge_types
+_commonparms
+_list_length
+_tree_last
+_skip_line_comment
+_trigraph_p
+_see_typename
+_push_nested_class
+_set_class_shadows
+_unuse_fields
+_dfs_unuse_fields
+_maybe_begin_member_template_processing
+_inline_needs_template_parms
+_feed_defarg
+_feed_input
+_replace_defarg
+_can_convert_arg
+_finish_defarg
+_end_input
+_obstack_free
+_maybe_end_member_template_processing
+_pop_nested_class
diff --git a/order-files/cc1plus.order b/order-files/cc1plus.order
new file mode 100644
index 00000000000..39806c011ca
--- /dev/null
+++ b/order-files/cc1plus.order
@@ -0,0 +1,1356 @@
+start
+__start
+__dyld_init_check
+dyld_stub_binding_helper
+___darwin_gcc3_preregister_frame_info
+__call_mod_init_funcs
+__dyld_func_lookup
+_main
+_toplev_main
+_hex_init
+_general_init
+_xmalloc_set_program_name
+_diagnostic_initialize
+__obstack_begin
+_xmalloc
+_parse_options_and_default_flags
+_init_reg_sets
+_add_params
+_xrealloc
+_pfe_init
+_read_integral_parameter
+_override_O_option
+_extract_override_options
+_lang_init_options
+_cxx_init_options
+_c_common_init_options
+_cpp_create_reader
+_init_library
+_init_trigraph_map
+_xcalloc
+_set_lang
+_deps_init
+_init_line_maps
+__cpp_init_tokenrun
+__cpp_get_buff
+_new_buff
+_pfe_s_malloc
+_pfe_malloc
+_gcc_obstack_init
+_pfe_obstack_chuck_alloc
+__cpp_init_includes
+_splay_tree_new
+_splay_tree_new_with_allocator
+_splay_tree_xmalloc_allocate
+_set_index_lang
+_set_target_switch
+_optimization_options
+_override_option
+_cxx_decode_option
+_cpp_handle_option
+_parse_option
+_xstrdup
+_append_include_chain
+__cpp_simplify_pathname
+_independent_decode_option
+_remove_component_p
+_new_pending_directive
+_compare_options
+_dump_switch_p
+_decode_f_option
+_decode_g_option
+_set_Wunused
+_set_Wformat
+_decode_W_option
+_output_set_maximum_length
+_set_real_maximum_length
+_output_is_line_wrapping
+_add_env_options
+_cxx_post_options
+_c_common_post_options
+_cpp_post_options
+_init_dependency_output
+_do_compile
+_process_options
+_rs6000_override_options
+_rs6000_parse_abi_options
+_rs6000_add_gc_roots
+_ggc_add_rtx_root
+_ggc_add_root
+_htab_create
+_higher_prime_number
+_machopic_add_gc_roots
+_ggc_add_tree_root
+_new_alias_set
+_floor_log2_wide
+_init_timevar
+_timevar_start
+_lang_independent_init
+_init_ggc
+_exact_log2_wide
+_pfe_s_calloc
+_pfe_calloc
+_init_stringpool
+_ht_create
+_init_obstacks
+_ggc_add_deletable_htab
+_init_emit_once
+_mode_for_size
+_gen_rtx
+_rtx_alloc
+_ggc_alloc
+_alloc_page
+_pfe_free
+_set_page_table_entry
+_gen_raw_REG
+_gen_rtx_fmt_i0
+_gen_rtx_fmt_w
+_ereal_atof
+_asctoe53
+_asctoeg
+_ecleaz
+_enormlz
+_eshup6
+_toe53
+_eiisnan
+_eshift
+_eshup1
+_e53toe
+_eshdn1
+_ecleazs
+_emovo
+_emovz
+_eaddm
+_eshup8
+_emdnorm
+_gen_rtx_CONST_INT
+_gen_const_vector_0
+_rtvec_alloc
+_gen_rtx_fmt_E0
+_gen_rtx_REG
+_init_regs
+_init_reg_sets_1
+_reg_class_subset_p
+_init_reg_modes
+_choose_hard_reg_mode
+_gen_rtx_MEM
+_gen_rtx_fmt_e0
+_init_alias_once
+_init_stmt
+_init_loop
+_address_cost
+_memory_address_p
+_rs6000_legitimate_address
+_init_reload
+_gen_rtx_fmt_ee
+_gen_rtx_fmt_s
+_pfe_savestring
+_plus_constant_wide
+_find_constant_term_loc
+_init_varasm_once
+_init_EXPR_INSN_LIST_cache
+_init_dummy_function_start
+_prepare_function_start
+_ggc_alloc_cleared
+_init_stmt_for_function
+_init_eh_for_function
+_init_emit
+_clear_emit_caches
+_init_virtual_regs
+_init_expr
+_init_varasm_status
+_init_temp_slots
+_init_pending_stack_adjust
+_rs6000_init_machine_status
+_init_expmed
+_start_sequence
+_rtx_cost
+_emit_insn
+_make_insn_raw
+_add_insn
+_init_recog
+_recog
+_recog_13
+_gpc_reg_operand
+_register_operand
+_recog_4
+_reg_or_cint_operand
+_recog_5
+_nonimmediate_operand
+_general_operand
+_input_operand
+_memory_operand
+_toc_relative_expr_p
+_constant_pool_expr_1
+_reg_or_short_operand
+_short_cint_operand
+_htab_find_slot_with_hash
+_const_int_htab_eq
+_init_expr_once
+_boolean_or_operator
+_boolean_operator
+_recog_1
+_reg_or_mem_operand
+_recog_7
+_recog_10
+_recog_9
+_altivec_register_operand
+_zero_constant
+_strict_memory_address_p
+_init_caller_save
+_recog_memoized_1
+_extract_insn
+_insn_extract
+_constrain_operands
+_reg_fits_class_p
+_recog_6
+_cc_reg_operand
+_ht_lookup
+_alloc_node
+_make_node
+_tree_size
+_get_identifier
+_init_reswords
+_calc_hash
+_cxx_init
+_init_spew
+_init_tree
+_set_dump_tree_p
+_init_cplus_expand
+_init_cp_semantics
+_add_c_tree_codes
+_add_cpp_tree_codes
+_init_operators
+_init_method
+_init_mangle
+_varray_init
+_init_error
+_init_output_buffer
+_output_set_prefix
+_clear_diagnostic_info
+_build_int_2_wide
+_cxx_init_decl_processing
+_initialize_predefined_identifiers
+_cp_parse_init
+_init_decl2
+_ggc_add_tree_varray_root
+_init_pt
+_push_to_top_level
+_maybe_push_to_top_level
+_push_namespace
+_build_lang_decl
+_build_decl
+_retrofit_lang_decl
+_build_common_tree_nodes
+_initialize_sizetypes
+_default_set_default_type_attributes
+_get_mode_alignment
+_copy_node
+_make_signed_type
+_fixup_signed_type
+_layout_type
+_tree_int_cst_sgn
+_smallest_mode_for_size
+_size_int_wide
+_size_int_type_wide
+_force_fit_type
+_htab_find_slot
+_size_htab_hash
+_finalize_type_size
+_round_type_align
+_round_up
+_size_htab_eq
+_size_binop
+_int_const_binop
+_integer_onep
+_tree_cons
+_make_unsigned_type
+_fixup_unsigned_type
+_pushlevel
+_make_binding_level
+_push_binding_level
+_declare_namespace_level
+_namespace_binding
+_pushdecl
+_lookup_name_current_level
+_check_template_shadow
+_namespace_bindings_p
+_innermost_nonclass_level
+_set_namespace_binding
+_add_decl_to_level
+_pop_namespace
+_suspend_binding_level
+_find_class_binding_level
+_c_common_nodes_and_builtins
+_record_builtin_type
+_set_identifier_type_value_with_scope
+_binding_for_name
+_find_binding
+_set_identifier_type_value
+_identifier_global_value
+_signed_type
+_set_sizetype
+_build_common_tree_nodes_2
+_build_pointer_type
+_build_qualified_type
+_get_qualified_type
+_build_type_copy
+_set_type_quals
+_mul_double
+_encode
+_decode
+_rs6000_build_va_list
+_make_vector
+_finish_vector_type
+_build_index_type
+_convert
+_ocp_convert
+_complete_type
+_decl_constant_value
+_convert_to_integer
+_build1
+_first_rtl_op
+_fold
+_fold_convert
+_compare_tree_int
+_host_integerp
+_tree_low_cst
+_type_hash_canon
+_type_hash_lookup
+_htab_find_with_hash
+_type_hash_add
+_build_array_type
+_build
+_integer_zerop
+_comptypes
+_non_lvalue
+_add_double
+_simple_cst_equal
+_mode_for_size_tree
+_start_record_layout
+_place_field
+_layout_decl
+_default_ms_bitfield_layout_p
+_normalize_rli
+_normalize_offset
+_finish_record_layout
+_finalize_record_size
+_get_inner_array_type
+_rli_size_so_far
+_bit_from_pos
+_rli_size_unit_so_far
+_byte_from_pos
+_compute_record_mode
+_type_hash_eq
+_attribute_list_equal
+_attribute_list_contained
+_bit_position
+_int_bit_position
+_build_function_type
+_type_hash_list
+_type_list_equal
+_builtin_function_2
+_builtin_function
+_builtin_function_1
+_build_library_fn_1
+_push_overloaded_decl
+_decls_match
+_warn_extern_redeclared_static
+_check_default_args
+_make_decl_rtl
+_decode_reg_name
+_darwin_encode_section_info
+_ggc_alloc_string
+_update_stubs
+_decl_attributes
+_init_attributes
+_default_insert_attributes
+_insert_default_attributes
+_c_common_insert_default_attributes
+_c_init_attributes
+_builtin_function_disabled_p
+_mangle_decl
+_mangle_decl_string
+_resume_binding_level
+_strip_array_types
+_cp_type_quals
+_build_cplus_array_type
+_build_cplus_array_type_1
+_uses_template_parms
+_for_each_template_parm
+_walk_tree
+_for_each_template_parm_r
+_cp_walk_subtrees
+_statement_code_p
+_cp_statement_code_p
+_cp_is_overload_p
+_record_unknown_type
+_xref_tag
+_identifier_type_value
+_add_exception_specifier
+_build_tree_list
+_build_exception_variant
+_comp_except_specs
+_push_cp_library_fn
+_build_cp_library_fn
+_set_mangled_name_for_decl
+_write_encoding
+_write_name
+_decl_is_template_id
+_write_unscoped_name
+_write_unqualified_name
+_write_bare_function_type
+_write_method_parms
+_write_type
+_find_substitution
+_canonical_type_variant
+_cp_build_qualified_type_real
+_write_CV_qualifiers_for_type
+_write_builtin_type
+_add_substitution
+_build_library_fn_ptr
+_build_library_fn
+_init_class_processing
+_init_one_libfunc
+_init_exception_processing
+_supports_one_only
+_start_fname_decls
+_using_eh_for_cleanups
+_type_for_size
+_init_cpp_parse
+_c_common_init
+_init_c_lex
+_get_fileinfo
+_splay_tree_lookup
+_splay_tree_splay
+_splay_tree_insert
+_cpp_get_callbacks
+_cpp_read_main_file
+__cpp_init_hashtable
+__cpp_init_directives
+_cpp_lookup
+__cpp_init_internal_pragmas
+_cpp_register_pragma
+_lookup_pragma_entry
+_insert_pragma_entry
+__cpp_aligned_alloc
+_init_standard_includes
+_update_path
+_concat
+_translate_name
+_get_key_value
+_merge_include_chains
+_remove_dup_dirs
+_remove_dup_dir
+_cpp_warning
+__cpp_begin_message
+__cpp_read_file
+_open_file
+_find_or_create_entry
+_splay_tree_foreach
+_splay_tree_foreach_helper
+_inode_finder
+_stack_include_file
+_read_include_file
+_cpp_push_buffer
+__cpp_do_file_change
+_add_line_map
+_cb_file_change
+_update_header_times
+_extract_interface_info
+_splay_tree_splay_helper
+_init_pragma
+_init_cp_pragma
+_init_repo
+_lang_dependent_init
+_init_asm_output
+_init_eh
+_init_optabs
+_init_all_optabs
+_init_integral_libfuncs
+_init_libfuncs
+_init_floating_libfuncs
+__obstack_newchunk
+_dwarf2out_do_frame
+_dwarf2out_frame_init
+_dwarf2out_def_cfa
+_def_cfa_1
+_lookup_cfa
+_add_fde_cfi
+_initial_return_save
+_reg_save
+_dbxout_init
+_getdecls
+_getpwd
+_output_quoted_string
+_assemble_name
+_maybe_get_identifier
+_text_section
+_dbxout_typedefs
+_dbxout_symbol
+_timevar_pop
+_compile_file
+_init_final
+_init_branch_prob
+_timevar_push
+_yyparse
+_dbxout_start_source_file
+_cpp_finish_options
+_init_builtins
+__cpp_define_builtin
+_run_directive
+_start_directive
+_do_define
+_lex_macro_node
+__cpp_lex_token
+__cpp_lex_direct
+_parse_identifier
+__cpp_create_definition
+_skip_whitespace
+_parse_string
+_unescaped_terminator_p
+_alloc_expansion_token
+_lex_expansion_token
+_handle_newline
+_pfe_is_cmd_ln_processing
+_end_directive
+_skip_rest_of_line
+__cpp_pop_buffer
+_parse_number
+_pfe_set_cmd_ln_processing
+_cpp_define
+_warn_of_redefinition
+__cpp_equiv_tokens
+__cpp_free_definition
+_pfe_reset_cmd_ln_processing
+_free_chain
+__cpp_push_next_buffer
+_push_include
+__cpp_execute_include
+_find_include_file
+_search_from
+_push_srcloc
+_yyparse_1
+_yylex
+_read_token
+_c_lex
+_cpp_get_token
+_get_effective_char
+_skip_block_comment
+_adjust_column
+_skip_line_comment
+__cpp_handle_directive
+_directive_diagnostics
+_do_ifndef
+_check_eol
+_push_conditional
+_do_else
+_do_endif
+___udivmoddi4
+_parse_number
+_lex
+__cpp_parse_expr
+__cpp_pop_context
+_do_if
+_do_include
+_do_include_common
+_parse_include
+_find_framework_file
+_skip_escaped_newlines
+_enter_macro_context
+_push_token_context
+_next_context
+___udivdi3
+_parse_defined
+_do_elif
+__cpp_pop_file_buffer
+_purge_cache
+_pop_srcloc
+_dbxout_end_source_file
+_lbasename
+_parse_params
+_save_parameter
+_read_process_identifier
+_altivec_treat_as_keyword
+_padding_token
+__cpp_temp_token
+_hash_tree_cons
+_list_hash_pieces
+_scan_tokens
+_frob_id
+_lookup_name
+_lookup_name_real
+_lookup_flags
+_unqualified_namespace_lookup
+_current_decl_namespace
+_lookup_using_namespace
+_select_decl
+_chainon
+_parse_decl0
+_frob_specs
+_save_type_access_control
+_split_specs_attrs
+_parse_decl
+_start_decl
+_grokdeclarator
+_toplevel_bindings_p
+_bad_specifiers
+_cplus_decl_attributes
+_maybe_apply_pragma_weak
+_maybe_push_decl
+_start_decl_1
+_maybe_push_cleanup_level
+_parse_end_decl
+_decl_type_access_control
+_deferred_type_access_control
+_cp_finish_decl
+_maybe_apply_renaming_pragma
+_cp_has_mutable_p
+_rest_of_decl_compilation
+_note_list_got_semicolon
+_clear_anon_tags
+_do_pending_inlines
+_ggc_collect
+_cb_line_change
+_list_hash_eq
+_identifier_type
+_maybe_note_name_used_in_class
+_note_got_semicolon
+_do_aggr
+_yyungetc
+_handle_class_head
+_current_scope
+_lookup_tag
+_make_aggr_type
+_cp_make_lang_type
+_make_binfo
+_make_tree_vec
+_pushtag
+_create_implicit_typedef
+_maybe_process_template_type_declaration
+_maybe_check_template_type
+_pushdecl_with_scope
+_begin_class_definition
+_reset_type_access_control
+_maybe_process_partial_specialization
+_pushclass
+_pushlevel_class
+_push_class_decls
+_push_search_level
+_push_stack_level
+_dfs_walk
+_dfs_walk_real
+_dfs_push_type_decls
+_dfs_push_decls
+_storetags
+_reset_specialization
+_build_self_reference
+_constructor_name
+_constructor_name_full
+_finish_member_declaration
+_pushdecl_class_level
+_push_class_level_binding
+_push_class_binding
+_note_name_declared_in_class
+_push_binding
+_context_for_name_lookup
+_is_properly_derived_from
+_check_class_key
+_decl_namespace
+_parse_field0
+_parse_field
+_grokfield
+_c_apply_type_quals_to_decl
+_target_type
+_check_initializer
+_maybe_deduce_size_from_array_init
+_current_stmt_tree
+_template_class_depth
+_template_class_depth_real
+_splay_tree_compare_pointers
+_finish_class_definition
+_finish_struct
+_unreverse_member_declarations
+_nreverse
+_finish_struct_1
+_fixup_inline_methods
+_check_bases_and_members
+_check_bases
+_check_field_decls
+_delete_duplicate_fields
+_delete_duplicate_fields_1
+_pod_type_p
+_check_field_decl
+_finish_struct_anon
+_check_methods
+_add_implicitly_declared_members
+_implicitly_declare_fn
+_synthesize_exception_spec
+_make_call_declarator
+_build_nt
+_parmlist_is_exprlist
+_check_special_function_return_type
+_member_function_or_else
+_grokparms
+_build_cplus_method_type
+_decl_function_context
+_grokfndecl
+_no_linkage_check
+_walk_tree_without_duplicates
+_htab_find
+_hash_pointer
+_no_linkage_helper
+_eq_pointer
+_htab_delete
+_get_containing_scope
+_grokclassfn
+_build_artificial_parm
+_abstract_virtuals_error
+_defer_fn
+_build_reference_type
+_hash_tree_chain
+_type_promotes_to
+_c_promoting_integer_type_p
+_maybe_retrofit_in_chrg
+_check_explicit_specialization
+_current_tmpl_spec_kind
+_grok_ctor_properties
+_copy_fn_p
+_skip_artificial_parms_for
+_grok_special_member_properties
+_make_rtl_for_nonlocal_decl
+_assemble_variable
+_grok_op_properties
+_ambi_op_p
+_unary_op_p
+_add_method
+_build_overload
+_compparms
+_ovl_cons
+_clone_constructors_and_destructors
+_clone_function_decl
+_build_clone
+_copy_decl
+_copy_lang_decl
+_copy_list
+_finish_struct_methods
+_maybe_warn_about_overly_private_class
+_method_name_cmp
+_type_requires_array_cookie
+_lookup_fnfields
+_lookup_member
+_bfs_walk
+_lookup_field_r
+_lookup_fnfields_1
+_lookup_field_1
+_layout_class_type
+_determine_primary_base
+_create_vtable_ptr
+_build_base_fields
+_layout_nonempty_base_or_field
+_byte_position
+_layout_conflict_p
+_splay_tree_max
+_end_of_class
+_aggregate_value_p
+_finish_struct_bits
+_count_fields
+_finish_vtbls
+_accumulate_vtbl_inits
+_build_vtt
+_build_vtt_inits
+_complete_vars
+_maybe_suppress_debug_info
+_dump_class_hierarchy
+_dump_begin
+_rest_of_type_compilation
+_popclass
+_poplevel_class
+_pop_binding
+_pop_binding_level
+_pop_class_decls
+_pop_search_level
+_pop_stack_level
+_splay_tree_delete
+_splay_tree_delete_helper
+_splay_tree_xmalloc_deallocate
+_do_pending_defargs
+_done_pending_defargs
+_begin_inline_definitions
+_finish_inline_definitions
+_clear_inline_text_obstack
+_shadow_tag
+_check_tag_decl
+_follow_tag_typedef
+_original_type
+_duplicate_decls
+_redeclaration_error_message
+_invalidate_class_lookup_cache
+_sufficient_parms_p
+_make_pointer_declarator
+_create_array_type_for_decl
+_compute_array_index_type
+_constant_expression_warning
+_cp_convert
+_build_binary_op
+_really_overloaded_fn
+_default_conversion
+_decay_conversion
+_type_unknown_p
+_is_overloaded_fn
+_common_type
+_type_after_usual_arithmetic_conversions
+_merge_type_attributes
+_merge_attributes
+_build_type_attribute_variant
+_operand_equal_p
+_tree_int_cst_equal
+_const_binop
+_neg_double
+_lex_number
+_remove_zero_width_bit_fields
+_layout_virtual_bases
+_warn_about_ambiguous_direct_bases
+_modify_all_vtables
+_dfs_modify_vtables
+_dfs_unmark
+_int_fits_type_p
+_do_ifdef
+_check_for_new_type
+_finish_parmlist
+_begin_function_definition
+_start_function
+_nothrow_libfn_p
+_libc_name_p
+_lookup_attribute
+_check_function_type
+_require_complete_types_for_parms
+_complete_type_or_else
+_init_function_start
+_push_cp_function_context
+_lang_printable_name
+_lang_decl_name
+_decl_as_string
+_output_clear_message_text
+_dump_decl
+_dump_function_decl
+_dump_type_prefix
+_dump_type
+_dump_qualifiers
+_output_add_string
+_maybe_wrap_text
+_output_append
+_output_emit_prefix
+_output_append_r
+_output_add_space
+_dump_scope
+_dump_function_name
+_dump_parameters
+_output_add_character
+_dump_type_suffix
+_output_finalize_message
+_emit_line_note
+_set_file_and_line_for_stmt
+_emit_note
+_hard_function_value
+_begin_stmt_tree
+_announce_function
+_store_parm_decls
+_storedecls
+_push_local_binding
+_gettags
+_begin_function_body
+_keep_next_level
+_begin_compound_stmt
+_build_stmt
+_add_stmt
+_stmts_are_full_exprs_p
+_do_pushlevel
+_add_scope_stmt
+_current_scope_stmt_stack
+_build_expr_from_tree
+_do_identifier
+_qualify_lookup
+_objcp_lookup_identifier
+_hack_identifier
+_mark_used
+_assemble_external
+_convert_from_reference
+_build_x_indirect_ref
+_build_opfncall
+_build_new_op
+_build_indirect_ref
+_reparse_decl_as_expr
+_finish_parenthesized_expr
+_finish_return_stmt
+_check_return_expr
+_convert_for_initialization
+_convert_for_assignment
+_dubious_conversion_warnings
+_overflow_warning
+_can_convert_arg_bad
+_implicit_conversion
+_standard_conversion
+_strip_top_quals
+_lvalue_p
+_lvalue_p_1
+_build_conv
+_perform_implicit_conversion
+_convert_like_real
+_maybe_warn_about_returning_address_of_local
+_finish_stmt
+_finish_compound_stmt
+_finish_function_body
+_do_poplevel
+_kept_level_p
+_poplevel
+_warn_about_unused_variables
+_finish_function
+_finish_fname_decls
+_finish_stmt_tree
+_pop_labels
+_save_function_data
+_calls_setjmp_p
+_calls_setjmp_r
+_free_after_parsing
+_pop_cp_function_context
+_free_stmt_status
+_free_after_compilation
+_free_eh_status
+_free_expr_status
+_free_emit_status
+_free_varasm_status
+_rs6000_free_machine_status
+_expand_body
+_simplify_aggr_init_exprs_r
+_maybe_clone_body
+_debug_nothing_tree
+_lex_string
+_build_string
+_push_lang_context
+_grokvardecl
+_set_decl_namespace
+_is_namespace_ancestor
+_maybe_register_incomplete_var
+_layout_var_decl
+_maybe_commonize_var
+_make_anon_name
+_start_enum
+_finish_unary_op_expr
+_build_x_unary_op
+_build_unary_op
+_build_expr_type_conversion
+_build_enumerator
+_check_for_missing_semicolon
+_dump_aggr_type
+_class_key_or_enum
+_check_for_uninitialized_const_var
+_at_function_scope_p
+_add_decl_stmt
+_maybe_inject_for_scope_var
+_initialize_local_var
+_destroy_local_var
+_finish_id_expr
+_dependent_base_p
+_currently_open_class
+_type_access_control
+_build_x_component_ref
+_build_component_ref
+_lookup_field
+_enforce_access
+_accessible_p
+_friend_accessible_p
+_access_in_type
+_dfs_access_in_type
+_assert_canonical_unmarked
+_dfs_assert_unmarked_p
+_dfs_accessible_p
+_build_x_modify_expr
+_build_modify_expr
+_require_complete_type
+_lvalue_or_else
+_get_unwidened
+_finish_expr_stmt
+_convert_to_void
+_lookup_base
+_lookup_base_r
+_build_method_call
+_build_new_method_call
+_resolve_args
+_add_function_candidate
+_list_length
+_lvalue_type
+_reference_binding
+_real_lvalue_p
+_reference_related_p
+_reference_compatible_p
+_at_least_as_qualified_p
+_direct_reference_binding
+_add_candidate
+_any_viable
+_splice_viable
+_tourney
+_is_dummy_object
+_build_over_call
+_unary_complex_lvalue
+_mark_addressable
+_staticp
+_cp_convert_to_pointer
+_is_friend
+_build_base_path
+_resolves_to_fixed_type_p
+_fixed_type_or_null
+_check_function_format
+_build_target_expr_with_type
+_build_target_expr
+_maybe_build_cleanup
+_build_cplus_new
+_nullify_returns_r
+_htab_expand
+_list_hash
+_find_empty_slot_for_expand
+_finish_decl_parsing
+_pop_lang_context
+_lookup_tag_reverse
+_finish_enum
+_tree_int_cst_lt
+_min_precision
+_tree_floor_log2
+_do_undef
+_get_inner_reference
+_optimize_bit_field_compare
+_condition_conversion
+_has_cleanups
+_finish_if_stmt_cond
+_build_x_arrow
+_build_x_binary_op
+_split_tree
+_grok_array_decl
+_build_array_ref
+_cp_pointer_int_sum
+_pointer_int_sum
+_size_in_bytes
+_extract_muldiv
+_finish_then_clause
+_finish_if_stmt
+_begin_if_stmt
+_shorten_compare
+_get_narrower
+_invert_tree_comparison
+_fold_range_test
+_make_range
+_cp_truthvalue_conversion
+_truthvalue_conversion
+_fold_truthop
+_maybe_convert_cond
+_negate_expr
+_finish_call_expr
+_is_global
+_lookup_arg_dependent
+_arg_assoc_args
+_arg_assoc
+_arg_assoc_type
+_build_x_function_call
+_build_function_call
+_build_function_call_real
+_decl_target_overloaded_intrinsic_p
+_inline_conversion
+_convert_arguments
+_build_call
+_build_addr_func
+_is_empty_class
+_arg_assoc_class
+_purpose_member
+_arg_assoc_namespace
+_convert_class_to_reference
+_lookup_conversions
+_add_conversions
+_build_component_addr
+_decl_type_context
+_convert_force
+_convert_to_pointer_force
+_parse_bitfield0
+_parse_bitfield
+_grokbitfield
+_locate_ctor
+_merge_exception_specifiers
+_locate_copy
+_funlike_invocation_p
+_collect_args
+_replace_args
+_expand_arg
+_push_ptoken_context
+__cpp_release_buff
+_merge_decl_attributes
+_merge_types
+_type_hash_hash
+_lshift_double
+_add_fields_to_vec
+_field_decl_cmp
+__cpp_extend_buff
+_twoval_comparison_p
+_swap_tree_comparison
+_merge_ranges
+_range_binop
+_build_range_check
+_unsigned_type
+_invert_truthvalue
+_build_x_conditional_expr
+_build_conditional_expr
+_operand_equal_for_comparison_p
+_truth_value_p
+_fold_binary_op_with_conditional_arg
+_global_bindings_p
+_integer_all_onesp
+_distribute_bit_expr
+_default_comp_type_attributes
+_setjmp_call_p
+_special_function_p
+_warn_about_long_double
+_reparse_absdcl_as_casts
+_altivec_is_vector_constant_element
+_groktypename
+_build_c_cast
+_convert_to_real
+_handle_aligned_attribute
+_tree_log2
+_is_attribute_p
+_finish_sizeof
+_c_sizeof
+_place_union_field
+_complete_array_type
+_handle_format_attribute
+_decode_format_attr
+_decode_format_type
+_attribute_hash_list
+_value_member
+_commonparms
+_tree_last
+_lookup_function_nonclass
+_lookup_name_nonclass
+_add_builtin_candidates
+_non_reference
+_type_decays_to
+_add_builtin_candidate
+_build_builtin_candidate
+_store_init_value
+_digest_init
+_combine_strings
+_choose_string_type
+_finish_asm_stmt
+_parse_output_constraint
+_check_multiple_declarators
+_varray_grow
+_pfe_s_realloc
+_pfe_realloc
+_build_this
+_stabilize_reference
+_stabilize_reference_1
+_lex_charconst
+_cpp_interpret_charconst
+_do_pragma
+_darwin_pragma_options
+_pop_field_alignment
+_build_x_compound_expr
+_build_compound_expr
+_null_ptr_cst_p
+_integer_pow2p
+_tree_expr_nonnegative_p
+_push_field_alignment
+__cpp_backup_tokens
+_ht_expand
+_clear_identifier_class_values
+_expand_tree_builtin
+_fold_builtin
+_trigraph_p
+_parse_method
+_start_method
+_snarf_method
+_snarf_block
+_finish_method
+_fixup_pending_inline
+_check_for_override
+_protected_accessible_p
+_pop_nested_class
+_enter_scope_of
+_push_nested_class
+_set_class_shadows
+_unuse_fields
+_dfs_unuse_fields
+_is_aggr_type
+_check_classfn
+_finish_this_expr
+_maybe_end_member_template_processing
+_process_next_inline
+_end_input
+_obstack_free
+_begin_parsing_inclass_inline
+_feed_input
+_maybe_begin_member_template_processing
+_inline_needs_template_parms
+_dump_exception_spec
+_see_typename
+_finish_base_specifier
+_xref_basetypes
+_unshare_base_binfos
+_get_vbase_types
+_unmarkedp
+_dfs_get_vbase_types
+_markedp
+_dfs_build_inheritance_graph_order
+_unmarked_pushdecls_p
+_template_self_reference_p
+_setup_class_bindings
+_lookup_field_queue_p
+_marked_pushdecls_p
+_mark_primary_bases
+_dfs_unshared_virtual_bases
+_build_base_field
+_propagate_binfo_offsets
+_get_primary_binfo
+_record_subobject_offsets
+_walk_subobject_offsets
+_record_subobject_offset
+_dfs_set_offset_for_unshared_vbases
+_dfs_unmarked_real_bases_queue_p
+_dfs_marked_real_bases_queue_p
+_feed_defarg
+_grok_method_quals
+_cp_type_qual_from_rid
+_make_reference_declarator
+_comp_ptr_ttypes
+_comp_ptr_ttypes_real
+_string_conv_p
+_frob_opname
+_maybe_dummy_object
+_build_field_call
+_finish_object_call_expr
+_initializer_constant_valid_p
+_cplus_expand_constant
+_layout_vtable_decl
+_get_vtbl_decl_for_binfo
+_initialize_vtable
+_initialize_array
+_char_type_p
+_process_init_constructor
+_dump_vtable
+_adjust_clone_args
+_begin_eh_spec_block
+_begin_constructor_body
+_finish_mem_initializers
+_emit_base_init
+_sort_member_init
+_build_field_list
+_sort_base_init
+_initialize_vtbl_ptrs
+_dfs_initialize_vtbl_ptrs
+_expand_virtual_init
+_build_vtbl_address
+_build_vfield_ref
+_perform_member_init
+_finish_constructor_body
+_finish_eh_spec_block
+_update_cloned_parm
+_store_bindings
+_clone_body
+_copy_body
+_copy_body_r
+_cp_auto_var_in_fn_p
+_copy_tree_r
+_copy_scope_stmt
+_remap_block
+_insert_block
+_nonstatic_local_decl_p
+_local_variable_p
+_remap_decl
+_pop_from_top_level
+_pfe_varray_free
+_handle_noreturn_attribute
+_check_default_argument
+_add_defarg_fn
+_shared_unmarked_p
+_canonical_binfo
+_shared_marked_p
+_dfs_canonical_queue
+_dfs_accessible_queue_p
+_is_subobject_of_p
+_revert_static_member_fn
+_begin_template_parm_list
+_begin_scope
+_note_template_header
+_finish_template_type_parm
+_process_template_parm
+_build_template_parm_index
+_end_template_parm_list
+_push_template_decl_real
+_template_parm_scope_p
+_check_default_tmpl_args
+_current_template_args
+_build_template_decl
+_pushdecl_namespace_level
+_classtype_mangled_name
+_most_general_template
+_mangle_class_name_for_template
+_get_innermost_template_args
+_type_as_string
+_finish_template_decl
+_end_template_decl
+_finish_scope
+_write_nested_name
+_write_prefix
+_write_source_name
+_write_number
+_hwint_to_ascii
+_write_identifier
+_joust
+_compare_ics
+_maybe_handle_implicit_object
+_maybe_handle_ref_bind
+_qualified_lookup_using_namespace
+_ambiguous_decl
+_do_scoped_id
+_finish_else_clause
+_build_functional_cast
+_build_user_type_conversion_1
+_build_ptr_wrapper
+_convert_default_arg
+_break_out_target_exprs
+_bot_manip
+_bot_replace
+_write_special_name_constructor
+_build_delete
+_build_dtor_call
+_write_special_name_destructor
+_build_throw
+_is_admissible_throw_operand
+_complete_ptr_ref_or_void_ptr_p
+_doing_eh
+_decl_is_java_type
+_push_throw_library_fn
+_push_library_fn
+_pushdecl_top_level
+_push_function_context_to
+_pop_function_context_from
+_restore_emit_status
+_begin_init_stmts
+_begin_stmt_expr
+_create_temporary_var
+_obscure_complex_init
+_build_aggr_init
+_expand_aggr_init_1
+_expand_default_init
+_build_new_function_call
+_ptr_reasonably_similar
+_begin_else_clause
+_finish_init_stmts
+_finish_stmt_expr
+_build_min
+_finish_decl_cleanup
+_do_allocate_exception
+_prepare_eh_type
+_build_eh_type_type
+_get_tinfo_decl
+_mangle_typeinfo_for_type
+_mangle_special_for_type
+_write_class_enum_type
+_check_bitfield_decl